diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 14 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp | 10 | ||||
-rw-r--r-- | llvm/lib/Target/DarwinTargetAsmInfo.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/Target/TargetAsmInfo.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86TargetAsmInfo.cpp | 3 |
5 files changed, 16 insertions, 18 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 7a5d24c761e..e352922fee7 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -264,17 +264,11 @@ bool AsmPrinter::doFinalization(Module &M) { return false; } -const std::string & -AsmPrinter::getCurrentFunctionEHName(const MachineFunction *MF, - std::string &Name) const { +std::string +AsmPrinter::getCurrentFunctionEHName(const MachineFunction *MF) const { assert(MF && "No machine function?"); - Name = MF->getFunction()->getName(); - if (Name.empty()) - Name = Mang->getMangledName(MF->getFunction()); - - // FIXME: THIS SEEMS REALLY WRONG, it will get two prefixes. - Name = Mang->makeNameProper(TAI->getEHGlobalPrefix() + Name + ".eh"); - return Name; + return Mang->getMangledName(MF->getFunction(), ".eh", + TAI->is_EHSymbolPrivate()); } void AsmPrinter::SetupMachineFunction(MachineFunction &MF) { diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp index 37466ab39a2..b17b163c655 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp @@ -57,8 +57,8 @@ void DwarfException::EmitCommonEHFrame(const Function *Personality, // Begin eh frame section. Asm->SwitchToTextSection(TAI->getDwarfEHFrameSection()); - if (!TAI->doesRequireNonLocalEHFrameLabel()) - O << TAI->getEHGlobalPrefix(); + if (TAI->is_EHSymbolPrivate()) + O << TAI->getPrivateGlobalPrefix(); O << "EH_frame" << Index << ":\n"; EmitLabel("section_eh_frame", Index); @@ -194,7 +194,8 @@ void DwarfException::EmitEHFrame(const FunctionEHFrameInfo &EHFrameInfo) { EmitLabel("eh_frame_begin", EHFrameInfo.Number); - if (TAI->doesRequireNonLocalEHFrameLabel()) { + if (!TAI->is_EHSymbolPrivate()) { +// FIXME: HOW ARE THESE TWO ARMS DIFFERENT?? EH_frame vs eh_frame_common? PrintRelDirective(true, true); PrintLabelName("eh_frame_begin", EHFrameInfo.Number); @@ -690,9 +691,8 @@ void DwarfException::EndFunction() { EmitExceptionTable(); // Save EH frame information - std::string Name; EHFrames.push_back( - FunctionEHFrameInfo(getAsm()->getCurrentFunctionEHName(MF, Name), + FunctionEHFrameInfo(getAsm()->getCurrentFunctionEHName(MF), SubprogramCount, MMI->getPersonalityIndex(), MF->getFrameInfo()->hasCalls(), diff --git a/llvm/lib/Target/DarwinTargetAsmInfo.cpp b/llvm/lib/Target/DarwinTargetAsmInfo.cpp index 7ab3967c0d1..3eb3d535954 100644 --- a/llvm/lib/Target/DarwinTargetAsmInfo.cpp +++ b/llvm/lib/Target/DarwinTargetAsmInfo.cpp @@ -86,6 +86,11 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo(const TargetMachine &TM) StaticDtorsSection = ".mod_term_func"; } + // _foo.eh symbols are currently always exported so that the linker knows + // about them. This may not strictly be necessary on 10.6 and later, but it + // doesn't hurt anything. + Is_EHSymbolPrivate = false; + DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug"; DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug"; DwarfLineSection = ".section __DWARF,__debug_line,regular,debug"; diff --git a/llvm/lib/Target/TargetAsmInfo.cpp b/llvm/lib/Target/TargetAsmInfo.cpp index 8bc436819a0..5b7ddbfa4a7 100644 --- a/llvm/lib/Target/TargetAsmInfo.cpp +++ b/llvm/lib/Target/TargetAsmInfo.cpp @@ -106,7 +106,7 @@ TargetAsmInfo::TargetAsmInfo(const TargetMachine &tm) SupportsExceptionHandling = false; DwarfRequiresFrameSection = true; DwarfUsesInlineInfoSection = false; - NonLocalEHFrameLabel = false; + Is_EHSymbolPrivate = true; GlobalEHDirective = 0; SupportsWeakOmittedEHFrame = true; DwarfSectionOffsetDirective = 0; diff --git a/llvm/lib/Target/X86/X86TargetAsmInfo.cpp b/llvm/lib/Target/X86/X86TargetAsmInfo.cpp index c33b765316f..9f114e69f6b 100644 --- a/llvm/lib/Target/X86/X86TargetAsmInfo.cpp +++ b/llvm/lib/Target/X86/X86TargetAsmInfo.cpp @@ -64,8 +64,7 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM): // Leopard and above support aligned common symbols. COMMDirectiveTakesAlignment = (Subtarget->getDarwinVers() >= 9); HasDotTypeDotSizeDirective = false; - NonLocalEHFrameLabel = true; - + if (is64Bit) { PersonalityPrefix = ""; PersonalitySuffix = "+4@GOTPCREL"; |