The last hack for producing bit identical output with cfi on OS X.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 29 Apr 2011 15:09:53 +0000 (15:09 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 29 Apr 2011 15:09:53 +0000 (15:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130504 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfCFIException.cpp

index 7676ef8355a687430fbe9819b58f68d7eb8d81f2..49680ad308923d16e622b8d2a7cdb76afa8e8baa 100644 (file)
@@ -53,6 +53,14 @@ void DwarfCFIException::EndModule() {
     return;
 
   const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
+
+  if (!TLOF.isFunctionEHFrameSymbolPrivate()) {
+    // This is a temporary hack to keep sections in the same order they
+    // were before. This lets us produce bit identical outputs while
+    // transitioning to CFI.
+    Asm->OutStreamer.SwitchSection(TLOF.getEHFrameSection());
+  }
+
   unsigned PerEncoding = TLOF.getPersonalityEncoding();
 
   if ((PerEncoding & 0x70) != dwarf::DW_EH_PE_pcrel)