summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
authorRobert Widmann <devteam.codafi@gmail.com>2018-04-07 06:07:55 +0000
committerRobert Widmann <devteam.codafi@gmail.com>2018-04-07 06:07:55 +0000
commitf53050f0105c2e44a441a00a6e8aff28f16b905e (patch)
tree913564ef42e569113715d5dfd7466e11fbd9bd5b /llvm/lib/IR/DebugInfo.cpp
parentde5f196530b508df3bc8c035ae1db87b56437d88 (diff)
downloadbcm5719-llvm-f53050f0105c2e44a441a00a6e8aff28f16b905e.tar.gz
bcm5719-llvm-f53050f0105c2e44a441a00a6e8aff28f16b905e.zip
[LLVM-C] Move DIBuilder Bindings For Block Scopes
Summary: Move LLVMDIBuilderCreateFunction , LLVMDIBuilderCreateLexicalBlock, and LLVMDIBuilderCreateLexicalBlockFile from Go to LLVM-C. Reviewers: whitequark, harlanhaskins, deadalnix Reviewed By: whitequark, harlanhaskins Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45352 llvm-svn: 329488
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 2d24561fe01..2402e01f5f1 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -754,6 +754,38 @@ LLVMDIBuilderCreateFile(LLVMDIBuilderRef Builder, const char *Filename,
StringRef(Directory, DirectoryLen)));
}
+LLVMMetadataRef LLVMDIBuilderCreateFunction(
+ LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
+ size_t NameLen, const char *LinkageName, size_t LinkageNameLen,
+ LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty,
+ LLVMBool IsLocalToUnit, LLVMBool IsDefinition,
+ unsigned ScopeLine, LLVMDIFlags Flags, LLVMBool IsOptimized) {
+ return wrap(unwrap(Builder)->createFunction(
+ unwrapDI<DIScope>(Scope), {Name, NameLen}, {LinkageName, LinkageNameLen},
+ unwrapDI<DIFile>(File), LineNo, unwrapDI<DISubroutineType>(Ty),
+ IsLocalToUnit, IsDefinition, ScopeLine, map_from_llvmDIFlags(Flags),
+ IsOptimized, nullptr, nullptr, nullptr));
+}
+
+
+LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock(
+ LLVMDIBuilderRef Builder, LLVMMetadataRef Scope,
+ LLVMMetadataRef File, unsigned Line, unsigned Col) {
+ return wrap(unwrap(Builder)->createLexicalBlock(unwrapDI<DIScope>(Scope),
+ unwrapDI<DIFile>(File),
+ Line, Col));
+}
+
+LLVMMetadataRef
+LLVMDIBuilderCreateLexicalBlockFile(LLVMDIBuilderRef Builder,
+ LLVMMetadataRef Scope,
+ LLVMMetadataRef File,
+ unsigned Discriminator) {
+ return wrap(unwrap(Builder)->createLexicalBlockFile(unwrapDI<DIScope>(Scope),
+ unwrapDI<DIFile>(File),
+ Discriminator));
+}
+
LLVMMetadataRef
LLVMDIBuilderCreateDebugLocation(LLVMContextRef Ctx, unsigned Line,
unsigned Column, LLVMMetadataRef Scope,
@@ -942,3 +974,11 @@ LLVMDIBuilderCreateSubroutineType(LLVMDIBuilderRef Builder,
return wrap(unwrap(Builder)->createSubroutineType(
Elts, map_from_llvmDIFlags(Flags)));
}
+
+LLVMMetadataRef LLVMGetSubprogram(LLVMValueRef Func) {
+ return wrap(unwrap<Function>(Func)->getSubprogram());
+}
+
+void LLVMSetSubprogram(LLVMValueRef Func, LLVMMetadataRef SP) {
+ unwrap<Function>(Func)->setSubprogram(unwrap<DISubprogram>(SP));
+}
OpenPOWER on IntegriCloud