diff options
author | Misha Brukman <brukman+llvm@gmail.com> | 2005-05-05 22:38:21 +0000 |
---|---|---|
committer | Misha Brukman <brukman+llvm@gmail.com> | 2005-05-05 22:38:21 +0000 |
commit | 827e8f0ffa9aba3e71394a0a15ac30d0e62655a7 (patch) | |
tree | 95fc8827c04589daec9c7576f5f9f3ffbce8bb51 /tools/llvmc | |
parent | 6b8a63ae583b53a942dca7c681f4cf161c90d35e (diff) | |
download | external_llvm-827e8f0ffa9aba3e71394a0a15ac30d0e62655a7.zip external_llvm-827e8f0ffa9aba3e71394a0a15ac30d0e62655a7.tar.gz external_llvm-827e8f0ffa9aba3e71394a0a15ac30d0e62655a7.tar.bz2 |
* Use consistent spacing for function arguments
* Output single-character strings as chars
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21705 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvmc')
-rw-r--r-- | tools/llvmc/llvmc.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/tools/llvmc/llvmc.cpp b/tools/llvmc/llvmc.cpp index 4f325e6..7cf89d3 100644 --- a/tools/llvmc/llvmc.cpp +++ b/tools/llvmc/llvmc.cpp @@ -215,14 +215,14 @@ static cl::list<std::string> Languages("x", cl::ZeroOrMore, //===------------------------------------------------------------------------=== //=== GetFileType - determine type of a file //===------------------------------------------------------------------------=== -const std::string GetFileType(const std::string& fname, unsigned pos ) { +const std::string GetFileType(const std::string& fname, unsigned pos) { static std::vector<std::string>::iterator langIt = Languages.begin(); static std::string CurrLang = ""; // If a -x LANG option has been specified .. - if ( langIt != Languages.end() ) + if (langIt != Languages.end()) // If the -x LANG option came before the current file on command line - if ( Languages.getPosition( langIt - Languages.begin() ) < pos ) { + if (Languages.getPosition( langIt - Languages.begin() ) < pos) { // use that language CurrLang = *langIt++; return CurrLang; @@ -233,19 +233,19 @@ const std::string GetFileType(const std::string& fname, unsigned pos ) { return CurrLang; // use that language // otherwise just determine lang from the filename's suffix - return fname.substr( fname.rfind('.',fname.size()) + 1 ); + return fname.substr(fname.rfind('.', fname.size()) + 1); } } // end anonymous namespace void handleTerminatingOptions(CompilerDriver* CD) { if (!PrintFileName.empty()) { - sys::Path path = CD->GetPathForLinkageItem(PrintFileName,false); + sys::Path path = CD->GetPathForLinkageItem(PrintFileName, false); std::string p = path.toString(); if (p.empty()) - std::cout << "Can't locate '" << PrintFileName << "'.\n"; + std::cout << "Can't locate `" << PrintFileName << "'.\n"; else - std::cout << p << "\n"; + std::cout << p << '\n'; exit(0); } } @@ -299,7 +299,7 @@ int main(int argc, char **argv) { if (StripOutput) flags |= CompilerDriver::STRIP_OUTPUT_FLAG; CD->setDriverFlags(flags); - // Specify requred parameters + // Specify required parameters CD->setFinalPhase(FinalPhase); CD->setOptimization(OptLevel); CD->setOutputMachine(OutputMachine); @@ -332,30 +332,30 @@ int main(int argc, char **argv) { std::vector<std::string>::iterator libIt = Libraries.begin(); unsigned libPos = 0, filePos = 0; while ( 1 ) { - if ( libIt != Libraries.end() ) + if (libIt != Libraries.end()) libPos = Libraries.getPosition( libIt - Libraries.begin() ); else libPos = 0; - if ( fileIt != Files.end() ) - filePos = Files.getPosition( fileIt - Files.begin() ); + if (fileIt != Files.end()) + filePos = Files.getPosition(fileIt - Files.begin()); else filePos = 0; - if ( filePos != 0 && (libPos == 0 || filePos < libPos) ) { + if (filePos != 0 && (libPos == 0 || filePos < libPos)) { // Add a source file - InpList.push_back( std::make_pair(*fileIt, GetFileType(*fileIt,filePos))); + InpList.push_back(std::make_pair(*fileIt, + GetFileType(*fileIt, filePos))); ++fileIt; - } - else if ( libPos != 0 && (filePos == 0 || libPos < filePos) ) { + } else if ( libPos != 0 && (filePos == 0 || libPos < filePos) ) { // Add a library - InpList.push_back( std::make_pair(*libIt++,"")); + InpList.push_back(std::make_pair(*libIt++, "")); } else break; // we're done with the list } // Tell the driver to do its thing - int result = CD->execute(InpList,sys::Path(OutputFilename)); + int result = CD->execute(InpList, sys::Path(OutputFilename)); if (result != 0) { throw std::string("Error executing actions. Terminated."); return result; @@ -364,7 +364,7 @@ int main(int argc, char **argv) { // All is good, return success return 0; } catch (const std::string& msg) { - std::cerr << argv[0] << ": " << msg << "\n"; + std::cerr << argv[0] << ": " << msg << '\n'; } catch (...) { std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; } |