summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
authorAndrew Wilkins <axwalk@gmail.com>2015-07-14 01:23:06 +0000
committerAndrew Wilkins <axwalk@gmail.com>2015-07-14 01:23:06 +0000
commit3bdfc1cd0ccd2e9421e67ebcded5d467eee2bfbf (patch)
tree7201f7ad75f528d2cfb551d6fefad3e2c8616583 /llvm/lib/IR
parentd36f614e20a39cc363a4f0b3710cb9962356f645 (diff)
downloadbcm5719-llvm-3bdfc1cd0ccd2e9421e67ebcded5d467eee2bfbf.tar.gz
bcm5719-llvm-3bdfc1cd0ccd2e9421e67ebcded5d467eee2bfbf.zip
Add capability to get and set the personalitty function from the C API
Summary: The capability was lost with D10429 where the personality function was set at function level rather than landing pad level. Now there is no way to get/set the personality function from the C API. That is a problem. Note that the whole thing could be avoided by improving the C API testing, as started by D10725 Reviewers: chandlerc, bogner, majnemer, andrew.w.kaylor, rafael, rnk, axw Subscribers: rafael, llvm-commits Differential Revision: http://reviews.llvm.org/D10946 llvm-svn: 242104
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/Core.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp
index 23e923d4112..e0e729d534b 100644
--- a/llvm/lib/IR/Core.cpp
+++ b/llvm/lib/IR/Core.cpp
@@ -1691,6 +1691,14 @@ void LLVMDeleteFunction(LLVMValueRef Fn) {
unwrap<Function>(Fn)->eraseFromParent();
}
+LLVMValueRef LLVMGetPersonalityFn(LLVMValueRef Fn) {
+ return wrap(unwrap<Function>(Fn)->getPersonalityFn());
+}
+
+void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn) {
+ unwrap<Function>(Fn)->setPersonalityFn(unwrap<Constant>(PersonalityFn));
+}
+
unsigned LLVMGetIntrinsicID(LLVMValueRef Fn) {
if (Function *F = dyn_cast<Function>(unwrap(Fn)))
return F->getIntrinsicID();
OpenPOWER on IntegriCloud