aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DwarfException.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfException.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfException.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfException.cpp b/lib/CodeGen/AsmPrinter/DwarfException.cpp
index 1d773ee53e..7ab0bb0975 100644
--- a/lib/CodeGen/AsmPrinter/DwarfException.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfException.cpp
@@ -56,7 +56,10 @@ void DwarfException::EmitCommonEHFrame(const Function *Personality,
TD->getPointerSize() : -TD->getPointerSize();
// Begin eh frame section.
- Asm->SwitchToSection(Asm->getObjFileLowering().getEHFrameSection());
+ // FIXME: THIS IS A HORRIBLE HACK. MingW isn't specifying an EHFrame section.
+ if (const MCSection *EHFrameSec =
+ Asm->getObjFileLowering().getEHFrameSection())
+ Asm->SwitchToSection(EHFrameSec);
if (TAI->is_EHSymbolPrivate())
O << TAI->getPrivateGlobalPrefix();
@@ -150,8 +153,11 @@ void DwarfException::EmitEHFrame(const FunctionEHFrameInfo &EHFrameInfo) {
const Function *TheFunc = EHFrameInfo.function;
- Asm->SwitchToSection(Asm->getObjFileLowering().getEHFrameSection());
-
+ // FIXME: THIS IS A HORRIBLE HACK. MingW isn't specifying an EHFrame section.
+ if (const MCSection *EHFrameSec =
+ Asm->getObjFileLowering().getEHFrameSection())
+ Asm->SwitchToSection(EHFrameSec);
+
// Externally visible entry into the functions eh frame info. If the
// corresponding function is static, this should not be externally visible.
if (!TheFunc->hasLocalLinkage())