diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-17 20:46:40 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-17 20:46:40 +0000 |
commit | e79b2bc088755e55948d2cc950135809983c14de (patch) | |
tree | c0df7b693d704a5f2be64f805ff0eee618298c04 /llvm/lib/CodeGen | |
parent | 71475775b9149cb0421f6983a912ba64830bb96a (diff) | |
download | bcm5719-llvm-e79b2bc088755e55948d2cc950135809983c14de.tar.gz bcm5719-llvm-e79b2bc088755e55948d2cc950135809983c14de.zip |
Untangle a snarl that I discovered when updating the mangler,
starting in getCurrentFunctionEHName. Among other problems,
we would try to privative a "foo.eh" label, but end up emitting
the label as _Lfoo.eh instead of L_foo.eh on darwin. This is really
bad, and the linker has always tolerated these labels existing.
For now, just emit them as _foo.eh.
This patch also fixes problems with ".eh" labels on unnamed
functions and eliminates two strangely defined TargetAsmInfo
hooks.
llvm-svn: 76231
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 14 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp | 10 |
2 files changed, 9 insertions, 15 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(), |