aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMark Seaborn <mseaborn@chromium.org>2013-04-01 09:33:02 -0700
committerMark Seaborn <mseaborn@chromium.org>2013-04-01 09:33:02 -0700
commita6c4b28460c42bc9fbbdcefffb4aed603f07f068 (patch)
tree2dcc9c33b3e267c01e822130de5bdba3adc511cf /tools
parentcd93e1afec966dba60433f8df5f78f10ef217f93 (diff)
PNaCl: Allow the ABI checker to be used from "opt"
This allows the ABI checker passes to be used in the same way as LLVM's "-verify" pass. It allows the checker to be run between other passes, and without launching pnacl-abicheck as a separate process (so without the overhead of reading bitcode into memory again). Make the ABI checker passes produce fatal errors by default, to match "-verify". This is overridden for pnacl-abicheck's use. BUG=https://code.google.com/p/nativeclient/issues/detail?id=2309 TEST=tested with pnacl-ld.py changes to use the ABI checker passes Review URL: https://codereview.chromium.org/13323006
Diffstat (limited to 'tools')
-rw-r--r--tools/opt/opt.cpp2
-rw-r--r--tools/pnacl-abicheck/pnacl-abicheck.cpp1
2 files changed, 3 insertions, 0 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp
index 106da562c6..2998a047cf 100644
--- a/tools/opt/opt.cpp
+++ b/tools/opt/opt.cpp
@@ -584,6 +584,8 @@ int main(int argc, char **argv) {
initializeExpandTlsConstantExprPass(Registry);
initializeExpandVarArgsPass(Registry);
initializeGlobalCleanupPass(Registry);
+ initializePNaClABIVerifyFunctionsPass(Registry);
+ initializePNaClABIVerifyModulePass(Registry);
initializeResolveAliasesPass(Registry);
initializeStripMetadataPass(Registry);
// @LOCALMOD-END
diff --git a/tools/pnacl-abicheck/pnacl-abicheck.cpp b/tools/pnacl-abicheck/pnacl-abicheck.cpp
index 2fefd46c8b..8fdc545afb 100644
--- a/tools/pnacl-abicheck/pnacl-abicheck.cpp
+++ b/tools/pnacl-abicheck/pnacl-abicheck.cpp
@@ -55,6 +55,7 @@ int main(int argc, char **argv) {
return 1;
}
PNaClABIErrorReporter ABIErrorReporter;
+ ABIErrorReporter.setNonFatal();
bool ErrorsFound = false;
// 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.