summaryrefslogtreecommitdiff
path: root/tools/lto
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-08-08 22:03:50 +0000
committerBill Wendling <isanbard@gmail.com>2012-08-08 22:03:50 +0000
commit0ca36afc9d30aa2fe550750b2c3f1d3acf8c9fed (patch)
treed2c2b42b49b98c12c26c510a7834f28b25633408 /tools/lto
parent5682527882aa3ddc74d0b283496fedd069a8e55d (diff)
downloadllvm-0ca36afc9d30aa2fe550750b2c3f1d3acf8c9fed.tar.gz
llvm-0ca36afc9d30aa2fe550750b2c3f1d3acf8c9fed.tar.bz2
llvm-0ca36afc9d30aa2fe550750b2c3f1d3acf8c9fed.tar.xz
Remove some coding violations. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161530 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lto')
-rw-r--r--tools/lto/LTOCodeGenerator.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp
index c07135cf84..b80bc34a23 100644
--- a/tools/lto/LTOCodeGenerator.cpp
+++ b/tools/lto/LTOCodeGenerator.cpp
@@ -154,7 +154,7 @@ bool LTOCodeGenerator::writeMergedModules(const char *path,
bool LTOCodeGenerator::compile_to_file(const char** name, std::string& errMsg) {
// make unique temp .o file to put generated object file
sys::PathWithStatus uniqueObjPath("lto-llvm.o");
- if ( uniqueObjPath.createTemporaryFileOnDisk(false, &errMsg) ) {
+ if (uniqueObjPath.createTemporaryFileOnDisk(false, &errMsg)) {
uniqueObjPath.eraseFromDisk();
return true;
}
@@ -174,7 +174,7 @@ bool LTOCodeGenerator::compile_to_file(const char** name, std::string& errMsg) {
}
objFile.keep();
- if ( genResult ) {
+ if (genResult) {
uniqueObjPath.eraseFromDisk();
return true;
}
@@ -204,14 +204,15 @@ const void* LTOCodeGenerator::compile(size_t* length, std::string& errMsg) {
sys::Path(_nativeObjectPath).eraseFromDisk();
// return buffer, unless error
- if ( _nativeObjectFile == NULL )
+ if (_nativeObjectFile == NULL)
return NULL;
*length = _nativeObjectFile->getBufferSize();
return _nativeObjectFile->getBufferStart();
}
bool LTOCodeGenerator::determineTarget(std::string& errMsg) {
- if ( _target != NULL ) return false;
+ if (_target != NULL)
+ return false;
std::string Triple = _linker.getModule()->getTargetTriple();
if (Triple.empty())
@@ -219,13 +220,13 @@ bool LTOCodeGenerator::determineTarget(std::string& errMsg) {
// create target machine from info for merged modules
const Target *march = TargetRegistry::lookupTarget(Triple, errMsg);
- if ( march == NULL )
+ if (march == NULL)
return true;
// The relocation model is actually a static member of TargetMachine and
// needs to be set before the TargetMachine is instantiated.
Reloc::Model RelocModel = Reloc::Default;
- switch( _codeModel ) {
+ switch (_codeModel) {
case LTO_CODEGEN_PIC_MODEL_STATIC:
RelocModel = Reloc::Static;
break;
@@ -337,13 +338,13 @@ void LTOCodeGenerator::applyScopeRestrictions() {
/// Optimize merged modules using various IPO passes
bool LTOCodeGenerator::generateObjectFile(raw_ostream &out,
std::string &errMsg) {
- if ( this->determineTarget(errMsg) )
+ if (this->determineTarget(errMsg))
return true;
Module* mergedModule = _linker.getModule();
// if options were requested, set them
- if ( !_codegenOptions.empty() )
+ if (!_codegenOptions.empty())
cl::ParseCommandLineOptions(_codegenOptions.size(),
const_cast<char **>(&_codegenOptions[0]));
@@ -405,7 +406,7 @@ void LTOCodeGenerator::setCodeGenDebugOptions(const char *options) {
!o.first.empty(); o = getToken(o.second)) {
// ParseCommandLineOptions() expects argv[0] to be program name. Lazily add
// that.
- if ( _codegenOptions.empty() )
+ if (_codegenOptions.empty())
_codegenOptions.push_back(strdup("libLTO"));
_codegenOptions.push_back(strdup(o.first.str().c_str()));
}