aboutsummaryrefslogtreecommitdiff
path: root/lld/ELF/InputFiles.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/InputFiles.cpp')
-rw-r--r--lld/ELF/InputFiles.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index b5510b3b2736..775999a5f534 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -152,18 +152,17 @@ static bool isCompatible(InputFile *file) {
return false;
}
- InputFile *existing;
+ InputFile *existing = nullptr;
if (!objectFiles.empty())
existing = objectFiles[0];
else if (!sharedFiles.empty())
existing = sharedFiles[0];
else if (!bitcodeFiles.empty())
existing = bitcodeFiles[0];
- else
- llvm_unreachable("Must have -m, OUTPUT_FORMAT or existing input file to "
- "determine target emulation");
-
- error(toString(file) + " is incompatible with " + toString(existing));
+ std::string with;
+ if (existing)
+ with = " with " + toString(existing);
+ error(toString(file) + " is incompatible" + with);
return false;
}