mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-16 16:37:42 +00:00
bugpoint: Return early after error, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233252 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
45f376c4e6
commit
6a62f78523
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user