aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-11 19:58:35 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-11 19:58:35 +0000
commit5ad6ff76dc898d1dab1aaccee5e193dbf9e04acb (patch)
tree6f88bf5eff5a344e921c405c4e105f2be0fd8c16 /llvm/lib/IR/DebugInfo.cpp
parent127ea4b616b1436739225607da5d90c25a8bb0b5 (diff)
downloadllvm-5ad6ff76dc898d1dab1aaccee5e193dbf9e04acb.zip
llvm-5ad6ff76dc898d1dab1aaccee5e193dbf9e04acb.tar.gz
llvm-5ad6ff76dc898d1dab1aaccee5e193dbf9e04acb.tar.bz2
Verifier: Check for incompatible bit piece expressions
Convert an assertion into a `Verifier` check. Bit piece expressions must fit inside the variable, and mustn't be the entire variable. Catching this in the verifier will help us find bugs sooner, and makes `DIVariable::getSizeInBits()` dead code. llvm-svn: 234698
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp13
1 files changed, 0 insertions, 13 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 1fbc53c..19b799e 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -33,19 +33,6 @@
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
//===----------------------------------------------------------------------===//