| Index: tools/pnacl-abicheck/pnacl-abicheck.cpp
|
| diff --git a/tools/pnacl-abicheck/pnacl-abicheck.cpp b/tools/pnacl-abicheck/pnacl-abicheck.cpp
|
| index 06b174d1b88d1f66d513ddd9cb3e8930200eec37..8b96f17954380dea3fbe5cbad1898bf20ca27ec9 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;
|
|
|