summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorPeter Zotov <whitequark@whitequark.org>2016-04-05 13:56:59 +0000
committerPeter Zotov <whitequark@whitequark.org>2016-04-05 13:56:59 +0000
commit0a2fa0a13b83405ef3a524e5cc543937e3b1809b (patch)
tree39021838b6261853b1a806778d238524e8d63ac3 /llvm/lib
parent57c5f0b1c44754a6a07bd70be49e4c4beb878b67 (diff)
downloadbcm5719-llvm-0a2fa0a13b83405ef3a524e5cc543937e3b1809b.tar.gz
bcm5719-llvm-0a2fa0a13b83405ef3a524e5cc543937e3b1809b.zip
[llvm-c] Expose LLVM{Get,Set}ModuleIdentifier
Patch by Nicole Mazzuca <npmazzuca@gmail.com>. Differential Revision: http://reviews.llvm.org/D18736 llvm-svn: 265394
Diffstat (limited to 'llvm/lib')
-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 b04ff83140d..b2c2740218e 100644
--- a/llvm/lib/IR/Core.cpp
+++ b/llvm/lib/IR/Core.cpp
@@ -157,6 +157,17 @@ void LLVMDisposeModule(LLVMModuleRef M) {
delete unwrap(M);
}
+const char *LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len) {
+ auto &Str = unwrap(M)->getModuleIdentifier();
+ *Len = Str.length();
+ return Str.c_str();
+}
+
+void LLVMSetModuleIdentifier(LLVMModuleRef M, const char *Ident, size_t Len) {
+ unwrap(M)->setModuleIdentifier(StringRef(Ident, Len));
+}
+
+
/*--.. Data layout .........................................................--*/
const char *LLVMGetDataLayoutStr(LLVMModuleRef M) {
return unwrap(M)->getDataLayoutStr().c_str();
OpenPOWER on IntegriCloud