aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-17 20:46:40 +0000
committerChris Lattner <sabre@nondot.org>2009-07-17 20:46:40 +0000
commit5c3475ecd4d91b986d1d5b2facbf6618d2fd795a (patch)
tree5519e3da8fc3474c49728b80a86d5c9f76f57db2 /lib/CodeGen
parentc7df3cb6073991804c31b91c650d62521c6d67b2 (diff)
downloadexternal_llvm-5c3475ecd4d91b986d1d5b2facbf6618d2fd795a.zip
external_llvm-5c3475ecd4d91b986d1d5b2facbf6618d2fd795a.tar.gz
external_llvm-5c3475ecd4d91b986d1d5b2facbf6618d2fd795a.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76231 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp14
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfException.cpp10
2 files changed, 9 insertions, 15 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 7a5d24c..e352922 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/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/lib/CodeGen/AsmPrinter/DwarfException.cpp b/lib/CodeGen/AsmPrinter/DwarfException.cpp
index 37466ab..b17b163 100644
--- a/lib/CodeGen/AsmPrinter/DwarfException.cpp
+++ b/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(),