summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-17 21:00:50 +0000
committerChris Lattner <sabre@nondot.org>2009-07-17 21:00:50 +0000
commit1af5af8640a6679ffefc6fa1af9e8602f174f82e (patch)
tree91e9a3df5b3452d0ad7da547e803bfe3635d99b6 /llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
parent58b0e71886518995d314ec8e0997f50147fa95e0 (diff)
downloadbcm5719-llvm-1af5af8640a6679ffefc6fa1af9e8602f174f82e.tar.gz
bcm5719-llvm-1af5af8640a6679ffefc6fa1af9e8602f174f82e.zip
Use more terse and precise linkage checks.
llvm-svn: 76237
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
index 80da52f6bdc..1af3b118465 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
+++ b/llvm/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";
OpenPOWER on IntegriCloud