Call Verify() methods of various debugging llvm::DI* types after creation.

This commit is contained in:
Matt Pharr
2012-04-25 06:17:05 -10:00
parent 12706cd37f
commit d5cc2ad643
3 changed files with 33 additions and 20 deletions

View File

@@ -395,12 +395,14 @@ Module::AddGlobalVariable(const std::string &name, const Type *type, Expr *initE
if (diBuilder) {
llvm::DIFile file = pos.GetDIFile();
diBuilder->createGlobalVariable(name,
file,
pos.first_line,
sym->type->GetDIType(file),
(sym->storageClass == SC_STATIC),
sym->storagePtr);
llvm::DIGlobalVariable var =
diBuilder->createGlobalVariable(name,
file,
pos.first_line,
sym->type->GetDIType(file),
(sym->storageClass == SC_STATIC),
sym->storagePtr);
Assert(var.Verify());
}
}