Home | History | Annotate | Download | only in VMCore

Lines Matching refs:GV

238     void visitGlobalValue(GlobalValue &GV);
239 void visitGlobalVariable(GlobalVariable &GV);
378 void Verifier::visitGlobalValue(GlobalValue &GV) {
379 Assert1(!GV.isDeclaration() ||
380 GV.isMaterializable() ||
381 GV.hasExternalLinkage() ||
382 GV.hasDLLImportLinkage() ||
383 GV.hasExternalWeakLinkage() ||
384 (isa<GlobalAlias>(GV) &&
385 (GV.hasLocalLinkage() || GV.hasWeakLinkage())),
387 &GV);
389 Assert1(!GV.hasDLLImportLinkage() || GV.isDeclaration(),
390 "Global is marked as dllimport, but not external", &GV);
392 Assert1(!GV.hasAppendingLinkage() || isa<GlobalVariable>(GV),
393 "Only global variables can have appending linkage!", &GV);
395 if (GV.hasAppendingLinkage()) {
396 GlobalVariable *GVar = dyn_cast<GlobalVariable>(&GV);
401 Assert1(!GV.hasLinkerPrivateWeakDefAutoLinkage() || GV.hasDefaultVisibility(),
403 &GV);
406 void Verifier::visitGlobalVariable(GlobalVariable &GV) {
407 if (GV.hasInitializer()) {
408 Assert1(GV.getInitializer()->getType() == GV.getType()->getElementType(),
410 "variable type!", &GV);
414 if (GV.hasCommonLinkage()) {
415 Assert1(GV.getInitializer()->isNullValue(),
416 "'common' global must have a zero initializer!", &GV);
417 Assert1(!GV.isConstant(), "'common' global may not be marked constant!",
418 &GV);
421 Assert1(GV.hasExternalLinkage() || GV.hasDLLImportLinkage() ||
422 GV.hasExternalWeakLinkage(),
423 "invalid linkage type for global declaration", &GV);
426 if (GV.hasName() && (GV.getName() == "llvm.global_ctors" ||
427 GV.getName() == "llvm.global_dtors")) {
428 Assert1(!GV.hasInitializer() || GV.hasAppendingLinkage(),
429 GV);
432 if (ArrayType *ATy = dyn_cast<ArrayType>(GV.getType())) {
439 "wrong type for intrinsic global variable", &GV);
443 visitGlobalValue(GV);
1644 } else if (GlobalValue *GV = dyn_cast<GlobalValue>(I.getOperand(i))) {
1645 Assert1(GV->getParent() == Mod, "Referencing global in another module!",