Reapply r289926: attempt to fix windows build

llvm-svn: 290158
This commit is contained in:
Adrian Prantl 2016-12-20 02:33:30 +00:00
parent 398f55f6f6
commit dc6e0169ae
1 changed files with 2 additions and 1 deletions

View File

@ -648,11 +648,12 @@ void Verifier::visitGlobalVariable(const GlobalVariable &GV) {
// Visit any debug info attachments.
SmallVector<MDNode *, 1> MDs;
GV.getMetadata(LLVMContext::MD_dbg, MDs);
for (auto *MD : MDs)
for (auto *MD : MDs) {
if (auto *GVE = dyn_cast<DIGlobalVariableExpression>(MD))
visitDIGlobalVariableExpression(*GVE);
else
AssertDI(false, "!dbg attachment of global variable must be a DIGlobalVariableExpression");
}
if (!GV.hasInitializer()) {
visitGlobalValue(GV);