mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-13 07:50:50 +00:00
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
This commit is contained in:
parent
ae8e3cfbca
commit
0880939a59
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user