diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -2150,10 +2150,13 @@ if (!DDTy->getName().empty()) { Info.Members.push_back({DDTy, 0}); - // Collect static const data members. + // Collect static const data members with values. if ((DDTy->getFlags() & DINode::FlagStaticMember) == - DINode::FlagStaticMember) - StaticConstMembers.push_back(DDTy); + DINode::FlagStaticMember) { + if (isa(DDTy->getConstant()) || + isa(DDTy->getConstant())) + StaticConstMembers.push_back(DDTy); + } return; } @@ -3134,7 +3137,7 @@ dyn_cast_or_null(DTy->getConstant())) Value = APSInt(CFP->getValueAPF().bitcastToAPInt(), true); else - continue; + assert(false && "cannot emit a constant without a value"); std::string QualifiedName = getFullyQualifiedName(Scope, DTy->getName());