mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-20 10:24:12 +00:00
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
This commit is contained in:
@ -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())
|
||||
|
Reference in New Issue
Block a user