summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-04-08 07:30:21 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-04-08 07:30:21 +0000
commit466d0c1f9339583e548ce55b93c69b034c6ab85f (patch)
tree9ae05c0ee496e61f0b4ce43e2ce6a6d1ca70ca61 /llvm/lib/ExecutionEngine/ExecutionEngine.cpp
parent42983aef3497399630a64ff098361ab5f24b9691 (diff)
downloadbcm5719-llvm-466d0c1f9339583e548ce55b93c69b034c6ab85f.tar.gz
bcm5719-llvm-466d0c1f9339583e548ce55b93c69b034c6ab85f.zip
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. llvm-svn: 129128
Diffstat (limited to 'llvm/lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/ExecutionEngine.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
index 438e119d974..13e07acc151 100644
--- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/llvm/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<ConstantArray>(GV->getInitializer());
- if (!InitList) return;
+ ConstantArray *InitList = cast<ConstantArray>(GV->getInitializer());
for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i) {
- ConstantStruct *CS =
- dyn_cast<ConstantStruct>(InitList->getOperand(i));
- if (!CS) continue;
- if (CS->getNumOperands() != 2) return; // Not array of 2-element structs.
+ ConstantStruct *CS = cast<ConstantStruct>(InitList->getOperand(i));
Constant *FP = CS->getOperand(1);
if (FP->isNullValue())
OpenPOWER on IntegriCloud