Skip to content

Commit 10a84ff

Browse files
author
Amirhossein Pashaeehir
committed
Sort fields by size for memory layout and move them to the end of the class definition
1 parent f080e0d commit 10a84ff

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

llvm/include/llvm/DWARFCFIChecker/DWARFCFIAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ class DWARFCFIAnalysis {
8585
const SmallSet<DWARFRegNum, 4> &Writes);
8686

8787
private:
88+
DWARFCFIState State;
8889
MCContext *Context;
8990
MCInstrInfo const &MCII;
9091
MCRegisterInfo const *MCRI;
91-
DWARFCFIState State;
9292
bool IsEH;
9393
};
9494

llvm/include/llvm/DWARFCFIChecker/DWARFCFIFunctionFrameAnalyzer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ namespace llvm {
2727
/// finishes without being started or if all the frames are not finished before
2828
/// this classes is destructured, the program fails through an assertion.
2929
class CFIFunctionFrameAnalyzer : public CFIFunctionFrameReceiver {
30-
private:
31-
std::vector<DWARFCFIAnalysis> UIAs;
32-
MCInstrInfo const &MCII;
33-
3430
public:
3531
CFIFunctionFrameAnalyzer(MCContext &Context, const MCInstrInfo &MCII)
3632
: CFIFunctionFrameReceiver(Context), MCII(MCII) {}
@@ -42,6 +38,10 @@ class CFIFunctionFrameAnalyzer : public CFIFunctionFrameReceiver {
4238
emitInstructionAndDirectives(const MCInst &Inst,
4339
ArrayRef<MCCFIInstruction> Directives) override;
4440
void finishFunctionFrame() override;
41+
42+
private:
43+
MCInstrInfo const &MCII;
44+
std::vector<DWARFCFIAnalysis> UIAs;
4545
};
4646

4747
} // namespace llvm

llvm/include/llvm/DWARFCFIChecker/DWARFCFIFunctionFrameReceiver.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ class MCInst;
2727
/// function frames information gathered from an `MCStreamer` using a pointer to
2828
/// an instance of this class for the whole program.
2929
class CFIFunctionFrameReceiver {
30-
private:
31-
MCContext &Context;
32-
3330
public:
3431
CFIFunctionFrameReceiver(const CFIFunctionFrameReceiver &) = delete;
3532
CFIFunctionFrameReceiver &
@@ -47,6 +44,9 @@ class CFIFunctionFrameReceiver {
4744
emitInstructionAndDirectives(const MCInst &Inst,
4845
ArrayRef<MCCFIInstruction> Directives) {}
4946
virtual void finishFunctionFrame() {}
47+
48+
private:
49+
MCContext &Context;
5050
};
5151

5252
} // namespace llvm

llvm/include/llvm/DWARFCFIChecker/DWARFCFIFunctionFrameStreamer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ namespace llvm {
3030
/// instructions and CFI directives that are between `.cfi_startproc` and
3131
/// `.cfi_endproc` directives.
3232
class CFIFunctionFrameStreamer : public MCStreamer {
33-
private:
34-
std::pair<unsigned, unsigned> updateDirectivesRange();
35-
void updateReceiver();
36-
3733
public:
3834
CFIFunctionFrameStreamer(MCContext &Context,
3935
std::unique_ptr<CFIFunctionFrameReceiver> Receiver)
@@ -64,6 +60,10 @@ class CFIFunctionFrameStreamer : public MCStreamer {
6460
void emitCFIStartProcImpl(MCDwarfFrameInfo &Frame) override;
6561
void emitCFIEndProcImpl(MCDwarfFrameInfo &CurFrame) override;
6662

63+
private:
64+
std::pair<unsigned, unsigned> updateDirectivesRange();
65+
void updateReceiver();
66+
6767
private:
6868
std::vector<unsigned> FrameIndices;
6969
std::optional<MCInst> LastInstruction;

llvm/include/llvm/DWARFCFIChecker/DWARFCFIState.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ class DWARFCFIState {
3737
/// to the user, and the directive is ignored, leaving the state unchanged.
3838
void update(const MCCFIInstruction &Directive);
3939

40+
private:
41+
dwarf::CFIProgram convert(MCCFIInstruction Directive);
42+
4043
private:
4144
dwarf::UnwindRow Row;
4245
MCContext *Context;
4346
bool IsInitiated;
44-
45-
dwarf::CFIProgram convert(MCCFIInstruction Directive);
4647
};
4748

4849
} // namespace llvm

llvm/lib/DWARFCFIChecker/DWARFCFIAnalysis.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ getUnwindRuleRegSet(const dwarf::UnwindRow &UnwindRow, DWARFRegNum Reg) {
8383
DWARFCFIAnalysis::DWARFCFIAnalysis(MCContext *Context, MCInstrInfo const &MCII,
8484
bool IsEH,
8585
ArrayRef<MCCFIInstruction> Prologue)
86-
: Context(Context), MCII(MCII), MCRI(Context->getRegisterInfo()),
87-
State(Context), IsEH(IsEH) {
86+
: State(Context), Context(Context), MCII(MCII),
87+
MCRI(Context->getRegisterInfo()), IsEH(IsEH) {
8888

8989
for (auto LLVMReg : getTrackingRegs(MCRI)) {
9090
if (MCRI->get(LLVMReg).IsArtificial || MCRI->get(LLVMReg).IsConstant)

0 commit comments

Comments
 (0)