diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-07-31 17:55:53 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-07-31 17:55:53 +0000 |
commit | aa50fa7c2f6a22d97a11336d7281377dcfcafc9d (patch) | |
tree | 7b2f76cc14efd083833a4fac0f769b4edca267f1 /bindings | |
parent | 3f2cb5c959754a99ebe7fe9611e8788afd2da8e8 (diff) |
DI: Rewrite the DIBuilder local variable API
Replace the general `createLocalVariable()` with two more specific
functions: `createParameterVariable()` and `createAutoVariable()`, and
rewrite the documentation.
Besides cleaning up the API, this avoids exposing the fake DWARF tags
`DW_TAG_arg_variable` and `DW_TAG_auto_variable` to frontends, and is
preparation for removing them completely.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243764 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/go/llvm/DIBuilderBindings.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/bindings/go/llvm/DIBuilderBindings.cpp b/bindings/go/llvm/DIBuilderBindings.cpp index df5885de25c..627c09131aa 100644 --- a/bindings/go/llvm/DIBuilderBindings.cpp +++ b/bindings/go/llvm/DIBuilderBindings.cpp @@ -84,13 +84,18 @@ LLVMMetadataRef LLVMDIBuilderCreateFunction( } LLVMMetadataRef LLVMDIBuilderCreateLocalVariable( - LLVMDIBuilderRef Dref, unsigned Tag, LLVMMetadataRef Scope, + LLVMDIBuilderRef Dref, unsigned, LLVMMetadataRef Scope, const char *Name, LLVMMetadataRef File, unsigned Line, LLVMMetadataRef Ty, int AlwaysPreserve, unsigned Flags, unsigned ArgNo) { DIBuilder *D = unwrap(Dref); - return wrap(D->createLocalVariable( - Tag, unwrap<DIScope>(Scope), Name, unwrap<DIFile>(File), Line, - unwrap<DIType>(Ty), AlwaysPreserve, Flags, ArgNo)); + // FIXME: Update the Go bindings to match the DIBuilder API. + if (ArgNo) + return wrap(D->createParameterVariable( + unwrap<DIScope>(Scope), Name, ArgNo, unwrap<DIFile>(File), Line, + unwrap<DIType>(Ty), AlwaysPreserve, Flags)); + return wrap(D->createAutoVariable(unwrap<DIScope>(Scope), Name, + unwrap<DIFile>(File), Line, + unwrap<DIType>(Ty), AlwaysPreserve, Flags)); } LLVMMetadataRef LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef Dref, |