diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-13 00:06:28 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-13 00:06:28 +0000 |
commit | 5cd454161c9e8e4f63c2c82529929450a5b3faf7 (patch) | |
tree | 60f6042ce3f9af15011188b55c97349ed7712a44 /llvm/lib/IR/DebugInfo.cpp | |
parent | 452b036697670214e795d8ce02cd0e32cf5474d3 (diff) | |
download | bcm5719-llvm-5cd454161c9e8e4f63c2c82529929450a5b3faf7.tar.gz bcm5719-llvm-5cd454161c9e8e4f63c2c82529929450a5b3faf7.zip |
Revert "Verifier: Check for incompatible bit piece expressions"
This reverts commit r234698.
This caused a use-after-free: `QueuedBitPieceExpressions` holds onto
references to `DbgInfoIntrinsic`s and references them past where they're
deleted (this is because the verifier is run as a function pass, and
then `verifyTypeRefs()` is called during `doFinalization()`).
I'll include a reduced crasher for `llc` when I recommit the check.
llvm-svn: 234717
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index 7797a026211..b0bd8223294 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -33,6 +33,19 @@ using namespace llvm; using namespace llvm::dwarf; +/// \brief Return the size reported by the variable's type. +unsigned DIVariable::getSizeInBits(const DITypeIdentifierMap &Map) { + DIType Ty = getType().resolve(Map); + // Follow derived types until we reach a type that + // reports back a size. + while (isa<MDDerivedType>(Ty) && !Ty.getSizeInBits()) { + DIDerivedType DT = cast<MDDerivedType>(Ty); + Ty = DT.getTypeDerivedFrom().resolve(Map); + } + assert(Ty.getSizeInBits() && "type with size 0"); + return Ty.getSizeInBits(); +} + //===----------------------------------------------------------------------===// // Simple Descriptor Constructors and other Methods //===----------------------------------------------------------------------===// |