Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(941)

Unified Diff: tools/pnacl-abicheck/pnacl-abicheck.cpp

Issue 18884003: Add option to pnacl-abicheck to handle pnacl bitcode (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/pnacl-abicheck/Makefile ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « tools/pnacl-abicheck/Makefile ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698