[llvm-commits] [llvm] r131067 - in /llvm/trunk: include/llvm/MC/MCDwarf.h lib/MC/MCAssembler.cpp lib/MC/MCDwarf.cpp
Rafael Espindola
rafael.espindola at gmail.com
Sun May 8 07:35:21 PDT 2011
Author: rafael
Date: Sun May 8 09:35:21 2011
New Revision: 131067
URL: http://llvm.org/viewvc/llvm-project?rev=131067&view=rev
Log:
Don't force relaxation of AdvanceLoc instructions on OS X. gdb is happy with
the smaller encoding and this cuts 270336 bytes from a release version of
clang and 1246272 bytes from a debug build.
Modified:
llvm/trunk/include/llvm/MC/MCDwarf.h
llvm/trunk/lib/MC/MCAssembler.cpp
llvm/trunk/lib/MC/MCDwarf.cpp
Modified: llvm/trunk/include/llvm/MC/MCDwarf.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCDwarf.h?rev=131067&r1=131066&r2=131067&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCDwarf.h (original)
+++ llvm/trunk/include/llvm/MC/MCDwarf.h Sun May 8 09:35:21 2011
@@ -283,8 +283,7 @@
//
static void Emit(MCStreamer &streamer, bool usingCFI);
static void EmitAdvanceLoc(MCStreamer &Streamer, uint64_t AddrDelta);
- static void EncodeAdvanceLoc(uint64_t AddrDelta, raw_ostream &OS,
- const TargetAsmInfo &AsmInfo);
+ static void EncodeAdvanceLoc(uint64_t AddrDelta, raw_ostream &OS);
};
} // end namespace llvm
Modified: llvm/trunk/lib/MC/MCAssembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=131067&r1=131066&r2=131067&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAssembler.cpp (original)
+++ llvm/trunk/lib/MC/MCAssembler.cpp Sun May 8 09:35:21 2011
@@ -759,8 +759,7 @@
SmallString<8> &Data = DF.getContents();
Data.clear();
raw_svector_ostream OSE(Data);
- const TargetAsmInfo &AsmInfo = getContext().getTargetAsmInfo();
- MCDwarfFrameEmitter::EncodeAdvanceLoc(AddrDelta, OSE, AsmInfo);
+ MCDwarfFrameEmitter::EncodeAdvanceLoc(AddrDelta, OSE);
OSE.flush();
return OldSize != Data.size();
}
Modified: llvm/trunk/lib/MC/MCDwarf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDwarf.cpp?rev=131067&r1=131066&r2=131067&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCDwarf.cpp (original)
+++ llvm/trunk/lib/MC/MCDwarf.cpp Sun May 8 09:35:21 2011
@@ -868,27 +868,21 @@
SmallString<256> Tmp;
raw_svector_ostream OS(Tmp);
const TargetAsmInfo &AsmInfo = Streamer.getContext().getTargetAsmInfo();
- MCDwarfFrameEmitter::EncodeAdvanceLoc(AddrDelta, OS, AsmInfo);
+ MCDwarfFrameEmitter::EncodeAdvanceLoc(AddrDelta, OS);
Streamer.EmitBytes(OS.str(), /*AddrSpace=*/0);
}
void MCDwarfFrameEmitter::EncodeAdvanceLoc(uint64_t AddrDelta,
- raw_ostream &OS,
- const TargetAsmInfo &AsmInfo) {
- // This is a small hack to facilitate the transition to CFI on OS X. It
- // relaxes all address advances which lets us produces identical output
- // to the one produce by CodeGen.
- const bool Relax = !AsmInfo.isFunctionEHFrameSymbolPrivate();
-
+ raw_ostream &OS) {
// FIXME: Assumes the code alignment factor is 1.
if (AddrDelta == 0) {
- } else if (isUIntN(6, AddrDelta) && !Relax) {
+ } else if (isUIntN(6, AddrDelta)) {
uint8_t Opcode = dwarf::DW_CFA_advance_loc | AddrDelta;
OS << Opcode;
- } else if (isUInt<8>(AddrDelta) && !Relax) {
+ } else if (isUInt<8>(AddrDelta)) {
OS << uint8_t(dwarf::DW_CFA_advance_loc1);
OS << uint8_t(AddrDelta);
- } else if (isUInt<16>(AddrDelta) && !Relax) {
+ } else if (isUInt<16>(AddrDelta)) {
// FIXME: check what is the correct behavior on a big endian machine.
OS << uint8_t(dwarf::DW_CFA_advance_loc2);
OS << uint8_t( AddrDelta & 0xff);
More information about the llvm-commits
mailing list