aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/NaCl/PNaClABISimplify.cpp2
-rw-r--r--lib/Transforms/NaCl/RewritePNaClLibraryCalls.cpp5
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/Transforms/NaCl/PNaClABISimplify.cpp b/lib/Transforms/NaCl/PNaClABISimplify.cpp
index 74a9f0730e..684be734c2 100644
--- a/lib/Transforms/NaCl/PNaClABISimplify.cpp
+++ b/lib/Transforms/NaCl/PNaClABISimplify.cpp
@@ -42,6 +42,8 @@ void llvm::PNaClABISimplifyAddPreOptPasses(PassManager &PM) {
}
void llvm::PNaClABISimplifyAddPostOptPasses(PassManager &PM) {
+ PM.add(createRewritePNaClLibraryCallsPass());
+
// We place ExpandByVal after optimization passes because some byval
// arguments can be expanded away by the ArgPromotion pass. Leaving
// in "byval" during optimization also allows some dead stores to be
diff --git a/lib/Transforms/NaCl/RewritePNaClLibraryCalls.cpp b/lib/Transforms/NaCl/RewritePNaClLibraryCalls.cpp
index 2373343f59..ea50457070 100644
--- a/lib/Transforms/NaCl/RewritePNaClLibraryCalls.cpp
+++ b/lib/Transforms/NaCl/RewritePNaClLibraryCalls.cpp
@@ -86,6 +86,7 @@ bool RewritePNaClLibraryCalls::runOnModule(Module &M) {
report_fatal_error("Taking the address of setjmp is invalid");
}
}
+ SetjmpFunc->eraseFromParent();
}
// For longjmp things are a little more complicated, since longjmp's address
@@ -109,7 +110,9 @@ bool RewritePNaClLibraryCalls::runOnModule(Module &M) {
}
// If additional uses remain, these aren't calls; populate the wrapper.
- if (!LongjmpFunc->use_empty()) {
+ if (LongjmpFunc->use_empty()) {
+ LongjmpFunc->eraseFromParent();
+ } else {
populateLongjmpWrapper(LongjmpFunc);
Changed = true;
}