mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-13 08:26:02 +00:00
Use more terse and precise linkage checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76237 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -147,35 +147,26 @@ void DwarfException::EmitEHFrame(const FunctionEHFrameInfo &EHFrameInfo) {
|
|||||||
assert(!EHFrameInfo.function->hasAvailableExternallyLinkage() &&
|
assert(!EHFrameInfo.function->hasAvailableExternallyLinkage() &&
|
||||||
"Should not emit 'available externally' functions at all");
|
"Should not emit 'available externally' functions at all");
|
||||||
|
|
||||||
Function::LinkageTypes linkage = EHFrameInfo.function->getLinkage();
|
const Function *TheFunc = EHFrameInfo.function;
|
||||||
|
|
||||||
Asm->SwitchToTextSection(TAI->getDwarfEHFrameSection());
|
Asm->SwitchToTextSection(TAI->getDwarfEHFrameSection());
|
||||||
|
|
||||||
// Externally visible entry into the functions eh frame info. If the
|
// Externally visible entry into the functions eh frame info. If the
|
||||||
// corresponding function is static, this should not be externally visible.
|
// corresponding function is static, this should not be externally visible.
|
||||||
if (linkage != Function::InternalLinkage &&
|
if (!TheFunc->hasLocalLinkage())
|
||||||
linkage != Function::PrivateLinkage) {
|
|
||||||
if (const char *GlobalEHDirective = TAI->getGlobalEHDirective())
|
if (const char *GlobalEHDirective = TAI->getGlobalEHDirective())
|
||||||
O << GlobalEHDirective << EHFrameInfo.FnName << "\n";
|
O << GlobalEHDirective << EHFrameInfo.FnName << "\n";
|
||||||
}
|
|
||||||
|
|
||||||
// If corresponding function is weak definition, this should be too.
|
// If corresponding function is weak definition, this should be too.
|
||||||
if ((linkage == Function::WeakAnyLinkage ||
|
if (TheFunc->isWeakForLinker() && TAI->getWeakDefDirective())
|
||||||
linkage == Function::WeakODRLinkage ||
|
|
||||||
linkage == Function::LinkOnceAnyLinkage ||
|
|
||||||
linkage == Function::LinkOnceODRLinkage) &&
|
|
||||||
TAI->getWeakDefDirective())
|
|
||||||
O << TAI->getWeakDefDirective() << EHFrameInfo.FnName << "\n";
|
O << TAI->getWeakDefDirective() << EHFrameInfo.FnName << "\n";
|
||||||
|
|
||||||
// If there are no calls then you can't unwind. This may mean we can omit the
|
// 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 symbols. If
|
// EH Frame, but some environments do not handle weak absolute symbols. If
|
||||||
// UnwindTablesMandatory is set we cannot do this optimization; the unwind
|
// UnwindTablesMandatory is set we cannot do this optimization; the unwind
|
||||||
// info is to be available for non-EH uses.
|
// info is to be available for non-EH uses.
|
||||||
if (!EHFrameInfo.hasCalls &&
|
if (!EHFrameInfo.hasCalls && !UnwindTablesMandatory &&
|
||||||
!UnwindTablesMandatory &&
|
(!TheFunc->isWeakForLinker() ||
|
||||||
((linkage != Function::WeakAnyLinkage &&
|
|
||||||
linkage != Function::WeakODRLinkage &&
|
|
||||||
linkage != Function::LinkOnceAnyLinkage &&
|
|
||||||
linkage != Function::LinkOnceODRLinkage) ||
|
|
||||||
!TAI->getWeakDefDirective() ||
|
!TAI->getWeakDefDirective() ||
|
||||||
TAI->getSupportsWeakOmittedEHFrame())) {
|
TAI->getSupportsWeakOmittedEHFrame())) {
|
||||||
O << EHFrameInfo.FnName << " = 0\n";
|
O << EHFrameInfo.FnName << " = 0\n";
|
||||||
|
Reference in New Issue
Block a user