forked from OSchip/llvm-project
MC: account for the return column in the CIE key
If the return column is different, we cannot coalesce the CIE across the FDEs. Add that to the key calculation. This ensures that we emit a separate CIE. llvm-svn: 309492
This commit is contained in:
parent
cf9a813368
commit
fc85067f30
|
@ -1465,24 +1465,26 @@ namespace {
|
||||||
|
|
||||||
struct CIEKey {
|
struct CIEKey {
|
||||||
static const CIEKey getEmptyKey() {
|
static const CIEKey getEmptyKey() {
|
||||||
return CIEKey(nullptr, 0, -1, false, false);
|
return CIEKey(nullptr, 0, -1, false, false, static_cast<unsigned>(INT_MAX));
|
||||||
}
|
}
|
||||||
|
|
||||||
static const CIEKey getTombstoneKey() {
|
static const CIEKey getTombstoneKey() {
|
||||||
return CIEKey(nullptr, -1, 0, false, false);
|
return CIEKey(nullptr, -1, 0, false, false, static_cast<unsigned>(INT_MAX));
|
||||||
}
|
}
|
||||||
|
|
||||||
CIEKey(const MCSymbol *Personality, unsigned PersonalityEncoding,
|
CIEKey(const MCSymbol *Personality, unsigned PersonalityEncoding,
|
||||||
unsigned LsdaEncoding, bool IsSignalFrame, bool IsSimple)
|
unsigned LsdaEncoding, bool IsSignalFrame, bool IsSimple,
|
||||||
|
unsigned RAReg)
|
||||||
: Personality(Personality), PersonalityEncoding(PersonalityEncoding),
|
: Personality(Personality), PersonalityEncoding(PersonalityEncoding),
|
||||||
LsdaEncoding(LsdaEncoding), IsSignalFrame(IsSignalFrame),
|
LsdaEncoding(LsdaEncoding), IsSignalFrame(IsSignalFrame),
|
||||||
IsSimple(IsSimple) {}
|
IsSimple(IsSimple), RAReg(RAReg) {}
|
||||||
|
|
||||||
const MCSymbol *Personality;
|
const MCSymbol *Personality;
|
||||||
unsigned PersonalityEncoding;
|
unsigned PersonalityEncoding;
|
||||||
unsigned LsdaEncoding;
|
unsigned LsdaEncoding;
|
||||||
bool IsSignalFrame;
|
bool IsSignalFrame;
|
||||||
bool IsSimple;
|
bool IsSimple;
|
||||||
|
unsigned RAReg;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end anonymous namespace
|
} // end anonymous namespace
|
||||||
|
@ -1496,7 +1498,7 @@ template <> struct DenseMapInfo<CIEKey> {
|
||||||
static unsigned getHashValue(const CIEKey &Key) {
|
static unsigned getHashValue(const CIEKey &Key) {
|
||||||
return static_cast<unsigned>(
|
return static_cast<unsigned>(
|
||||||
hash_combine(Key.Personality, Key.PersonalityEncoding, Key.LsdaEncoding,
|
hash_combine(Key.Personality, Key.PersonalityEncoding, Key.LsdaEncoding,
|
||||||
Key.IsSignalFrame, Key.IsSimple));
|
Key.IsSignalFrame, Key.IsSimple, Key.RAReg));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool isEqual(const CIEKey &LHS, const CIEKey &RHS) {
|
static bool isEqual(const CIEKey &LHS, const CIEKey &RHS) {
|
||||||
|
@ -1504,7 +1506,8 @@ template <> struct DenseMapInfo<CIEKey> {
|
||||||
LHS.PersonalityEncoding == RHS.PersonalityEncoding &&
|
LHS.PersonalityEncoding == RHS.PersonalityEncoding &&
|
||||||
LHS.LsdaEncoding == RHS.LsdaEncoding &&
|
LHS.LsdaEncoding == RHS.LsdaEncoding &&
|
||||||
LHS.IsSignalFrame == RHS.IsSignalFrame &&
|
LHS.IsSignalFrame == RHS.IsSignalFrame &&
|
||||||
LHS.IsSimple == RHS.IsSimple;
|
LHS.IsSimple == RHS.IsSimple &&
|
||||||
|
LHS.RAReg == RHS.RAReg;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1561,8 +1564,8 @@ void MCDwarfFrameEmitter::Emit(MCObjectStreamer &Streamer, MCAsmBackend *MAB,
|
||||||
// of by the compact unwind encoding.
|
// of by the compact unwind encoding.
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
CIEKey Key(Frame.Personality, Frame.PersonalityEncoding,
|
CIEKey Key(Frame.Personality, Frame.PersonalityEncoding, Frame.LsdaEncoding,
|
||||||
Frame.LsdaEncoding, Frame.IsSignalFrame, Frame.IsSimple);
|
Frame.IsSignalFrame, Frame.IsSimple, Frame.RAReg);
|
||||||
const MCSymbol *&CIEStart = IsEH ? CIEStarts[Key] : DummyDebugKey;
|
const MCSymbol *&CIEStart = IsEH ? CIEStarts[Key] : DummyDebugKey;
|
||||||
if (!CIEStart)
|
if (!CIEStart)
|
||||||
CIEStart = &Emitter.EmitCIE(
|
CIEStart = &Emitter.EmitCIE(
|
||||||
|
|
|
@ -4,15 +4,28 @@
|
||||||
|
|
||||||
.text
|
.text
|
||||||
|
|
||||||
proc:
|
.section .text.f,"ax",@progbits
|
||||||
|
.global f
|
||||||
|
.type f,@function
|
||||||
|
f:
|
||||||
.cfi_startproc
|
.cfi_startproc
|
||||||
.cfi_return_column 0
|
.cfi_return_column 0
|
||||||
.cfi_endproc
|
.cfi_endproc
|
||||||
|
|
||||||
|
.section .text.g,"ax",@progbits
|
||||||
|
.global g
|
||||||
|
.type g,@function
|
||||||
|
g:
|
||||||
|
.cfi_startproc
|
||||||
|
.cfi_return_column 65
|
||||||
|
.cfi_endproc
|
||||||
|
|
||||||
|
// CHECK-ASM-ROUNDTRIP-LABEL: f:
|
||||||
// CHECK-ASM-ROUNDTRIP: .cfi_startproc
|
// CHECK-ASM-ROUNDTRIP: .cfi_startproc
|
||||||
// CHECK-ASM-ROUNDTRIP-NEXT: .cfi_return_column 0
|
// CHECK-ASM-ROUNDTRIP-NEXT: .cfi_return_column 0
|
||||||
// CHECK-ASM-ROUNDTRIP: .cfi_endproc
|
// CHECK-ASM-ROUNDTRIP: .cfi_endproc
|
||||||
|
|
||||||
// CHECK-EH_FRAME: Contents of section .eh_frame:
|
// CHECK-EH_FRAME: Contents of section .eh_frame:
|
||||||
// CHECK-EH_FRAME: 0000 14000000 00000000 017a5200 017c0001 .........zR..|..
|
// CHECK-EH_FRAME: 0000 14000000 00000000 017a5200 017c0001 .........zR..|..
|
||||||
|
// CHECK-EH_FRAME: 0030 00000000 017a5200 017c4101 1b0c0404 .....zR..|A.....
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue