aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-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 8f6eeed..3217d23 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 adc6e90..fa2de76 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";