diff options
author | Robert Widmann <devteam.codafi@gmail.com> | 2019-07-23 04:56:44 +0000 |
---|---|---|
committer | Robert Widmann <devteam.codafi@gmail.com> | 2019-07-23 04:56:44 +0000 |
commit | fcf3c55a8cd2b00c54bc08652f8b8ad517abab43 (patch) | |
tree | 4628c7ee4732f43b0ba493e66055972cdcdc787a /llvm/include/llvm-c | |
parent | 30f12a42474f5b8f0409f5aabd3c335fd415b926 (diff) | |
download | bcm5719-llvm-fcf3c55a8cd2b00c54bc08652f8b8ad517abab43.tar.gz bcm5719-llvm-fcf3c55a8cd2b00c54bc08652f8b8ad517abab43.zip |
[LLVM-C] Improve Bindings to The Internalize Pass
Summary: Adds a binding to the internalize pass that allows the caller to pass a function pointer that acts as the visibility-preservation predicate. Previously, one could only pass an unsigned value (not LLVMBool?) that directed the pass to consider "main" or not.
Reviewers: whitequark, deadalnix, harlanhaskins
Reviewed By: whitequark, harlanhaskins
Subscribers: kren1, hiraditya, llvm-commits, harlanhaskins
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62456
llvm-svn: 366777
Diffstat (limited to 'llvm/include/llvm-c')
-rw-r--r-- | llvm/include/llvm-c/Transforms/IPO.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/include/llvm-c/Transforms/IPO.h b/llvm/include/llvm-c/Transforms/IPO.h index 7a82ed46414..748b6db05e3 100644 --- a/llvm/include/llvm-c/Transforms/IPO.h +++ b/llvm/include/llvm-c/Transforms/IPO.h @@ -67,6 +67,21 @@ void LLVMAddIPSCCPPass(LLVMPassManagerRef PM); /** See llvm::createInternalizePass function. */ void LLVMAddInternalizePass(LLVMPassManagerRef, unsigned AllButMain); +/** + * Create and add the internalize pass to the given pass manager with the + * provided preservation callback. + * + * The context parameter is forwarded to the callback on each invocation. + * As such, it is the responsibility of the caller to extend its lifetime + * until execution of this pass has finished. + * + * @see llvm::createInternalizePass function. + */ +void LLVMAddInternalizePassWithMustPreservePredicate( + LLVMPassManagerRef PM, + void *Context, + LLVMBool (*MustPreserve)(LLVMValueRef, void *)); + /** See llvm::createStripDeadPrototypesPass function. */ void LLVMAddStripDeadPrototypesPass(LLVMPassManagerRef PM); |