aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-18 06:13:03 +0000
committerChris Lattner <sabre@nondot.org>2009-08-18 06:13:03 +0000
commit6a66e585b8242b9764ec3343309697d24bb1e312 (patch)
tree6e5b63e1a4f832178a7afd1d28514c3efd91ee8b /lib/CodeGen
parent40cce094a3456800dd0588229cfee636007cf78c (diff)
downloadexternal_llvm-6a66e585b8242b9764ec3343309697d24bb1e312.zip
external_llvm-6a66e585b8242b9764ec3343309697d24bb1e312.tar.gz
external_llvm-6a66e585b8242b9764ec3343309697d24bb1e312.tar.bz2
add a horrible hack to the dwarf printer. It looks like mingw is not specifying
an EHFrame section, so we just emit ehframe data into a random section. This is clearly bad. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79323 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-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 1d773ee..7ab0bb0 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())