summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Core.cpp
diff options
context:
space:
mode:
authorTorok Edwin <edwintorok@gmail.com>2011-10-06 12:12:50 +0000
committerTorok Edwin <edwintorok@gmail.com>2011-10-06 12:12:50 +0000
commit0d5f6ae881a82cba8f2cdc538937dbd58a3c0375 (patch)
treecb712d22fd1fe09ca19e96729f546d65a2831959 /llvm/lib/VMCore/Core.cpp
parentd43a5d76f478157fd157344920a6295cacfaec1f (diff)
downloadbcm5719-llvm-0d5f6ae881a82cba8f2cdc538937dbd58a3c0375.tar.gz
bcm5719-llvm-0d5f6ae881a82cba8f2cdc538937dbd58a3c0375.zip
C/OCaml API to retrieve struct name.
llvm-svn: 141285
Diffstat (limited to 'llvm/lib/VMCore/Core.cpp')
-rw-r--r--llvm/lib/VMCore/Core.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Core.cpp b/llvm/lib/VMCore/Core.cpp
index e2b659b6a2b..8560de4455c 100644
--- a/llvm/lib/VMCore/Core.cpp
+++ b/llvm/lib/VMCore/Core.cpp
@@ -302,6 +302,14 @@ LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name)
return wrap(StructType::create(*unwrap(C), Name));
}
+const char *LLVMGetStructName(LLVMTypeRef Ty)
+{
+ StructType *Type = unwrap<StructType>(Ty);
+ if (!Type->hasName())
+ return 0;
+ return Type->getName().data();
+}
+
void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes,
unsigned ElementCount, LLVMBool Packed) {
ArrayRef<Type*> Tys(unwrap(ElementTypes), ElementCount);
OpenPOWER on IntegriCloud