summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Core.cpp
diff options
context:
space:
mode:
authorRobert Widmann <devteam.codafi@gmail.com>2018-09-28 20:54:29 +0000
committerRobert Widmann <devteam.codafi@gmail.com>2018-09-28 20:54:29 +0000
commite63a12ccbedbe29120dc6525651792117e1780f7 (patch)
tree0ed68b71e2756043fda082f6e26ccf7e098838b6 /llvm/lib/IR/Core.cpp
parentec3d65b870c31a80932c5a2c510cbd21e0122564 (diff)
downloadbcm5719-llvm-e63a12ccbedbe29120dc6525651792117e1780f7.tar.gz
bcm5719-llvm-e63a12ccbedbe29120dc6525651792117e1780f7.zip
[LLVM-C] Add an accessor for the "value type" of a global
Summary: Before this, there was no reasonable way to retrieve the type of a global value (most notably, a function) that was created with the C API. Reviewers: whitequark, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D52659 llvm-svn: 343363
Diffstat (limited to 'llvm/lib/IR/Core.cpp')
-rw-r--r--llvm/lib/IR/Core.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp
index 5af080efc27..410a426a4a2 100644
--- a/llvm/lib/IR/Core.cpp
+++ b/llvm/lib/IR/Core.cpp
@@ -1876,6 +1876,10 @@ void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr) {
: GlobalValue::UnnamedAddr::None);
}
+LLVMTypeRef LLVMGlobalGetValueType(LLVMValueRef Global) {
+ return wrap(unwrap<GlobalValue>(Global)->getValueType());
+}
+
/*--.. Operations on global variables, load and store instructions .........--*/
unsigned LLVMGetAlignment(LLVMValueRef V) {
OpenPOWER on IntegriCloud