summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Core.cpp
diff options
context:
space:
mode:
authorRobert Widmann <devteam.codafi@gmail.com>2018-01-30 21:34:29 +0000
committerRobert Widmann <devteam.codafi@gmail.com>2018-01-30 21:34:29 +0000
commit490a5808cd4eaa4dc86ed5ff69cda27e7f2c8c56 (patch)
treed78299fdd2b551f277090c230245cb95fc64fa13 /llvm/lib/IR/Core.cpp
parent59baf73a4dff3e19b5e0ecdd5b0801691b0db54f (diff)
downloadbcm5719-llvm-490a5808cd4eaa4dc86ed5ff69cda27e7f2c8c56.tar.gz
bcm5719-llvm-490a5808cd4eaa4dc86ed5ff69cda27e7f2c8c56.zip
[LLVM-C] Add Accessors For A Module's Source File Name
Summary: Also unblocks some cleanup in the echo-test. Reviewers: whitequark, deadalnix Reviewed By: whitequark Subscribers: harlanhaskins, llvm-commits Differential Revision: https://reviews.llvm.org/D42618 llvm-svn: 323819
Diffstat (limited to 'llvm/lib/IR/Core.cpp')
-rw-r--r--llvm/lib/IR/Core.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp
index d3c33edec18..052029e03a6 100644
--- a/llvm/lib/IR/Core.cpp
+++ b/llvm/lib/IR/Core.cpp
@@ -234,6 +234,15 @@ void LLVMSetModuleIdentifier(LLVMModuleRef M, const char *Ident, size_t Len) {
unwrap(M)->setModuleIdentifier(StringRef(Ident, Len));
}
+const char *LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len) {
+ auto &Str = unwrap(M)->getSourceFileName();
+ *Len = Str.length();
+ return Str.c_str();
+}
+
+void LLVMSetSourceFileName(LLVMModuleRef M, const char *Name, size_t Len) {
+ unwrap(M)->setSourceFileName(StringRef(Name, Len));
+}
/*--.. Data layout .........................................................--*/
const char *LLVMGetDataLayoutStr(LLVMModuleRef M) {
OpenPOWER on IntegriCloud