summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-c-test
diff options
context:
space:
mode:
authorRobert Widmann <devteam.codafi@gmail.com>2018-05-10 18:09:53 +0000
committerRobert Widmann <devteam.codafi@gmail.com>2018-05-10 18:09:53 +0000
commita428eba85eb23b4b614dbf9555169592cd8c2511 (patch)
treed6ff9d710d74e7bda151975011a553cfecb33e93 /llvm/tools/llvm-c-test
parent262e09018b60d5c075f28c1e74b4c3a792f55969 (diff)
downloadbcm5719-llvm-a428eba85eb23b4b614dbf9555169592cd8c2511.tar.gz
bcm5719-llvm-a428eba85eb23b4b614dbf9555169592cd8c2511.zip
[LLVM-C] Move DIBuilder Bindings For Temporary MDNodes
Summary: Move LLVMTemporaryMDNode and LLVMMetadataReplaceAllUsesWith to the C bindings and add LLVMDeleteTemporaryMDNode for deleting non-RAUW'ed temporary nodes. Reviewers: whitequark, harlanhaskins, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46632 llvm-svn: 332010
Diffstat (limited to 'llvm/tools/llvm-c-test')
-rw-r--r--llvm/tools/llvm-c-test/debuginfo.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/llvm/tools/llvm-c-test/debuginfo.c b/llvm/tools/llvm-c-test/debuginfo.c
index 8bbe2b6d98f..6cc35168600 100644
--- a/llvm/tools/llvm-c-test/debuginfo.c
+++ b/llvm/tools/llvm-c-test/debuginfo.c
@@ -93,14 +93,23 @@ int llvm_test_dibuilder(void) {
LLVMMetadataRef ParamTypes[] = {Int64Ty, Int64Ty, VectorTy};
LLVMMetadataRef FunctionTy =
LLVMDIBuilderCreateSubroutineType(DIB, File, ParamTypes, 3, 0);
+
+ LLVMMetadataRef ReplaceableFunctionMetadata =
+ LLVMDIBuilderCreateReplaceableCompositeType(DIB, 0x15, "foo", 3,
+ File, File, 42,
+ 0, 0, 0,
+ LLVMDIFlagFwdDecl,
+ "", 0);
+
+ LLVMMetadataRef FooParamLocation =
+ LLVMDIBuilderCreateDebugLocation(LLVMGetGlobalContext(), 42, 0,
+ ReplaceableFunctionMetadata, NULL);
LLVMMetadataRef FunctionMetadata =
LLVMDIBuilderCreateFunction(DIB, File, "foo", 3, "foo", 3,
File, 42, FunctionTy, true, true,
42, 0, false);
+ LLVMMetadataReplaceAllUsesWith(ReplaceableFunctionMetadata, FunctionMetadata);
- LLVMMetadataRef FooParamLocation =
- LLVMDIBuilderCreateDebugLocation(LLVMGetGlobalContext(), 42, 0,
- FunctionMetadata, NULL);
LLVMMetadataRef FooParamExpression =
LLVMDIBuilderCreateExpression(DIB, NULL, 0);
LLVMMetadataRef FooParamVar1 =
OpenPOWER on IntegriCloud