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/Verifier.cpp | |
parent | efc066758309683482edd289d82ec7670d38931f (diff) | |
download | llvm-d4135bbc30de3d3dbd44d64d718fb2169f41bae0.zip llvm-d4135bbc30de3d3dbd44d64d718fb2169f41bae0.tar.gz llvm-d4135bbc30de3d3dbd44d64d718fb2169f41bae0.tar.bz2 |
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/Verifier.cpp')
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index ba7db85..32ead4f 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -1112,12 +1112,8 @@ void Verifier::visitDIGlobalVariable(const DIGlobalVariable &N) { AssertDI(N.getTag() == dwarf::DW_TAG_variable, "invalid tag", &N); AssertDI(!N.getName().empty(), "missing global variable name", &N); - if (auto *V = N.getRawVariable()) { - AssertDI(isa<ConstantAsMetadata>(V) && - !isa<Function>(cast<ConstantAsMetadata>(V)->getValue()), - "invalid global variable ref", &N, V); - visitConstantExprsRecursively(cast<ConstantAsMetadata>(V)->getValue()); - } + if (auto *V = N.getRawExpr()) + AssertDI(isa<DIExpression>(V), "invalid expression location", &N, V); if (auto *Member = N.getRawStaticDataMemberDeclaration()) { AssertDI(isa<DIDerivedType>(Member), "invalid static data member declaration", &N, Member); |