diff options
author | Derek Schuff <dschuff@chromium.org> | 2013-03-14 10:14:47 -0700 |
---|---|---|
committer | Derek Schuff <dschuff@chromium.org> | 2013-03-14 10:14:47 -0700 |
commit | b3ace3f5ed473e4b19dd1d7f9257218cedd37a96 (patch) | |
tree | 98479701300bdf7ad001b926f7340e18a862a987 | |
parent | cb0dcd0adf5e43486154d143da30710fee0da301 (diff) |
Cleanup of ABI Checker
Fix spacing of error output, use OwningPtr everywhere at top level,
fix command line parsing
R=jvoung@chromium.org
BUG=
Review URL: https://codereview.chromium.org/12690007
-rw-r--r-- | test/NaCl/PNaClABI/instructions.ll | 2 | ||||
-rw-r--r-- | test/NaCl/PNaClABI/linkagetypes.ll | 2 | ||||
-rw-r--r-- | test/NaCl/PNaClABI/types-function.ll | 2 | ||||
-rw-r--r-- | test/NaCl/PNaClABI/types.ll | 2 | ||||
-rw-r--r-- | tools/llc/llc.cpp | 2 | ||||
-rw-r--r-- | tools/pnacl-abicheck/pnacl-abicheck.cpp | 12 |
6 files changed, 12 insertions, 10 deletions
diff --git a/test/NaCl/PNaClABI/instructions.ll b/test/NaCl/PNaClABI/instructions.ll index 7461f7a361..3bd95c8e0f 100644 --- a/test/NaCl/PNaClABI/instructions.ll +++ b/test/NaCl/PNaClABI/instructions.ll @@ -1,4 +1,4 @@ -; RUN: opt -verify-pnaclabi-functions -analyze < %s | FileCheck %s +; RUN: pnacl-abicheck < %s | FileCheck %s ; Test instruction opcodes allowed by PNaCl ABI ; No testing yet of operands, types, attributes, etc diff --git a/test/NaCl/PNaClABI/linkagetypes.ll b/test/NaCl/PNaClABI/linkagetypes.ll index ab6d81f351..7aa0ea8122 100644 --- a/test/NaCl/PNaClABI/linkagetypes.ll +++ b/test/NaCl/PNaClABI/linkagetypes.ll @@ -1,4 +1,4 @@ -; RUN: opt -verify-pnaclabi-module -analyze < %s | FileCheck %s +; RUN: pnacl-abicheck < %s | FileCheck %s ; Test linkage types allowed by PNaCl ABI target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" diff --git a/test/NaCl/PNaClABI/types-function.ll b/test/NaCl/PNaClABI/types-function.ll index d020c76499..e781163b83 100644 --- a/test/NaCl/PNaClABI/types-function.ll +++ b/test/NaCl/PNaClABI/types-function.ll @@ -1,4 +1,4 @@ -; RUN: opt -verify-pnaclabi-functions -analyze < %s | FileCheck %s +; RUN: pnacl-abicheck < %s | FileCheck %s ; Test type-checking in function bodies. This test is not intended to verify ; all the rules about the various types, but instead to make sure that types ; stashed in various places in function bodies are caught. diff --git a/test/NaCl/PNaClABI/types.ll b/test/NaCl/PNaClABI/types.ll index 05248bae06..8fdfb4e794 100644 --- a/test/NaCl/PNaClABI/types.ll +++ b/test/NaCl/PNaClABI/types.ll @@ -1,4 +1,4 @@ -; RUN: opt -verify-pnaclabi-module -analyze < %s | FileCheck %s +; RUN: pnacl-abicheck < %s | FileCheck %s ; Test types allowed by PNaCl ABI ; Basic global types diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index 7294b3d347..45bb92f424 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -320,7 +320,7 @@ int llc_main(int argc, char **argv) { static void CheckABIVerifyErrors(PNaClABIErrorReporter &Reporter, const Twine &Name) { if (PNaClABIVerify && Reporter.getErrorCount() > 0) { - errs() << (PNaClABIVerifyFatalErrors ? "ERROR:" : "WARNING:"); + errs() << (PNaClABIVerifyFatalErrors ? "ERROR: " : "WARNING: "); errs() << Name << " is not valid PNaCl bitcode:\n"; Reporter.printErrors(errs()); if (PNaClABIVerifyFatalErrors) diff --git a/tools/pnacl-abicheck/pnacl-abicheck.cpp b/tools/pnacl-abicheck/pnacl-abicheck.cpp index 2bee788872..496a73c2fd 100644 --- a/tools/pnacl-abicheck/pnacl-abicheck.cpp +++ b/tools/pnacl-abicheck/pnacl-abicheck.cpp @@ -29,8 +29,8 @@ InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-")); static void CheckABIVerifyErrors(PNaClABIErrorReporter &Reporter, const Twine &Name) { if (Reporter.getErrorCount() > 0) { - errs() << "ERROR: " << Name << " is not valid PNaCl bitcode:\n"; - Reporter.printErrors(errs()); + outs() << "ERROR: " << Name << " is not valid PNaCl bitcode:\n"; + Reporter.printErrors(outs()); } Reporter.reset(); } @@ -38,6 +38,8 @@ static void CheckABIVerifyErrors(PNaClABIErrorReporter &Reporter, int main(int argc, char **argv) { LLVMContext &Context = getGlobalContext(); SMDiagnostic Err; + cl::ParseCommandLineOptions(argc, argv, "PNaCl Bitcode ABI checker\n"); + OwningPtr<Module> Mod(ParseIRFile(InputFilename, Err, Context)); if (Mod.get() == 0) { Err.print(argv[0], errs()); @@ -46,11 +48,11 @@ int main(int argc, char **argv) { PNaClABIErrorReporter ABIErrorReporter; // Manually run the passes so we can tell the user which function had the // error. No need for a pass manager since it's just one pass. - ModulePass *ModuleChecker = createPNaClABIVerifyModulePass(&ABIErrorReporter); + OwningPtr<ModulePass> ModuleChecker(createPNaClABIVerifyModulePass(&ABIErrorReporter)); ModuleChecker->runOnModule(*Mod); CheckABIVerifyErrors(ABIErrorReporter, "Module"); - FunctionPass *FunctionChecker = - createPNaClABIVerifyFunctionsPass(&ABIErrorReporter); + OwningPtr<FunctionPass> FunctionChecker( + createPNaClABIVerifyFunctionsPass(&ABIErrorReporter)); for (Module::iterator MI = Mod->begin(), ME = Mod->end(); MI != ME; ++MI) { FunctionChecker->runOnFunction(*MI); CheckABIVerifyErrors(ABIErrorReporter, "Function " + MI->getName()); |