summaryrefslogtreecommitdiff
path: root/tools/lli
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lli')
-rw-r--r--tools/lli/lli.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp
index 30b65997d6..a69f53c98a 100644
--- a/tools/lli/lli.cpp
+++ b/tools/lli/lli.cpp
@@ -88,6 +88,13 @@ int main(int argc, char** argv) {
EE = ExecutionEngine::createInterpreter(M, Config, DebugMode, TraceMode);
// Add the module name to the start of the argv vector...
+ // But delete .bc first, since programs (and users) might not expect to
+ // see it.
+ const std::string ByteCodeFileSuffix (".bc");
+ if (InputFile.rfind (ByteCodeFileSuffix) ==
+ InputFile.length () - ByteCodeFileSuffix.length ()) {
+ InputFile.erase (InputFile.length () - ByteCodeFileSuffix.length ());
+ }
InputArgv.insert(InputArgv.begin(), InputFile);
// Run the main function!