mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-10 16:24:04 +00:00
Implement new llc flag -disable-required-unwind-tables.
Corresponds to -fno-unwind-tables (usually default in gcc). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49361 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9b01cc0ede
commit
4e1b79459f
@ -74,13 +74,18 @@ namespace llvm {
|
|||||||
/// be emitted.
|
/// be emitted.
|
||||||
extern bool ExceptionHandling;
|
extern bool ExceptionHandling;
|
||||||
|
|
||||||
|
/// UnwindTablesOptional - This flag indicates that unwind tables need not
|
||||||
|
/// be emitted for all functions. Exception handling may still require them
|
||||||
|
/// for some functions.
|
||||||
|
extern bool UnwindTablesOptional;
|
||||||
|
|
||||||
/// PerformTailCallOpt - This flag is enabled when -tailcallopt is specified
|
/// PerformTailCallOpt - This flag is enabled when -tailcallopt is specified
|
||||||
/// on the commandline. When the flag is on, the target will perform tail call
|
/// on the commandline. When the flag is on, the target will perform tail call
|
||||||
/// optimization (pop the caller's stack) providing it supports it.
|
/// optimization (pop the caller's stack) providing it supports it.
|
||||||
extern bool PerformTailCallOpt;
|
extern bool PerformTailCallOpt;
|
||||||
|
|
||||||
/// OptimizeForSize - When this flags is set, code generator avoids optimization
|
/// OptimizeForSize - When this flag is set, the code generator avoids
|
||||||
/// that increases size.
|
/// optimizations that increase size.
|
||||||
extern bool OptimizeForSize;
|
extern bool OptimizeForSize;
|
||||||
} // End llvm namespace
|
} // End llvm namespace
|
||||||
|
|
||||||
|
@ -2905,8 +2905,11 @@ private:
|
|||||||
|
|
||||||
// If there are no calls then you can't unwind. This may mean we can
|
// If there are no calls then you can't unwind. This may mean we can
|
||||||
// omit the EH Frame, but some environments do not handle weak absolute
|
// omit the EH Frame, but some environments do not handle weak absolute
|
||||||
// symbols.
|
// symbols.
|
||||||
|
// If UnwindTablesOptional is not set we cannot do this optimization; the
|
||||||
|
// unwind info is to be available for non-EH uses.
|
||||||
if (!EHFrameInfo.hasCalls &&
|
if (!EHFrameInfo.hasCalls &&
|
||||||
|
UnwindTablesOptional &&
|
||||||
((linkage != Function::WeakLinkage &&
|
((linkage != Function::WeakLinkage &&
|
||||||
linkage != Function::LinkOnceLinkage) ||
|
linkage != Function::LinkOnceLinkage) ||
|
||||||
!TAI->getWeakDefDirective() ||
|
!TAI->getWeakDefDirective() ||
|
||||||
@ -3427,7 +3430,9 @@ public:
|
|||||||
shouldEmitTable = true;
|
shouldEmitTable = true;
|
||||||
|
|
||||||
// See if we need frame move info.
|
// See if we need frame move info.
|
||||||
if (MMI->hasDebugInfo() || !MF->getFunction()->doesNotThrow())
|
if (MMI->hasDebugInfo() ||
|
||||||
|
!MF->getFunction()->doesNotThrow() ||
|
||||||
|
!UnwindTablesOptional)
|
||||||
shouldEmitMoves = true;
|
shouldEmitMoves = true;
|
||||||
|
|
||||||
if (shouldEmitMoves || shouldEmitTable)
|
if (shouldEmitMoves || shouldEmitTable)
|
||||||
|
@ -948,7 +948,8 @@ PPCRegisterInfo::emitPrologue(MachineFunction &MF) const {
|
|||||||
MachineFrameInfo *MFI = MF.getFrameInfo();
|
MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||||
MachineModuleInfo *MMI = MFI->getMachineModuleInfo();
|
MachineModuleInfo *MMI = MFI->getMachineModuleInfo();
|
||||||
bool needsFrameMoves = (MMI && MMI->hasDebugInfo()) ||
|
bool needsFrameMoves = (MMI && MMI->hasDebugInfo()) ||
|
||||||
!MF.getFunction()->doesNotThrow();
|
!MF.getFunction()->doesNotThrow() ||
|
||||||
|
!UnwindTablesOptional;
|
||||||
|
|
||||||
// Prepare for frame info.
|
// Prepare for frame info.
|
||||||
unsigned FrameLabelId = 0;
|
unsigned FrameLabelId = 0;
|
||||||
|
@ -31,6 +31,7 @@ namespace llvm {
|
|||||||
bool UseSoftFloat;
|
bool UseSoftFloat;
|
||||||
bool NoZerosInBSS;
|
bool NoZerosInBSS;
|
||||||
bool ExceptionHandling;
|
bool ExceptionHandling;
|
||||||
|
bool UnwindTablesOptional;
|
||||||
Reloc::Model RelocationModel;
|
Reloc::Model RelocationModel;
|
||||||
CodeModel::Model CMModel;
|
CodeModel::Model CMModel;
|
||||||
bool PerformTailCallOpt;
|
bool PerformTailCallOpt;
|
||||||
@ -80,9 +81,14 @@ namespace {
|
|||||||
cl::init(false));
|
cl::init(false));
|
||||||
cl::opt<bool, true>
|
cl::opt<bool, true>
|
||||||
EnableExceptionHandling("enable-eh",
|
EnableExceptionHandling("enable-eh",
|
||||||
cl::desc("Exception handling should be emitted."),
|
cl::desc("Emit DWARF exception handling (default if target supports)"),
|
||||||
cl::location(ExceptionHandling),
|
cl::location(ExceptionHandling),
|
||||||
cl::init(false));
|
cl::init(false));
|
||||||
|
cl::opt<bool, true>
|
||||||
|
DisableUnwindTables("disable-required-unwind-tables",
|
||||||
|
cl::desc("Do not require unwinding info for all functions"),
|
||||||
|
cl::location(UnwindTablesOptional),
|
||||||
|
cl::init(false));
|
||||||
|
|
||||||
cl::opt<llvm::Reloc::Model, true>
|
cl::opt<llvm::Reloc::Model, true>
|
||||||
DefRelocationModel(
|
DefRelocationModel(
|
||||||
|
@ -504,7 +504,9 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const {
|
|||||||
MachineModuleInfo *MMI = MFI->getMachineModuleInfo();
|
MachineModuleInfo *MMI = MFI->getMachineModuleInfo();
|
||||||
X86MachineFunctionInfo *X86FI = MF.getInfo<X86MachineFunctionInfo>();
|
X86MachineFunctionInfo *X86FI = MF.getInfo<X86MachineFunctionInfo>();
|
||||||
MachineBasicBlock::iterator MBBI = MBB.begin();
|
MachineBasicBlock::iterator MBBI = MBB.begin();
|
||||||
bool needsFrameMoves = (MMI && MMI->hasDebugInfo()) || !Fn->doesNotThrow();
|
bool needsFrameMoves = (MMI && MMI->hasDebugInfo()) ||
|
||||||
|
!Fn->doesNotThrow() ||
|
||||||
|
!UnwindTablesOptional;
|
||||||
|
|
||||||
// Prepare for frame info.
|
// Prepare for frame info.
|
||||||
unsigned FrameLabelId = 0;
|
unsigned FrameLabelId = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user