summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
authorPeter Zotov <whitequark@whitequark.org>2016-04-06 22:21:29 +0000
committerPeter Zotov <whitequark@whitequark.org>2016-04-06 22:21:29 +0000
commit3e4561cec511e98f62ca766b1be8613a1c6949c2 (patch)
tree84f2b3faeac8a6e12a9450e1bdf1c475d362c0ad /llvm/lib/IR
parent439453679caae5bd7d1e1614099d948a796ee734 (diff)
downloadbcm5719-llvm-3e4561cec511e98f62ca766b1be8613a1c6949c2.tar.gz
bcm5719-llvm-3e4561cec511e98f62ca766b1be8613a1c6949c2.zip
[llvm-c] Add LLVMGetValueKind.
Patch by Nicole Mazzuca <npmazzuca@gmail.com>. Differential Revision: http://reviews.llvm.org/D18729 llvm-svn: 265608
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/Core.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp
index 0bdd2d6483c..93a346b9c78 100644
--- a/llvm/lib/IR/Core.cpp
+++ b/llvm/lib/IR/Core.cpp
@@ -550,6 +550,17 @@ LLVMTypeRef LLVMTypeOf(LLVMValueRef Val) {
return wrap(unwrap(Val)->getType());
}
+LLVMValueKind LLVMGetValueKind(LLVMValueRef Val) {
+ switch(unwrap(Val)->getValueID()) {
+#define HANDLE_VALUE(Name) \
+ case Value::Name##Val: \
+ return LLVM##Name##ValueKind;
+#include "llvm/IR/Value.def"
+ default:
+ return LLVMInstructionValueKind;
+ }
+}
+
const char *LLVMGetValueName(LLVMValueRef Val) {
return unwrap(Val)->getName().data();
}
OpenPOWER on IntegriCloud