aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2011-04-15 03:35:57 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2011-04-15 03:35:57 +0000
commitbcb8c6d09ee426e0f774e3412912f6ae9e5f78dd (patch)
tree19eda0282d1d201b4a7ae6dc5b2760d73a13eaf3 /lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
parent9eec66e604f09ed9779bc438d0dc4fa9d24db44c (diff)
downloadexternal_llvm-bcb8c6d09ee426e0f774e3412912f6ae9e5f78dd.zip
external_llvm-bcb8c6d09ee426e0f774e3412912f6ae9e5f78dd.tar.gz
external_llvm-bcb8c6d09ee426e0f774e3412912f6ae9e5f78dd.tar.bz2
Revert r129518, "Change ELF systems to use CFI for producing the EH tables. This reduces the"
It broke several builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129557 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfCFIException.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfCFIException.cpp42
1 files changed, 15 insertions, 27 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp b/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
index aff86bb..68be2ee 100644
--- a/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
@@ -32,7 +32,6 @@
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Support/Dwarf.h"
-#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
@@ -61,16 +60,11 @@ void DwarfCFIException::EndModule() {
// Begin eh frame section.
Asm->OutStreamer.SwitchSection(TLOF.getEHFrameSection());
- if ((PerEncoding & 0x70) != dwarf::DW_EH_PE_pcrel)
- return;
-
// Emit references to all used personality functions
const std::vector<const Function*> &Personalities = MMI->getPersonalities();
for (size_t i = 0, e = Personalities.size(); i != e; ++i) {
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("personality", i));
- const MCSymbol *Sym = Asm->Mang->getSymbol(Personalities[i]);
- unsigned Size = Asm->TM.getTargetData()->getPointerSize();
- Asm->OutStreamer.EmitSymbolValue(Sym, Size);
+ Asm->EmitReference(Personalities[i], PerEncoding);
}
}
@@ -93,9 +87,17 @@ void DwarfCFIException::BeginFunction(const MachineFunction *MF) {
shouldEmitTableModule |= shouldEmitTable;
- if (shouldEmitMoves || shouldEmitTable)
+ if (shouldEmitMoves) {
+ const TargetFrameLowering *TFL = Asm->TM.getFrameLowering();
Asm->OutStreamer.EmitCFIStartProc();
+ // Indicate locations of general callee saved registers in frame.
+ std::vector<MachineMove> Moves;
+ TFL->getInitialFrameState(Moves);
+ Asm->EmitCFIFrameMoves(Moves);
+ Asm->EmitCFIFrameMoves(MMI->getFrameMoves());
+ }
+
if (!shouldEmitTable)
return;
@@ -110,25 +112,11 @@ void DwarfCFIException::BeginFunction(const MachineFunction *MF) {
// Indicate personality routine, if any.
unsigned PerEncoding = TLOF.getPersonalityEncoding();
- const Function *Per = MMI->getPersonalities()[MMI->getPersonalityIndex()];
- if (PerEncoding == dwarf::DW_EH_PE_omit || !Per)
- return;
-
- const MCSymbol *Sym;
- switch (PerEncoding & 0x70) {
- default:
- report_fatal_error("We do not support this DWARF encoding yet!");
- case dwarf::DW_EH_PE_absptr: {
- Sym = Asm->Mang->getSymbol(Per);
- break;
- }
- case dwarf::DW_EH_PE_pcrel: {
- Sym = Asm->GetTempSymbol("personality",
- MMI->getPersonalityIndex());
- break;
- }
- }
- Asm->OutStreamer.EmitCFIPersonality(Sym, PerEncoding);
+ if (PerEncoding != dwarf::DW_EH_PE_omit &&
+ MMI->getPersonalities()[MMI->getPersonalityIndex()])
+ Asm->OutStreamer.EmitCFIPersonality(Asm->GetTempSymbol("personality",
+ MMI->getPersonalityIndex()),
+ PerEncoding);
}
/// EndFunction - Gather and emit post-function exception information.