llvm.org GIT mirror llvm / 0880939
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 Shuxin Yang 7 years ago
1 changed file(s) with 9 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
158158
159159 bool LTOCodeGenerator::writeMergedModules(const char *path,
160160 std::string &errMsg) {
161 if (determineTarget(errMsg))
161 if (!determineTarget(errMsg))
162162 return true;
163163
164164 // Run the verifier on the merged modules.
212212 }
213213
214214 objFile.keep();
215 if (genResult) {
215 if (!genResult) {
216216 sys::fs::remove(Twine(Filename));
217217 return true;
218218 }
251251
252252 bool LTOCodeGenerator::determineTarget(std::string &errMsg) {
253253 if (_target != NULL)
254 return false;
254 return true;
255255
256256 // if options were requested, set them
257257 if (!_codegenOptions.empty())
266266 // create target machine from info for merged modules
267267 const Target *march = TargetRegistry::lookupTarget(TripleStr, errMsg);
268268 if (march == NULL)
269 return true;
269 return false;
270270
271271 // The relocation model is actually a static member of TargetMachine and
272272 // needs to be set before the TargetMachine is instantiated.
299299 _target = march->createTargetMachine(TripleStr, _mCpu, FeatureStr, Options,
300300 RelocModel, CodeModel::Default,
301301 CodeGenOpt::Aggressive);
302 return false;
302 return true;
303303 }
304304
305305 void LTOCodeGenerator::
390390 /// Optimize merged modules using various IPO passes
391391 bool LTOCodeGenerator::generateObjectFile(raw_ostream &out,
392392 std::string &errMsg) {
393 if (this->determineTarget(errMsg))
394 return true;
393 if (!this->determineTarget(errMsg))
394 return false;
395395
396396 Module* mergedModule = _linker.getModule();
397397
434434 if (_target->addPassesToEmitFile(codeGenPasses, Out,
435435 TargetMachine::CGFT_ObjectFile)) {
436436 errMsg = "target file type not supported";
437 return true;
437 return false;
438438 }
439439
440440 // Run our queue of passes all at once now, efficiently.
443443 // Run the code generator, and write assembly file
444444 codeGenPasses.run(*mergedModule);
445445
446 return false; // success
446 return true;
447447 }
448448
449449 /// setCodeGenDebugOptions - Set codegen debugging options to aid in debugging