summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-09-02 19:35:19 +0000
committerDan Gohman <gohman@apple.com>2009-09-02 19:35:19 +0000
commitc76bfb777e7a27b8f2f2c2c5888b7202c7168466 (patch)
tree09e0eb6f2c657ddfd262dd2b69fcb1a542ad6af8
parentf8bd861ce97c4bcf7a5cf77c12aa0f3235b1ef61 (diff)
downloadbcm5719-llvm-c76bfb777e7a27b8f2f2c2c5888b7202c7168466.tar.gz
bcm5719-llvm-c76bfb777e7a27b8f2f2c2c5888b7202c7168466.zip
Switch llc from ParseBitcodeFile to ParseIRFile. This lets llc
transparently read either LLVM Assembly or LLVM Bitcode files. llvm-svn: 80829
-rw-r--r--llvm/tools/llc/Makefile2
-rw-r--r--llvm/tools/llc/llc.cpp12
2 files changed, 5 insertions, 9 deletions
diff --git a/llvm/tools/llc/Makefile b/llvm/tools/llc/Makefile
index 8514040cf27..7319aada489 100644
--- a/llvm/tools/llc/Makefile
+++ b/llvm/tools/llc/Makefile
@@ -15,7 +15,7 @@ TOOLNAME = llc
# early so we can set up LINK_COMPONENTS before including Makefile.rules
include $(LEVEL)/Makefile.config
-LINK_COMPONENTS := $(TARGETS_TO_BUILD) bitreader
+LINK_COMPONENTS := $(TARGETS_TO_BUILD) bitreader asmparser
include $(LLVM_SRC_ROOT)/Makefile.rules
diff --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp
index 6ff97f3f5bc..8de49c08a7e 100644
--- a/llvm/tools/llc/llc.cpp
+++ b/llvm/tools/llc/llc.cpp
@@ -20,7 +20,7 @@
#include "llvm/Pass.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Analysis/Verifier.h"
-#include "llvm/Bitcode/ReaderWriter.h"
+#include "llvm/Support/IRReader.h"
#include "llvm/CodeGen/FileWriters.h"
#include "llvm/CodeGen/LinkAllAsmWriterComponents.h"
#include "llvm/CodeGen/LinkAllCodegenComponents.h"
@@ -218,16 +218,12 @@ int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv, "llvm system compiler\n");
// Load the module to be compiled...
- std::string ErrorMessage;
+ SMDiagnostic Err;
std::auto_ptr<Module> M;
- std::auto_ptr<MemoryBuffer> Buffer(
- MemoryBuffer::getFileOrSTDIN(InputFilename, &ErrorMessage));
- if (Buffer.get())
- M.reset(ParseBitcodeFile(Buffer.get(), Context, &ErrorMessage));
+ M.reset(ParseIRFile(InputFilename, Err, Context));
if (M.get() == 0) {
- errs() << argv[0] << ": bitcode didn't read correctly.\n";
- errs() << "Reason: " << ErrorMessage << "\n";
+ Err.Print(argv[0], errs());
return 1;
}
Module &mod = *M.get();
OpenPOWER on IntegriCloud