summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-02-17 21:23:59 +0000
committerDevang Patel <dpatel@apple.com>2009-02-17 21:23:59 +0000
commit528987a1e87be84462fd449495850e077f977130 (patch)
tree2434db5eed77def4cd92a7b37938fa5aea4e54ec /llvm/lib/Analysis
parentfabd0534fd49ce40ab493696278c9aa3a91d4d2f (diff)
downloadbcm5719-llvm-528987a1e87be84462fd449495850e077f977130.tar.gz
bcm5719-llvm-528987a1e87be84462fd449495850e077f977130.zip
Emit debug info for bitfields.
llvm-svn: 64815
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/DebugInfo.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp
index 0ec80894f11..10356e59fae 100644
--- a/llvm/lib/Analysis/DebugInfo.cpp
+++ b/llvm/lib/Analysis/DebugInfo.cpp
@@ -169,8 +169,8 @@ bool DIVariable::isVariable(unsigned Tag) {
}
}
-DIVariable::DIVariable(GlobalVariable *GV) : DIDescriptor(GV) {
- if (GV && !isVariable(getTag()))
+DIVariable::DIVariable(GlobalVariable *gv) : DIDescriptor(gv) {
+ if (gv && !isVariable(getTag()))
GV = 0;
}
@@ -273,7 +273,16 @@ bool DIVariable::Verify() const {
return true;
}
-
+/// getOriginalTypeSize - If this type is derived from a base type then
+/// return base type size.
+uint64_t DIDerivedType::getOriginalTypeSize() const {
+ if (getTag() != dwarf::DW_TAG_member)
+ return getSizeInBits();
+ DIType BT = getTypeDerivedFrom();
+ if (BT.getTag() != dwarf::DW_TAG_base_type)
+ return getSizeInBits();
+ return BT.getSizeInBits();
+}
//===----------------------------------------------------------------------===//
// DIFactory: Basic Helpers
OpenPOWER on IntegriCloud