mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 04:24:00 +00:00
Do not mark EH tables no-dead-strip unless the
associated function is so marked. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46088 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1552,6 +1552,21 @@ bool MachineModuleInfo::Verify(Value *V) {
|
||||
///
|
||||
void MachineModuleInfo::AnalyzeModule(Module &M) {
|
||||
SetupCompileUnits(M);
|
||||
|
||||
// Insert functions in the llvm.used array into UsedFunctions.
|
||||
GlobalVariable *GV = M.getGlobalVariable("llvm.used");
|
||||
if (!GV || !GV->hasInitializer()) return;
|
||||
|
||||
// Should be an array of 'i8*'.
|
||||
ConstantArray *InitList = dyn_cast<ConstantArray>(GV->getInitializer());
|
||||
if (InitList == 0) return;
|
||||
|
||||
for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i) {
|
||||
if (ConstantExpr *CE = dyn_cast<ConstantExpr>(InitList->getOperand(i)))
|
||||
if (CE->getOpcode() == Instruction::BitCast)
|
||||
if (Function *F = dyn_cast<Function>(CE->getOperand(0)))
|
||||
UsedFunctions.insert(F);
|
||||
}
|
||||
}
|
||||
|
||||
/// needsFrameInfo - Returns true if we need to gather callee-saved register
|
||||
|
Reference in New Issue
Block a user