aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/DebugInfo.cpp
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
commit36375ee7a584343fabaf20630326f1848263bce6 (patch)
treef35a164ccccd774618350c06270144469cd78830 /lib/Analysis/DebugInfo.cpp
parentf163a957057339163c3dee24bce21911fb4dcdf5 (diff)
downloadexternal_llvm-36375ee7a584343fabaf20630326f1848263bce6.zip
external_llvm-36375ee7a584343fabaf20630326f1848263bce6.tar.gz
external_llvm-36375ee7a584343fabaf20630326f1848263bce6.tar.bz2
Emit debug info for bitfields.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64815 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DebugInfo.cpp')
-rw-r--r--lib/Analysis/DebugInfo.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp
index 0ec8089..10356e5 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/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