diff options
Diffstat (limited to 'lib/Analysis/DebugInfo.cpp')
-rw-r--r-- | lib/Analysis/DebugInfo.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp index 3d03815974..337dc3fc3d 100644 --- a/lib/Analysis/DebugInfo.cpp +++ b/lib/Analysis/DebugInfo.cpp @@ -186,7 +186,8 @@ bool DIDescriptor::isSubprogram() const { /// isGlobalVariable - Return true if the specified tag is legal for /// DIGlobalVariable. bool DIDescriptor::isGlobalVariable() const { - return DbgNode && getTag() == dwarf::DW_TAG_variable; + return DbgNode && (getTag() == dwarf::DW_TAG_variable || + getTag() == dwarf::DW_TAG_constant); } /// isGlobal - Return true if the specified tag is legal for DIGlobal. @@ -1078,7 +1079,7 @@ DIFactory::CreateGlobalVariable(DIDescriptor Context, StringRef Name, unsigned LineNo, DIType Ty,bool isLocalToUnit, bool isDefinition, llvm::Constant *Val) { Value *Elts[] = { - GetTagConstant(dwarf::DW_TAG_variable), + GetTagConstant(dwarf::DW_TAG_constant), llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)), Context, MDString::get(VMContext, Name), |