aboutsummaryrefslogtreecommitdiff
path: root/tools/lli
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-11-13 00:28:01 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-11-13 00:28:01 +0000
commit46a27169104ac4cded2bd91e7f872efa80e08446 (patch)
tree7bc5e2986e11e63b2bd904dcdb8d6eb3dd38c906 /tools/lli
parente5e0ef180ea1d0d7b482f998db12defde96cbf4f (diff)
lli: Switch to using ParseIRFile, for consistency with other LLVM tools.
- Also, switch tests to not using llvm-as. They run 20% faster now, not that it matters. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118952 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lli')
-rw-r--r--tools/lli/Makefile2
-rw-r--r--tools/lli/lli.cpp16
2 files changed, 7 insertions, 11 deletions
diff --git a/tools/lli/Makefile b/tools/lli/Makefile
index 8f6eeed486..3217d23d31 100644
--- a/tools/lli/Makefile
+++ b/tools/lli/Makefile
@@ -9,7 +9,7 @@
LEVEL := ../..
TOOLNAME := lli
-LINK_COMPONENTS := jit interpreter nativecodegen bitreader selectiondag
+LINK_COMPONENTS := jit interpreter nativecodegen bitreader asmparser selectiondag
# Enable JIT support
include $(LEVEL)/Makefile.common
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp
index adc6e90eb9..fa2de76062 100644
--- a/tools/lli/lli.cpp
+++ b/tools/lli/lli.cpp
@@ -24,6 +24,7 @@
#include "llvm/ExecutionEngine/JIT.h"
#include "llvm/ExecutionEngine/JITEventListener.h"
#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/IRReader.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/PluginLoader.h"
@@ -136,20 +137,15 @@ int main(int argc, char **argv, char * const *envp) {
sys::Process::PreventCoreFiles();
// Load the bitcode...
- std::string ErrorMsg;
- Module *Mod = NULL;
- if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(InputFile,&ErrorMsg)){
- Mod = getLazyBitcodeModule(Buffer, Context, &ErrorMsg);
- if (!Mod) delete Buffer;
- }
-
+ SMDiagnostic Err;
+ Module *Mod = ParseIRFile(InputFile, Err, Context);
if (!Mod) {
- errs() << argv[0] << ": error loading program '" << InputFile << "': "
- << ErrorMsg << "\n";
- exit(1);
+ Err.Print(argv[0], errs());
+ return 1;
}
// If not jitting lazily, load the whole bitcode file eagerly too.
+ std::string ErrorMsg;
if (NoLazyCompilation) {
if (Mod->MaterializeAllPermanently(&ErrorMsg)) {
errs() << argv[0] << ": bitcode didn't read correctly.\n";