1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

bugpoint: Return early after error, NFC

llvm-svn: 233252
This commit is contained in:
Duncan P. N. Exon Smith 2015-03-26 05:03:06 +00:00
parent f4be6ae977
commit fd501e4fda

View File

@ -86,23 +86,23 @@ std::unique_ptr<Module> llvm::parseInputFile(StringRef Filename,
LLVMContext &Ctxt) {
SMDiagnostic Err;
std::unique_ptr<Module> Result = parseIRFile(Filename, Err, Ctxt);
if (!Result)
if (!Result) {
Err.print("bugpoint", errs());
return Result;
}
// If we don't have an override triple, use the first one to configure
// bugpoint, or use the host triple if none provided.
if (Result) {
if (TargetTriple.getTriple().empty()) {
Triple TheTriple(Result->getTargetTriple());
if (TargetTriple.getTriple().empty()) {
Triple TheTriple(Result->getTargetTriple());
if (TheTriple.getTriple().empty())
TheTriple.setTriple(sys::getDefaultTargetTriple());
if (TheTriple.getTriple().empty())
TheTriple.setTriple(sys::getDefaultTargetTriple());
TargetTriple.setTriple(TheTriple.getTriple());
}
Result->setTargetTriple(TargetTriple.getTriple()); // override the triple
TargetTriple.setTriple(TheTriple.getTriple());
}
Result->setTargetTriple(TargetTriple.getTriple()); // override the triple
return Result;
}