diff options
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/DebugInfo.cpp | 7 |
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 |