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 | 1e40dc42cd1bff905323186bc0184f260902f6dd (patch) | |
tree | a9edccf44043fa3f00b4749d6d818f0db364f556 /llvm/bindings/go | |
parent | 600aee98057e8657140713cd2a0dd6e5ff0247b8 (diff) | |
download | bcm5719-llvm-1e40dc42cd1bff905323186bc0184f260902f6dd.tar.gz bcm5719-llvm-1e40dc42cd1bff905323186bc0184f260902f6dd.zip |
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.
llvm-svn: 243764
Diffstat (limited to 'llvm/bindings/go')
-rw-r--r-- | llvm/bindings/go/llvm/DIBuilderBindings.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/bindings/go/llvm/DIBuilderBindings.cpp b/llvm/bindings/go/llvm/DIBuilderBindings.cpp index df5885de25c..627c09131aa 100644 --- a/llvm/bindings/go/llvm/DIBuilderBindings.cpp +++ b/llvm/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, |