summaryrefslogtreecommitdiff
path: root/lib/IR/Core.cpp
diff options
context:
space:
mode:
authorPeter Zotov <whitequark@whitequark.org>2015-06-04 09:09:53 +0000
committerPeter Zotov <whitequark@whitequark.org>2015-06-04 09:09:53 +0000
commitd34142ebf7bb4b9ced2ad950662d5b90678f1d0d (patch)
tree9eff04f6dc8451d4b10106a8137f9d6a4c3a9b39 /lib/IR/Core.cpp
parent0880fe599726621c3368278208ef6ec7555cacd8 (diff)
[C API] Add LLVMStructGetTypeAtIndex.
Patch by deadalnix (Amaury SECHET). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239029 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/Core.cpp')
-rw-r--r--lib/IR/Core.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/IR/Core.cpp b/lib/IR/Core.cpp
index 9557cda5a9c..d476434542e 100644
--- a/lib/IR/Core.cpp
+++ b/lib/IR/Core.cpp
@@ -461,6 +461,11 @@ void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest) {
*Dest++ = wrap(*I);
}
+LLVMTypeRef LLVMStructGetTypeAtIndex(LLVMTypeRef StructTy, unsigned i) {
+ StructType *Ty = unwrap<StructType>(StructTy);
+ return wrap(Ty->getTypeAtIndex(i));
+}
+
LLVMBool LLVMIsPackedStruct(LLVMTypeRef StructTy) {
return unwrap<StructType>(StructTy)->isPacked();
}