diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-17 21:00:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-17 21:00:50 +0000 |
commit | 3e0f60be46cb5363d4375f26a5e27d1dcd9867fb (patch) | |
tree | 3922ab51d543216ae59a12b6d43d989da1abd447 /lib/CodeGen/AsmPrinter/DwarfException.cpp | |
parent | 8906f950068fab18a5d1065ec11bd6563a46728d (diff) |
Use more terse and precise linkage checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76237 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfException.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfException.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfException.cpp b/lib/CodeGen/AsmPrinter/DwarfException.cpp index 80da52f6bd..1af3b11846 100644 --- a/lib/CodeGen/AsmPrinter/DwarfException.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfException.cpp @@ -147,35 +147,26 @@ void DwarfException::EmitEHFrame(const FunctionEHFrameInfo &EHFrameInfo) { assert(!EHFrameInfo.function->hasAvailableExternallyLinkage() && "Should not emit 'available externally' functions at all"); - Function::LinkageTypes linkage = EHFrameInfo.function->getLinkage(); + const Function *TheFunc = EHFrameInfo.function; + Asm->SwitchToTextSection(TAI->getDwarfEHFrameSection()); // Externally visible entry into the functions eh frame info. If the // corresponding function is static, this should not be externally visible. - if (linkage != Function::InternalLinkage && - linkage != Function::PrivateLinkage) { + if (!TheFunc->hasLocalLinkage()) if (const char *GlobalEHDirective = TAI->getGlobalEHDirective()) O << GlobalEHDirective << EHFrameInfo.FnName << "\n"; - } // If corresponding function is weak definition, this should be too. - if ((linkage == Function::WeakAnyLinkage || - linkage == Function::WeakODRLinkage || - linkage == Function::LinkOnceAnyLinkage || - linkage == Function::LinkOnceODRLinkage) && - TAI->getWeakDefDirective()) + if (TheFunc->isWeakForLinker() && TAI->getWeakDefDirective()) O << TAI->getWeakDefDirective() << EHFrameInfo.FnName << "\n"; // 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 // UnwindTablesMandatory is set we cannot do this optimization; the unwind // info is to be available for non-EH uses. - if (!EHFrameInfo.hasCalls && - !UnwindTablesMandatory && - ((linkage != Function::WeakAnyLinkage && - linkage != Function::WeakODRLinkage && - linkage != Function::LinkOnceAnyLinkage && - linkage != Function::LinkOnceODRLinkage) || + if (!EHFrameInfo.hasCalls && !UnwindTablesMandatory && + (!TheFunc->isWeakForLinker() || !TAI->getWeakDefDirective() || TAI->getSupportsWeakOmittedEHFrame())) { O << EHFrameInfo.FnName << " = 0\n"; |