From d2ef63ca764aebb647747e9c0bfe7a797798aa16 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 28 Apr 2011 02:46:42 +0000 Subject: [PATCH] Forward isFunctionEHFrameSymbolPrivate. If it is false, produce the foo.eh symbols. llvm-svn: 130375 --- include/llvm/Target/TargetAsmInfo.h | 4 ++++ lib/MC/MCDwarf.cpp | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/include/llvm/Target/TargetAsmInfo.h b/include/llvm/Target/TargetAsmInfo.h index 478c453add1..f469cbb02c5 100644 --- a/include/llvm/Target/TargetAsmInfo.h +++ b/include/llvm/Target/TargetAsmInfo.h @@ -62,6 +62,10 @@ public: return TLOF->getFDEEncoding(); } + bool isFunctionEHFrameSymbolPrivate() const { + return TLOF->isFunctionEHFrameSymbolPrivate(); + } + unsigned getDwarfRARegNum(bool isEH) const { return TRI->getDwarfRegNum(TRI->getRARegister(), isEH); } diff --git a/lib/MC/MCDwarf.cpp b/lib/MC/MCDwarf.cpp index 566c090feba..ec2bcf85edb 100644 --- a/lib/MC/MCDwarf.cpp +++ b/lib/MC/MCDwarf.cpp @@ -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 *FrameEmitterImpl::EmitFDE(MCStreamer &streamer, 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);