aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2007-09-18 01:47:22 +0000
committerBill Wendling <isanbard@gmail.com>2007-09-18 01:47:22 +0000
commitef9211a831a5e63fc462c7a16a1a379882723893 (patch)
tree38536a441946b081dae2d1328a4cdb8c15fe5e21 /lib
parentd00de0ece78776e8850119e6430b3c63da41fcb8 (diff)
downloadexternal_llvm-ef9211a831a5e63fc462c7a16a1a379882723893.tar.gz
external_llvm-ef9211a831a5e63fc462c7a16a1a379882723893.tar.bz2
external_llvm-ef9211a831a5e63fc462c7a16a1a379882723893.zip
Objective-C was generating EH frame info like this:
"_-[NSString(local) isNullOrNil]".eh = 0 .no_dead_strip "_-[NSString(local) isNullOrNil]".eh The ".eh" should be inside the quotes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42074 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/AsmPrinter.cpp9
-rw-r--r--lib/CodeGen/DwarfWriter.cpp21
2 files changed, 20 insertions, 10 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp
index 3d8dd75a16..e0a5928da8 100644
--- a/lib/CodeGen/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter.cpp
@@ -160,6 +160,15 @@ bool AsmPrinter::doFinalization(Module &M) {
return false;
}
+const std::string &
+AsmPrinter::getCurrentFunctionEHName(const MachineFunction *MF) {
+ assert(MF && "No machine function?");
+ if (CurrentFnEHName != "") return CurrentFnEHName;
+ return CurrentFnEHName =
+ Mang->makeNameProper(MF->getFunction()->getName() + ".eh",
+ TAI->getGlobalPrefix());
+}
+
void AsmPrinter::SetupMachineFunction(MachineFunction &MF) {
// What's my mangled name?
CurrentFnName = Mang->getValueName(MF.getFunction());
diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp
index 10f7c99184..121ef1d9e8 100644
--- a/lib/CodeGen/DwarfWriter.cpp
+++ b/lib/CodeGen/DwarfWriter.cpp
@@ -2833,13 +2833,13 @@ private:
// Externally visible entry into the functions eh frame info.
if (const char *GlobalDirective = TAI->getGlobalDirective())
- O << GlobalDirective << EHFrameInfo.FnName << ".eh\n";
+ O << GlobalDirective << EHFrameInfo.FnName << "\n";
// If there are no calls then you can't unwind.
if (!EHFrameInfo.hasCalls) {
- O << EHFrameInfo.FnName << ".eh = 0\n";
+ O << EHFrameInfo.FnName << " = 0\n";
} else {
- O << EHFrameInfo.FnName << ".eh:\n";
+ O << EHFrameInfo.FnName << ":\n";
// EH frame header.
EmitDifference("eh_frame_end", EHFrameInfo.Number,
@@ -2887,7 +2887,7 @@ private:
}
if (const char *UsedDirective = TAI->getUsedDirective())
- O << UsedDirective << EHFrameInfo.FnName << ".eh\n\n";
+ O << UsedDirective << EHFrameInfo.FnName << "\n\n";
}
/// EmitExceptionTable - Emit landing pads and actions.
@@ -3321,12 +3321,13 @@ public:
EmitExceptionTable();
// Save EH frame information
- EHFrames.push_back(FunctionEHFrameInfo(getAsm()->CurrentFnName,
- SubprogramCount,
- MMI->getPersonalityIndex(),
- MF->getFrameInfo()->hasCalls(),
- !MMI->getLandingPads().empty(),
- MMI->getFrameMoves()));
+ EHFrames.
+ push_back(FunctionEHFrameInfo(getAsm()->getCurrentFunctionEHName(MF),
+ SubprogramCount,
+ MMI->getPersonalityIndex(),
+ MF->getFrameInfo()->hasCalls(),
+ !MMI->getLandingPads().empty(),
+ MMI->getFrameMoves()));
}
};