aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lto
diff options
context:
space:
mode:
authorShuxin Yang <shuxin.llvm@gmail.com>2013-08-06 21:51:21 +0000
committerShuxin Yang <shuxin.llvm@gmail.com>2013-08-06 21:51:21 +0000
commit0880939a590abab124c8520aaa4ac5a46f1937c6 (patch)
tree0c6dc09d7ae4826916306e27b010b298ebe2ab08 /tools/lto
parentae8e3cfbca31cddac5a891b1d5606399dd4fefe0 (diff)
downloadexternal_llvm-0880939a590abab124c8520aaa4ac5a46f1937c6.zip
external_llvm-0880939a590abab124c8520aaa4ac5a46f1937c6.tar.gz
external_llvm-0880939a590abab124c8520aaa4ac5a46f1937c6.tar.bz2
Change private functions of LTOCodeGenerator from ret-false-on-succ to ret-true-on-succ.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187819 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lto')
-rw-r--r--tools/lto/LTOCodeGenerator.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp
index 6139ade..b2cb22e 100644
--- a/tools/lto/LTOCodeGenerator.cpp
+++ b/tools/lto/LTOCodeGenerator.cpp
@@ -159,7 +159,7 @@ bool LTOCodeGenerator::setCodePICModel(lto_codegen_model model,
bool LTOCodeGenerator::writeMergedModules(const char *path,
std::string &errMsg) {
- if (determineTarget(errMsg))
+ if (!determineTarget(errMsg))
return true;
// Run the verifier on the merged modules.
@@ -213,7 +213,7 @@ bool LTOCodeGenerator::compile_to_file(const char** name, std::string& errMsg) {
}
objFile.keep();
- if (genResult) {
+ if (!genResult) {
sys::fs::remove(Twine(Filename));
return true;
}
@@ -252,7 +252,7 @@ const void* LTOCodeGenerator::compile(size_t* length, std::string& errMsg) {
bool LTOCodeGenerator::determineTarget(std::string &errMsg) {
if (_target != NULL)
- return false;
+ return true;
// if options were requested, set them
if (!_codegenOptions.empty())
@@ -267,7 +267,7 @@ bool LTOCodeGenerator::determineTarget(std::string &errMsg) {
// create target machine from info for merged modules
const Target *march = TargetRegistry::lookupTarget(TripleStr, errMsg);
if (march == NULL)
- return true;
+ return false;
// The relocation model is actually a static member of TargetMachine and
// needs to be set before the TargetMachine is instantiated.
@@ -300,7 +300,7 @@ bool LTOCodeGenerator::determineTarget(std::string &errMsg) {
_target = march->createTargetMachine(TripleStr, _mCpu, FeatureStr, Options,
RelocModel, CodeModel::Default,
CodeGenOpt::Aggressive);
- return false;
+ return true;
}
void LTOCodeGenerator::
@@ -391,8 +391,8 @@ void LTOCodeGenerator::applyScopeRestrictions() {
/// Optimize merged modules using various IPO passes
bool LTOCodeGenerator::generateObjectFile(raw_ostream &out,
std::string &errMsg) {
- if (this->determineTarget(errMsg))
- return true;
+ if (!this->determineTarget(errMsg))
+ return false;
Module* mergedModule = _linker.getModule();
@@ -435,7 +435,7 @@ bool LTOCodeGenerator::generateObjectFile(raw_ostream &out,
if (_target->addPassesToEmitFile(codeGenPasses, Out,
TargetMachine::CGFT_ObjectFile)) {
errMsg = "target file type not supported";
- return true;
+ return false;
}
// Run our queue of passes all at once now, efficiently.
@@ -444,7 +444,7 @@ bool LTOCodeGenerator::generateObjectFile(raw_ostream &out,
// Run the code generator, and write assembly file
codeGenPasses.run(*mergedModule);
- return false; // success
+ return true;
}
/// setCodeGenDebugOptions - Set codegen debugging options to aid in debugging