[llvm-commits] [llvm] r130375 - in /llvm/trunk: include/llvm/Target/TargetAsmInfo.h lib/MC/MCDwarf.cpp

Rafael Espindola rafael.espindola at gmail.com
Wed Apr 27 19:46:42 PDT 2011


Author: rafael
Date: Wed Apr 27 21:46:42 2011
New Revision: 130375

URL: http://llvm.org/viewvc/llvm-project?rev=130375&view=rev
Log:
Forward isFunctionEHFrameSymbolPrivate. If it is false, produce the foo.eh
symbols.

Modified:
    llvm/trunk/include/llvm/Target/TargetAsmInfo.h
    llvm/trunk/lib/MC/MCDwarf.cpp

Modified: llvm/trunk/include/llvm/Target/TargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetAsmInfo.h?rev=130375&r1=130374&r2=130375&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetAsmInfo.h Wed Apr 27 21:46:42 2011
@@ -62,6 +62,10 @@
     return TLOF->getFDEEncoding();
   }
 
+  bool isFunctionEHFrameSymbolPrivate() const {
+    return TLOF->isFunctionEHFrameSymbolPrivate();
+  }
+
   unsigned getDwarfRARegNum(bool isEH) const {
     return TRI->getDwarfRegNum(TRI->getRARegister(), isEH);
   }

Modified: llvm/trunk/lib/MC/MCDwarf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDwarf.cpp?rev=130375&r1=130374&r2=130375&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCDwarf.cpp (original)
+++ llvm/trunk/lib/MC/MCDwarf.cpp Wed Apr 27 21:46:42 2011
@@ -17,6 +17,7 @@
 #include "llvm/MC/MCContext.h"
 #include "llvm/MC/MCObjectWriter.h"
 #include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/Twine.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/raw_ostream.h"
@@ -713,6 +714,12 @@
   MCSymbol *fdeEnd = context.CreateTempSymbol();
   const TargetAsmInfo &asmInfo = context.getTargetAsmInfo();
 
+  if (!asmInfo.isFunctionEHFrameSymbolPrivate()) {
+    Twine EHName = frame.Function->getName() + Twine(".eh");
+    MCSymbol *EHSym = context.GetOrCreateSymbol(EHName);
+    streamer.EmitLabel(EHSym);
+  }
+
   // Length
   const MCExpr *Length = MakeStartMinusEndExpr(streamer, *fdeStart, *fdeEnd, 0);
   streamer.EmitAbsValue(Length, 4);





More information about the llvm-commits mailing list