diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/NaCl/PNaClABIVerifyModule.cpp | 9 | ||||
-rw-r--r-- | lib/Transforms/NaCl/PNaClABISimplify.cpp | 8 |
2 files changed, 12 insertions, 5 deletions
diff --git a/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp b/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp index 0e406e6512..9b2def5ac4 100644 --- a/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp +++ b/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp @@ -163,8 +163,6 @@ bool PNaClABIVerifyModule::isWhitelistedIntrinsic(const Function *F, case Intrinsic::bswap: return isWhitelistedBswap(F); case Intrinsic::invariant_end: case Intrinsic::invariant_start: - case Intrinsic::lifetime_end: - case Intrinsic::lifetime_start: case Intrinsic::memcpy: case Intrinsic::memmove: case Intrinsic::memset: @@ -210,6 +208,13 @@ bool PNaClABIVerifyModule::isWhitelistedIntrinsic(const Function *F, case Intrinsic::usub_with_overflow: case Intrinsic::smul_with_overflow: case Intrinsic::umul_with_overflow: + // Disallow lifetime.start/end because the semantics of what + // arguments they accept are not very well defined, and because it + // would be better to do merging of stack slots in the user + // toolchain than in the PNaCl translator. + // See https://code.google.com/p/nativeclient/issues/detail?id=3443 + case Intrinsic::lifetime_end: + case Intrinsic::lifetime_start: return false; // (3) Dev intrinsics. diff --git a/lib/Transforms/NaCl/PNaClABISimplify.cpp b/lib/Transforms/NaCl/PNaClABISimplify.cpp index 8c945800af..74a9f0730e 100644 --- a/lib/Transforms/NaCl/PNaClABISimplify.cpp +++ b/lib/Transforms/NaCl/PNaClABISimplify.cpp @@ -39,9 +39,6 @@ void llvm::PNaClABISimplifyAddPreOptPasses(PassManager &PM) { // GlobalCleanup needs to run after ExpandTls because // __tls_template_start etc. are extern_weak before expansion PM.add(createGlobalCleanupPass()); - // Strip dead prototytes to appease the intrinsic ABI checks - // (ExpandVarArgs leaves around var-arg intrinsics). - PM.add(createStripDeadPrototypesPass()); } void llvm::PNaClABISimplifyAddPostOptPasses(PassManager &PM) { @@ -78,4 +75,9 @@ void llvm::PNaClABISimplifyAddPostOptPasses(PassManager &PM) { // ReplacePtrsWithInts assumes that getelementptr instructions and // ConstantExprs have already been expanded out. PM.add(createReplacePtrsWithIntsPass()); + + // Strip dead prototytes to appease the intrinsic ABI checks. + // ExpandVarArgs leaves around vararg intrinsics, and + // ReplacePtrsWithInts leaves the lifetime.start/end intrinsics. + PM.add(createStripDeadPrototypesPass()); } |