aboutsummaryrefslogtreecommitdiff
path: root/tools/pnacl-abicheck/pnacl-abicheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/pnacl-abicheck/pnacl-abicheck.cpp')
-rw-r--r--tools/pnacl-abicheck/pnacl-abicheck.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/pnacl-abicheck/pnacl-abicheck.cpp b/tools/pnacl-abicheck/pnacl-abicheck.cpp
index 06b174d1b8..8b96f17954 100644
--- a/tools/pnacl-abicheck/pnacl-abicheck.cpp
+++ b/tools/pnacl-abicheck/pnacl-abicheck.cpp
@@ -13,6 +13,7 @@
#include "llvm/ADT/OwningPtr.h"
#include "llvm/Analysis/NaCl.h"
+#include "llvm/IRReader/IRReader.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/Pass.h"
@@ -29,6 +30,16 @@ InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-"));
static cl::opt<bool>
Quiet("q", cl::desc("Do not print error messages"));
+static cl::opt<NaClFileFormat>
+InputFileFormat(
+ "bitcode-format",
+ cl::desc("Define format of input file:"),
+ cl::values(
+ clEnumValN(LLVMFormat, "llvm", "LLVM file (default)"),
+ clEnumValN(PNaClFormat, "pnacl", "PNaCl bitcode file"),
+ clEnumValEnd),
+ cl::init(LLVMFormat));
+
// Print any errors collected by the error reporter. Return true if
// there were any.
static bool CheckABIVerifyErrors(PNaClABIErrorReporter &Reporter,
@@ -49,7 +60,8 @@ int main(int argc, char **argv) {
SMDiagnostic Err;
cl::ParseCommandLineOptions(argc, argv, "PNaCl Bitcode ABI checker\n");
- OwningPtr<Module> Mod(ParseIRFile(InputFilename, Err, Context));
+ OwningPtr<Module> Mod(
+ NaClParseIRFile(InputFilename, InputFileFormat, Err, Context));
if (Mod.get() == 0) {
Err.print(argv[0], errs());
return 1;