aboutsummaryrefslogtreecommitdiffstats
path: root/lib
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
commit969d8e3f9643c32352335b1887e4fd51a9caa781 (patch)
tree786d07acf1c61547d816bea53326e118351a7102 /lib
parent3cb57c7261a0b4d94a04417b05c754502a3e7a91 (diff)
downloadexternal_llvm-969d8e3f9643c32352335b1887e4fd51a9caa781.tar.gz
external_llvm-969d8e3f9643c32352335b1887e4fd51a9caa781.tar.bz2
external_llvm-969d8e3f9643c32352335b1887e4fd51a9caa781.zip
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')
-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 afc1c905fc..7d1fa12d23 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 --------------------------------------------------===*/