aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Transforms
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2006-04-10 19:26:09 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2006-04-10 19:26:09 +0000
commit3433141a3e5cae22f79019f52b624d0f384018a7 (patch)
treeb67a07fb8b13f39413049c37b5659557099a9a3d /include/llvm/Transforms
parentdb3c626eb9e85e9192dbee59ff0c4d143c37c94d (diff)
downloadexternal_llvm-3433141a3e5cae22f79019f52b624d0f384018a7.zip
external_llvm-3433141a3e5cae22f79019f52b624d0f384018a7.tar.gz
external_llvm-3433141a3e5cae22f79019f52b624d0f384018a7.tar.bz2
Add a simple pass to make sure that all (non-library) calls to malloc and free
are visible to analysis as intrinsics. That is, make sure someone doesn't pass free around by address in some struct (as happens in say 176.gcc). This doesn't get rid of any indirect calls, just ensure calls to free and malloc are always direct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27560 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms')
-rw-r--r--include/llvm/Transforms/IPO.h5
-rw-r--r--include/llvm/Transforms/LinkAllPasses.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/include/llvm/Transforms/IPO.h b/include/llvm/Transforms/IPO.h
index ca5959c..eba40b8 100644
--- a/include/llvm/Transforms/IPO.h
+++ b/include/llvm/Transforms/IPO.h
@@ -169,6 +169,11 @@ ModulePass *createBlockExtractorPass(std::vector<BasicBlock*> &BTNE);
// specific well-known (library) functions.
ModulePass *createSimplifyLibCallsPass();
+
+// createIndMemRemPass - This pass removes potential indirect calls of
+// malloc and free
+ModulePass *createIndMemRemPass();
+
} // End llvm namespace
#endif
diff --git a/include/llvm/Transforms/LinkAllPasses.h b/include/llvm/Transforms/LinkAllPasses.h
index cc9621f..ac64f85 100644
--- a/include/llvm/Transforms/LinkAllPasses.h
+++ b/include/llvm/Transforms/LinkAllPasses.h
@@ -107,7 +107,7 @@ namespace {
(void) llvm::createCondPropagationPass();
(void) llvm::createNullProfilerRSPass();
(void) llvm::createRSProfilingPass();
-
+ (void) llvm::createIndMemRemPass();
}
} ForcePassLinking;
}