diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2016-09-13 01:12:59 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2016-09-13 01:12:59 +0000 |
commit | d4135bbc30de3d3dbd44d64d718fb2169f41bae0 (patch) | |
tree | 0b96e34c50822aed89a2272d9e9f3688bc3a0e46 /llvm/lib/IR/DIBuilder.cpp | |
parent | efc066758309683482edd289d82ec7670d38931f (diff) | |
download | bcm5719-llvm-d4135bbc30de3d3dbd44d64d718fb2169f41bae0.tar.gz bcm5719-llvm-d4135bbc30de3d3dbd44d64d718fb2169f41bae0.zip |
DebugInfo: New metadata representation for global variables.
This patch reverses the edge from DIGlobalVariable to GlobalVariable.
This will allow us to more easily preserve debug info metadata when
manipulating global variables.
Fixes PR30362. A program for upgrading test cases is attached to that
bug.
Differential Revision: http://reviews.llvm.org/D20147
llvm-svn: 281284
Diffstat (limited to 'llvm/lib/IR/DIBuilder.cpp')
-rw-r--r-- | llvm/lib/IR/DIBuilder.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp index 21cedeee78d..1adf9288e25 100644 --- a/llvm/lib/IR/DIBuilder.cpp +++ b/llvm/lib/IR/DIBuilder.cpp @@ -535,13 +535,13 @@ static void checkGlobalVariableScope(DIScope *Context) { DIGlobalVariable *DIBuilder::createGlobalVariable( DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *F, - unsigned LineNumber, DIType *Ty, bool isLocalToUnit, Constant *Val, + unsigned LineNumber, DIType *Ty, bool isLocalToUnit, DIExpression *Expr, MDNode *Decl) { checkGlobalVariableScope(Context); auto *N = DIGlobalVariable::getDistinct( VMContext, cast_or_null<DIScope>(Context), Name, LinkageName, F, - LineNumber, Ty, isLocalToUnit, true, Val, + LineNumber, Ty, isLocalToUnit, true, Expr, cast_or_null<DIDerivedType>(Decl)); AllGVs.push_back(N); return N; @@ -549,13 +549,13 @@ DIGlobalVariable *DIBuilder::createGlobalVariable( DIGlobalVariable *DIBuilder::createTempGlobalVariableFwdDecl( DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *F, - unsigned LineNumber, DIType *Ty, bool isLocalToUnit, Constant *Val, + unsigned LineNumber, DIType *Ty, bool isLocalToUnit, DIExpression *Expr, MDNode *Decl) { checkGlobalVariableScope(Context); return DIGlobalVariable::getTemporary( VMContext, cast_or_null<DIScope>(Context), Name, LinkageName, F, - LineNumber, Ty, isLocalToUnit, false, Val, + LineNumber, Ty, isLocalToUnit, false, Expr, cast_or_null<DIDerivedType>(Decl)) .release(); } |