Forgot the part where we handle the ".llvm.eh.catch.all.value".

llvm-svn: 99697
This commit is contained in:
Bill Wendling 2010-03-27 01:24:30 +00:00
parent ec8b44adeb
commit 6888e798d3
1 changed files with 11 additions and 2 deletions

View File

@ -281,8 +281,17 @@ unsigned FunctionLoweringInfo::CreateRegForValue(const Value *V) {
GlobalVariable *llvm::ExtractTypeInfo(Value *V) {
V = V->stripPointerCasts();
GlobalVariable *GV = dyn_cast<GlobalVariable>(V);
assert ((GV || isa<ConstantPointerNull>(V)) &&
"TypeInfo must be a global variable or NULL");
if (GV && GV->getName() == ".llvm.eh.catch.all.value") {
assert(GV->hasInitializer() &&
"The EH catch-all value must have an initializer");
Value *Init = GV->getInitializer();
GV = dyn_cast<GlobalVariable>(Init);
if (!GV) V = cast<ConstantPointerNull>(Init);
}
assert((GV || isa<ConstantPointerNull>(V)) &&
"TypeInfo must be a global variable or NULL");
return GV;
}