diff options
author | Jan Voung <jvoung@chromium.org> | 2013-07-22 10:44:21 -0700 |
---|---|---|
committer | Jan Voung <jvoung@chromium.org> | 2013-07-22 10:44:21 -0700 |
commit | 9b2942831f43dd9a5802565b9996bdf2c0bfd896 (patch) | |
tree | ff2e17be3f7b1cb805543e436624e4d04e13a70f /lib/Analysis | |
parent | 1856bd7d7cb47f7ae32b7c848a8df5c28281e424 (diff) |
Disallow dev/private intrinsics by default (only llvm.nacl.target.arch remains)
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3525
R=jfb@chromium.org
Review URL: https://codereview.chromium.org/19668004
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/NaCl/PNaClABIVerifyModule.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp b/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp index 2793d2ec96..f1359866bd 100644 --- a/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp +++ b/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp @@ -39,8 +39,8 @@ PNaClABIAllowDebugMetadata("pnaclabi-allow-debug-metadata", static cl::opt<bool> PNaClABIAllowDevIntrinsics("pnaclabi-allow-dev-intrinsics", - cl::desc("Allow all LLVM intrinsics during PNaCl ABI verification."), - cl::init(true)); // TODO(jvoung): Make this false by default. + cl::desc("Allow dev LLVM intrinsics during PNaCl ABI verification."), + cl::init(false)); namespace { // This pass should not touch function bodies, to stay streaming-friendly @@ -234,8 +234,10 @@ bool AllowedIntrinsics::isAllowed(const Function *Func) { // Keep 3 categories of intrinsics for now. // (1) Allowed always, provided the exact name and type match. // (2) Never allowed. - // (3) "Dev" intrinsics, which may or may not be allowed. - // "Dev" intrinsics are controlled by the PNaClABIAllowDevIntrinsics flag. + // (3) "Dev": intrinsics in the development or prototype stage, + // or private intrinsics used for building special programs. + // (4) Debug info intrinsics. + // // Please keep these sorted or grouped in a sensible way, within // each category. @@ -312,11 +314,13 @@ bool AllowedIntrinsics::isAllowed(const Function *Func) { return false; // (3) Dev intrinsics. - case Intrinsic::dbg_declare: - case Intrinsic::dbg_value: - return PNaClABIAllowDevIntrinsics || PNaClABIAllowDebugMetadata; case Intrinsic::nacl_target_arch: // Used by translator self-build. return PNaClABIAllowDevIntrinsics; + + // (4) Debug info intrinsics. + case Intrinsic::dbg_declare: + case Intrinsic::dbg_value: + return PNaClABIAllowDebugMetadata; } } |