summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2019-10-07 13:57:13 +0000
committerwhitequark <whitequark@whitequark.org>2019-10-07 13:57:13 +0000
commitb63db94fa54789d8241b16e05f2c9d9959afe297 (patch)
tree804900a952b6714a5cb34791c423f209c32494b7 /llvm/lib/IR/DebugInfo.cpp
parenta6fc72fba9dc3cc5d02236190df9d661563ddfd7 (diff)
downloadbcm5719-llvm-b63db94fa54789d8241b16e05f2c9d9959afe297.tar.gz
bcm5719-llvm-b63db94fa54789d8241b16e05f2c9d9959afe297.zip
[LLVM-C] Add bindings to create macro debug info
Summary: The C API doesn't have the bindings to create macro debug information. Reviewers: whitequark, CodaFi, deadalnix Reviewed By: whitequark Subscribers: aprantl, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58334 llvm-svn: 373903
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index ce47ef20743..8f5101a4ae7 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -929,6 +929,26 @@ const char *LLVMDIFileGetSource(LLVMMetadataRef File, unsigned *Len) {
return "";
}
+LLVMMetadataRef LLVMDIBuilderCreateMacro(LLVMDIBuilderRef Builder,
+ LLVMMetadataRef ParentMacroFile,
+ unsigned Line,
+ LLVMDWARFMacinfoRecordType RecordType,
+ const char *Name, size_t NameLen,
+ const char *Value, size_t ValueLen) {
+ return wrap(
+ unwrap(Builder)->createMacro(unwrapDI<DIMacroFile>(ParentMacroFile), Line,
+ static_cast<MacinfoRecordType>(RecordType),
+ {Name, NameLen}, {Value, ValueLen}));
+}
+
+LLVMMetadataRef
+LLVMDIBuilderCreateTempMacroFile(LLVMDIBuilderRef Builder,
+ LLVMMetadataRef ParentMacroFile, unsigned Line,
+ LLVMMetadataRef File) {
+ return wrap(unwrap(Builder)->createTempMacroFile(
+ unwrapDI<DIMacroFile>(ParentMacroFile), Line, unwrapDI<DIFile>(File)));
+}
+
LLVMMetadataRef LLVMDIBuilderCreateEnumerator(LLVMDIBuilderRef Builder,
const char *Name, size_t NameLen,
int64_t Value,
OpenPOWER on IntegriCloud