summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitd5104a5de6a4944b95b9a253e6ec23f65358b3a1 (patch)
tree35ce00551749c75e338e1c17cbf5dc7cfd8bca0f /llvm/lib/VMCore/Core.cpp
parentfa7431a8076bb3ddc58156f4049c0a10735059da (diff)
downloadbcm5719-llvm-d5104a5de6a4944b95b9a253e6ec23f65358b3a1.tar.gz
bcm5719-llvm-d5104a5de6a4944b95b9a253e6ec23f65358b3a1.zip
Add C bindings for extractvalue and insertvalue. Patch by Frits van Bommel!
llvm-svn: 58650
Diffstat (limited to 'llvm/lib/VMCore/Core.cpp')
-rw-r--r--llvm/lib/VMCore/Core.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Core.cpp b/llvm/lib/VMCore/Core.cpp
index afc1c905fc0..7d1fa12d230 100644
--- a/llvm/lib/VMCore/Core.cpp
+++ b/llvm/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 --------------------------------------------------===*/
OpenPOWER on IntegriCloud