summaryrefslogtreecommitdiffstats
path: root/llvm/tools/lli/lli.cpp
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
commit9589bf8a86e44238cdbc44627e7c163bd43c0c70 (patch)
treea0ee944ac90cef6dee59ffc59ee777f75d76a380 /llvm/tools/lli/lli.cpp
parent8ce967e3931d91ea936205677e7aa9895402c90c (diff)
downloadbcm5719-llvm-9589bf8a86e44238cdbc44627e7c163bd43c0c70.tar.gz
bcm5719-llvm-9589bf8a86e44238cdbc44627e7c163bd43c0c70.zip
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. llvm-svn: 118952
Diffstat (limited to 'llvm/tools/lli/lli.cpp')
-rw-r--r--llvm/tools/lli/lli.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
index adc6e90eb99..fa2de760627 100644
--- a/llvm/tools/lli/lli.cpp
+++ b/llvm/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";
OpenPOWER on IntegriCloud