summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/CodeGen/AsmPrinter.h2
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/ARMException.cpp2
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp9
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp4
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp20
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/EHStreamer.h5
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp2
-rw-r--r--llvm/lib/Target/ARM/ARMAsmPrinter.cpp5
-rw-r--r--llvm/test/CodeGen/ARM/2009-08-31-LSDA-Name.ll6
9 files changed, 18 insertions, 37 deletions
diff --git a/llvm/include/llvm/CodeGen/AsmPrinter.h b/llvm/include/llvm/CodeGen/AsmPrinter.h
index 382f91f8f07..dd20fdd748f 100644
--- a/llvm/include/llvm/CodeGen/AsmPrinter.h
+++ b/llvm/include/llvm/CodeGen/AsmPrinter.h
@@ -108,6 +108,7 @@ public:
private:
MCSymbol *CurrentFnBegin;
MCSymbol *CurrentFnEnd;
+ MCSymbol *CurExceptionSym;
// The garbage collection metadata printer table.
void *GCMetadataPrinters; // Really a DenseMap.
@@ -154,6 +155,7 @@ public:
MCSymbol *getFunctionBegin() const { return CurrentFnBegin; }
MCSymbol *getFunctionEnd() const { return CurrentFnEnd; }
+ MCSymbol *getCurExceptionSym();
/// Return information about object file lowering.
const TargetLoweringObjectFile &getObjFileLowering() const;
diff --git a/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp b/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
index 034e34a9573..9a16e15ecf7 100644
--- a/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
@@ -53,8 +53,6 @@ void ARMException::endModule() {
}
void ARMException::beginFunction(const MachineFunction *MF) {
- DwarfCFIExceptionBase::beginFunction(MF);
-
if (Asm->MAI->getExceptionHandlingType() == ExceptionHandling::ARM)
getTargetStreamer().emitFnStart();
// See if we need call frame info.
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index b2919f2301e..5b4a5cc644d 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -108,7 +108,7 @@ AsmPrinter::AsmPrinter(TargetMachine &tm, std::unique_ptr<MCStreamer> Streamer)
MMI = nullptr;
LI = nullptr;
MF = nullptr;
- CurrentFnSym = CurrentFnSymForSize = nullptr;
+ CurExceptionSym = CurrentFnSym = CurrentFnSymForSize = nullptr;
CurrentFnBegin = nullptr;
CurrentFnEnd = nullptr;
GCMetadataPrinters = nullptr;
@@ -1129,12 +1129,19 @@ bool AsmPrinter::doFinalization(Module &M) {
return false;
}
+MCSymbol *AsmPrinter::getCurExceptionSym() {
+ if (!CurExceptionSym)
+ CurExceptionSym = createTempSymbol("exception", getFunctionNumber());
+ return CurExceptionSym;
+}
+
void AsmPrinter::SetupMachineFunction(MachineFunction &MF) {
this->MF = &MF;
// Get the function symbol.
CurrentFnSym = getSymbol(MF.getFunction());
CurrentFnSymForSize = CurrentFnSym;
CurrentFnBegin = nullptr;
+ CurExceptionSym = nullptr;
bool NeedsLocalForSize = MAI->needsLocalForSize();
if (!MMI->getLandingPads().empty() || MMI->hasDebugInfo() ||
NeedsLocalForSize) {
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
index 5263a2afd0f..1bee367996d 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
@@ -88,8 +88,6 @@ void DwarfCFIException::endModule() {
}
void DwarfCFIException::beginFunction(const MachineFunction *MF) {
- DwarfCFIExceptionBase::beginFunction(MF);
-
shouldEmitMoves = shouldEmitPersonality = shouldEmitLSDA = false;
// If any landing pads survive, we need an EH table.
@@ -133,7 +131,7 @@ void DwarfCFIException::beginFunction(const MachineFunction *MF) {
if (!shouldEmitLSDA)
return;
- Asm->OutStreamer.EmitCFILsda(getCurExceptionSym(), LSDAEncoding);
+ Asm->OutStreamer.EmitCFILsda(Asm->getCurExceptionSym(), LSDAEncoding);
}
/// endFunction - Gather and emit post-function exception information.
diff --git a/llvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp b/llvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp
index 8a040d92aee..14df4c91625 100644
--- a/llvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp
@@ -25,22 +25,10 @@
using namespace llvm;
-EHStreamer::EHStreamer(AsmPrinter *A)
- : CurExceptionSym(nullptr), Asm(A), MMI(Asm->MMI) {}
+EHStreamer::EHStreamer(AsmPrinter *A) : Asm(A), MMI(Asm->MMI) {}
EHStreamer::~EHStreamer() {}
-MCSymbol *EHStreamer::getCurExceptionSym() {
- if (!CurExceptionSym)
- CurExceptionSym = Asm->OutContext.createTempSymbol(
- "exception" + Twine(Asm->getFunctionNumber()));
- return CurExceptionSym;
-}
-
-void EHStreamer::beginFunction(const MachineFunction *MF) {
- CurExceptionSym = nullptr;
-}
-
/// How many leading type ids two landing pads have in common.
unsigned EHStreamer::sharedTypeIDs(const LandingPadInfo *L,
const LandingPadInfo *R) {
@@ -448,11 +436,7 @@ void EHStreamer::emitExceptionTable() {
Asm->OutContext.GetOrCreateSymbol(Twine("GCC_except_table")+
Twine(Asm->getFunctionNumber()));
Asm->OutStreamer.EmitLabel(GCCETSym);
- Asm->OutStreamer.EmitLabel(getCurExceptionSym());
-
- if (IsSJLJ)
- Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("_LSDA_",
- Asm->getFunctionNumber()));
+ Asm->OutStreamer.EmitLabel(Asm->getCurExceptionSym());
// Emit the LSDA header.
Asm->EmitEncodingByte(dwarf::DW_EH_PE_omit, "@LPStart");
diff --git a/llvm/lib/CodeGen/AsmPrinter/EHStreamer.h b/llvm/lib/CodeGen/AsmPrinter/EHStreamer.h
index 8cb7a31a1ad..94d0585347e 100644
--- a/llvm/lib/CodeGen/AsmPrinter/EHStreamer.h
+++ b/llvm/lib/CodeGen/AsmPrinter/EHStreamer.h
@@ -31,8 +31,6 @@ class SmallVectorImpl;
/// Emits exception handling directives.
class EHStreamer : public AsmPrinterHandler {
- MCSymbol *CurExceptionSym;
-
protected:
/// Target of directive emission.
AsmPrinter *Asm;
@@ -127,9 +125,6 @@ public:
EHStreamer(AsmPrinter *A);
virtual ~EHStreamer();
- MCSymbol *getCurExceptionSym();
- void beginFunction(const MachineFunction *MF) override;
-
// Unused.
void setSymbolSize(const MCSymbol *Sym, uint64_t Size) override {}
void beginInstruction(const MachineInstr *MI) override {}
diff --git a/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp b/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp
index abf16f79a42..7d76eaddb56 100644
--- a/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp
@@ -49,8 +49,6 @@ void Win64Exception::endModule() {
}
void Win64Exception::beginFunction(const MachineFunction *MF) {
- EHStreamer::beginFunction(MF);
-
shouldEmitMoves = shouldEmitPersonality = shouldEmitLSDA = false;
// If any landing pads survive, we need an EH table.
diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
index 2544a01fa7f..2c9f32b23fb 100644
--- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
@@ -960,10 +960,7 @@ EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) {
MCSymbol *MCSym;
if (ACPV->isLSDA()) {
- SmallString<128> Str;
- raw_svector_ostream OS(Str);
- OS << DL->getPrivateGlobalPrefix() << "_LSDA_" << getFunctionNumber();
- MCSym = OutContext.GetOrCreateSymbol(OS.str());
+ MCSym = getCurExceptionSym();
} else if (ACPV->isBlockAddress()) {
const BlockAddress *BA =
cast<ARMConstantPoolConstant>(ACPV)->getBlockAddress();
diff --git a/llvm/test/CodeGen/ARM/2009-08-31-LSDA-Name.ll b/llvm/test/CodeGen/ARM/2009-08-31-LSDA-Name.ll
index d6babb6c55d..2f6e428351d 100644
--- a/llvm/test/CodeGen/ARM/2009-08-31-LSDA-Name.ll
+++ b/llvm/test/CodeGen/ARM/2009-08-31-LSDA-Name.ll
@@ -1,7 +1,9 @@
; RUN: llc < %s -mtriple=arm-apple-darwin9 -march=arm | FileCheck %s
-; CHECK: L_LSDA_0:
-
+; CHECK: .cfi_lsda 16, [[LABEL:.*]]
+; CHECK: .long [[LABEL]]-
+; CHECK: [[LABEL]]:
+; CHECK: .byte 255 @ @LPStart Encoding = omit
%struct.A = type { i32* }
OpenPOWER on IntegriCloud