Let Verifier check aliasees

llvm-svn: 36540
This commit is contained in:
Anton Korobeynikov 2007-04-28 14:35:41 +00:00
parent 349097160e
commit 2070ca3361

View File

@ -319,6 +319,13 @@ void Verifier::visitGlobalAlias(GlobalAlias &GA) {
Assert1(GA.getType() == GA.getAliasee()->getType(),
"Alias and aliasee types should match!", &GA);
if (!isa<GlobalValue>(GA.getAliasee())) {
const ConstantExpr *CE = dyn_cast<ConstantExpr>(GA.getAliasee());
Assert1(CE && CE->getOpcode() == Instruction::BitCast,
"Aliasee should be either GlobalValue or bitcast of GlobalValue",
&GA);
}
visitGlobalValue(GA);
}