diff options
author | Roman Divacky <rdivacky@freebsd.org> | 2012-08-28 19:06:55 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@freebsd.org> | 2012-08-28 19:06:55 +0000 |
commit | 8c4b6a307eb937faa134810c8cd2d68603713d4e (patch) | |
tree | 19454e93294fe3705e9f9dc3bac3668742b11874 /llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp | |
parent | 206cefe66c210b773d5e50aaefda6eddc102b493 (diff) | |
download | bcm5719-llvm-8c4b6a307eb937faa134810c8cd2d68603713d4e.tar.gz bcm5719-llvm-8c4b6a307eb937faa134810c8cd2d68603713d4e.zip |
Emit word of zeroes after the last instruction as a start of the mandatory
traceback table on PowerPC64. This helps gdb handle exceptions. The other
mandatory fields are ignored by gdb and harder to implement so just add
there a FIXME.
Patch by Bill Schmidt. PR13641.
llvm-svn: 162778
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp index 5bd8617ccf2..de3241504dc 100644 --- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -109,6 +109,8 @@ namespace { bool doFinalization(Module &M); virtual void EmitFunctionEntryLabel(); + + void EmitFunctionBodyEnd(); }; /// PPCDarwinAsmPrinter - PowerPC assembly printer, customized for Darwin/Mac @@ -450,6 +452,19 @@ bool PPCLinuxAsmPrinter::doFinalization(Module &M) { return AsmPrinter::doFinalization(M); } +/// EmitFunctionBodyEnd - Print the traceback table before the .size +/// directive. +/// +void PPCLinuxAsmPrinter::EmitFunctionBodyEnd() { + // Only the 64-bit target requires a traceback table. For now, + // we only emit the word of zeroes that GDB requires to find + // the end of the function. + // FIXME: Eventually we should add the eight-byte mandatory fields + // described in the PPC64 ELF ABI. + if (Subtarget.isPPC64()) + OutStreamer.EmitIntValue(0, 4/*size*/); +} + void PPCDarwinAsmPrinter::EmitStartOfAsmFile(Module &M) { static const char *const CPUDirectives[] = { "", |