From 283bc2ed28f423c29ab57a2b491d2ebdb53a4b12 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Fri, 14 Nov 2014 00:35:50 +0000 Subject: Allow the use of functions as typeinfo in landingpad clauses This is one step towards supporting SEH filter functions in LLVM. llvm-svn: 221954 --- llvm/lib/CodeGen/Analysis.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'llvm/lib/CodeGen/Analysis.cpp') diff --git a/llvm/lib/CodeGen/Analysis.cpp b/llvm/lib/CodeGen/Analysis.cpp index 02036352433..9a3b7905e4a 100644 --- a/llvm/lib/CodeGen/Analysis.cpp +++ b/llvm/lib/CodeGen/Analysis.cpp @@ -109,15 +109,16 @@ void llvm::ComputeValueVTs(const TargetLowering &TLI, Type *Ty, } /// ExtractTypeInfo - Returns the type info, possibly bitcast, encoded in V. -GlobalVariable *llvm::ExtractTypeInfo(Value *V) { +GlobalValue *llvm::ExtractTypeInfo(Value *V) { V = V->stripPointerCasts(); - GlobalVariable *GV = dyn_cast(V); + GlobalValue *GV = dyn_cast(V); + GlobalVariable *Var = dyn_cast(V); - if (GV && GV->getName() == "llvm.eh.catch.all.value") { - assert(GV->hasInitializer() && + if (Var && Var->getName() == "llvm.eh.catch.all.value") { + assert(Var->hasInitializer() && "The EH catch-all value must have an initializer"); - Value *Init = GV->getInitializer(); - GV = dyn_cast(Init); + Value *Init = Var->getInitializer(); + GV = dyn_cast(Init); if (!GV) V = cast(Init); } -- cgit v1.2.3