aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Core.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-11-03 22:55:43 +0000
committerDan Gohman <gohman@apple.com>2008-11-03 22:55:43 +0000
commitb593117b44a74c72bc784080bb402576b3181d94 (patch)
tree786d07acf1c61547d816bea53326e118351a7102 /lib/VMCore/Core.cpp
parent49987360ade8d506782835222f5f00dfc5ef9ec6 (diff)
downloadexternal_llvm-b593117b44a74c72bc784080bb402576b3181d94.zip
external_llvm-b593117b44a74c72bc784080bb402576b3181d94.tar.gz
external_llvm-b593117b44a74c72bc784080bb402576b3181d94.tar.bz2
Add C bindings for extractvalue and insertvalue. Patch by Frits van Bommel!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58650 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Core.cpp')
-rw-r--r--lib/VMCore/Core.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp
index afc1c90..7d1fa12 100644
--- a/lib/VMCore/Core.cpp
+++ b/lib/VMCore/Core.cpp
@@ -541,6 +541,20 @@ LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant,
unwrap<Constant>(MaskConstant)));
}
+LLVMValueRef LLVMConstExtractValue(LLVMValueRef AggConstant, unsigned *IdxList,
+ unsigned NumIdx) {
+ return wrap(ConstantExpr::getExtractValue(unwrap<Constant>(AggConstant),
+ IdxList, NumIdx));
+}
+
+LLVMValueRef LLVMConstInsertValue(LLVMValueRef AggConstant,
+ LLVMValueRef ElementValueConstant,
+ unsigned *IdxList, unsigned NumIdx) {
+ return wrap(ConstantExpr::getInsertValue(unwrap<Constant>(AggConstant),
+ unwrap<Constant>(ElementValueConstant),
+ IdxList, NumIdx));
+}
+
/*--.. Operations on global variables, functions, and aliases (globals) ....--*/
LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global) {
@@ -1326,6 +1340,18 @@ LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef B, LLVMValueRef V1,
unwrap(Mask), Name));
}
+LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef B, LLVMValueRef AggVal,
+ unsigned Index, const char *Name) {
+ return wrap(unwrap(B)->CreateExtractValue(unwrap(AggVal), Index, Name));
+}
+
+LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef B, LLVMValueRef AggVal,
+ LLVMValueRef EltVal, unsigned Index,
+ const char *Name) {
+ return wrap(unwrap(B)->CreateInsertValue(unwrap(AggVal), unwrap(EltVal),
+ Index, Name));
+}
+
/*===-- Module providers --------------------------------------------------===*/