summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2007-04-28 14:35:41 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2007-04-28 14:35:41 +0000
commit7b2a2f907543811080afe0db3ffaeda693bd4082 (patch)
tree58551e8640c16e80ad6ed580a232f0590f7dd41f /llvm/lib/VMCore
parentb19636e4afd2519dbddf8d48338afe78b4bd56f6 (diff)
downloadbcm5719-llvm-7b2a2f907543811080afe0db3ffaeda693bd4082.tar.gz
bcm5719-llvm-7b2a2f907543811080afe0db3ffaeda693bd4082.zip
Let Verifier check aliasees
llvm-svn: 36540
Diffstat (limited to 'llvm/lib/VMCore')
-rw-r--r--llvm/lib/VMCore/Verifier.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp
index 01eb860f911..c580e70d84e 100644
--- a/llvm/lib/VMCore/Verifier.cpp
+++ b/llvm/lib/VMCore/Verifier.cpp
@@ -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);
}
OpenPOWER on IntegriCloud