From 2c44a80d991df258a45e2f5fa76d5ada9e99015c Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Fri, 8 Apr 2011 07:30:21 +0000 Subject: llvm.global_[cd]tor is defined to be either external, or appending with an array of { i32, void ()* }. Teach the verifier to verify that, deleting copies of checks strewn about. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129128 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ExecutionEngine/ExecutionEngine.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'lib/ExecutionEngine/ExecutionEngine.cpp') diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index 438e119d97..13e07acc15 100644 --- a/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/lib/ExecutionEngine/ExecutionEngine.cpp @@ -313,13 +313,9 @@ void ExecutionEngine::runStaticConstructorsDestructors(Module *module, // Should be an array of '{ i32, void ()* }' structs. The first value is // the init priority, which we ignore. - ConstantArray *InitList = dyn_cast(GV->getInitializer()); - if (!InitList) return; + ConstantArray *InitList = cast(GV->getInitializer()); for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i) { - ConstantStruct *CS = - dyn_cast(InitList->getOperand(i)); - if (!CS) continue; - if (CS->getNumOperands() != 2) return; // Not array of 2-element structs. + ConstantStruct *CS = cast(InitList->getOperand(i)); Constant *FP = CS->getOperand(1); if (FP->isNullValue()) -- cgit v1.2.3-18-g5258