aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-01-05 18:33:01 +0000
committerDevang Patel <dpatel@apple.com>2009-01-05 18:33:01 +0000
commit68afdc3ab08975569e59cc8c04c2db9e9478a996 (patch)
treeb500063e9f0bffafb694eb4125aec08c43d7c52a /lib/Analysis
parentd0ed240e3091607048490f174988976a44b11d30 (diff)
downloadexternal_llvm-68afdc3ab08975569e59cc8c04c2db9e9478a996.zip
external_llvm-68afdc3ab08975569e59cc8c04c2db9e9478a996.tar.gz
external_llvm-68afdc3ab08975569e59cc8c04c2db9e9478a996.tar.bz2
Construct array/vector type DIEs using DebugInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61724 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/DebugInfo.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp
index f1f7d8e..8b802d7 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/lib/Analysis/DebugInfo.cpp
@@ -174,7 +174,12 @@ DIVariable::DIVariable(GlobalVariable *GV) : DIDescriptor(GV) {
GV = 0;
}
-
+unsigned DIArray::getNumElements() const {
+ assert (GV && "Invalid DIArray");
+ Constant *C = GV->getInitializer();
+ assert (C && "Invalid DIArray initializer");
+ return C->getNumOperands();
+}
//===----------------------------------------------------------------------===//
// DIFactory: Basic Helpers