aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorTorok Edwin <edwintorok@gmail.com>2008-12-13 08:25:29 +0000
committerTorok Edwin <edwintorok@gmail.com>2008-12-13 08:25:29 +0000
commitb07fbd9bdde37ebd404e8b8dc167795728f162e1 (patch)
tree602badfb6228648e70e2e6cc712413530577ee2d /lib/Analysis
parentc5d64607c96d9237f55988736e6ba7cc6a3d0a67 (diff)
downloadexternal_llvm-b07fbd9bdde37ebd404e8b8dc167795728f162e1.zip
external_llvm-b07fbd9bdde37ebd404e8b8dc167795728f162e1.tar.gz
external_llvm-b07fbd9bdde37ebd404e8b8dc167795728f162e1.tar.bz2
Fix getFieldAs() to use the parameter instead of 6.
Add missing DIType constructor, needed by DIVariable::getType(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60976 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/DebugInfo.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp
index 01db8ab..29175a6 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/lib/Analysis/DebugInfo.cpp
@@ -100,6 +100,14 @@ DIGlobalVariable::DIGlobalVariable(GlobalVariable *GV)
: DIGlobal(GV, dwarf::DW_TAG_variable) {}
DIBlock::DIBlock(GlobalVariable *GV)
: DIDescriptor(GV, dwarf::DW_TAG_lexical_block) {}
+// needed by DIVariable::getType()
+DIType::DIType(GlobalVariable *GV) : DIDescriptor(GV) {
+ if (!GV) return;
+ unsigned tag = getTag();
+ if (tag != dwarf::DW_TAG_base_type && !DIDerivedType::isDerivedType(tag) &&
+ !DICompositeType::isCompositeType(tag))
+ GV = 0;
+}
/// isDerivedType - Return true if the specified tag is legal for
/// DIDerivedType.