@@ -57,7 +57,7 @@ getCFARegOffsetInfo(const dwarf::UnwindRow &UnwindRow) {
5757static SmallSet<DWARFRegNum, 4 >
5858getUnwindRuleRegSet (const dwarf::UnwindRow &UnwindRow, DWARFRegNum Reg) {
5959 auto MaybeLoc = UnwindRow.getRegisterLocations ().getRegisterLocation (Reg);
60- assert (MaybeLoc && " The register should be included in the unwinding row" );
60+ assert (MaybeLoc && " the register should be included in the unwinding row" );
6161 auto Loc = *MaybeLoc;
6262
6363 switch (Loc.getLocation ()) {
@@ -111,7 +111,7 @@ DWARFCFIAnalysis::DWARFCFIAnalysis(MCContext *Context, MCInstrInfo const &MCII,
111111 assert (MaybeCurrentRow && " there should be at least one row" );
112112 auto MaybeCFA = getCFARegOffsetInfo (*MaybeCurrentRow);
113113 assert (MaybeCFA &&
114- " the CFA information should be describable in [Reg + Offset ] in here" );
114+ " the CFA information should be describable in [reg + offset ] in here" );
115115 auto CFA = *MaybeCFA;
116116
117117 // TODO: CFA register callee value is CFA's value, this should be in initial
@@ -129,8 +129,8 @@ void DWARFCFIAnalysis::update(const MCInst &Inst,
129129 const MCInstrDesc &MCInstInfo = MCII.get (Inst.getOpcode ());
130130
131131 auto MaybePrevRow = State.getCurrentUnwindRow ();
132- assert (MaybePrevRow && " The analysis should have initialized the "
133- " history with at least one row by now" );
132+ assert (MaybePrevRow && " the analysis should have initialized the "
133+ " state with at least one row by now" );
134134 auto PrevRow = *MaybePrevRow;
135135
136136 for (auto &&Directive : Directives)
@@ -157,7 +157,7 @@ void DWARFCFIAnalysis::update(const MCInst &Inst,
157157 }
158158
159159 auto MaybeNextRow = State.getCurrentUnwindRow ();
160- assert (MaybeNextRow && " Prev row existed, so should the current row. " );
160+ assert (MaybeNextRow && " previous row existed, so should the current row" );
161161 auto NextRow = *MaybeNextRow;
162162
163163 checkCFADiff (Inst, PrevRow, NextRow, Reads, Writes);
@@ -211,7 +211,7 @@ void DWARFCFIAnalysis::checkRegDiff(const MCInst &Inst, DWARFRegNum Reg,
211211 for (DWARFRegNum UsedReg : getUnwindRuleRegSet (PrevRow, Reg))
212212 if (Writes.count (UsedReg)) { // Case 1.b
213213 auto MaybeLLVMUsedReg = MCRI->getLLVMRegNum (UsedReg, IsEH);
214- assert (MaybeLLVMUsedReg && " Instructions will always write to a "
214+ assert (MaybeLLVMUsedReg && " instructions will always write to a "
215215 " register that has an LLVM register number" );
216216 Context->reportError (
217217 Inst.getLoc (),
@@ -224,18 +224,20 @@ void DWARFCFIAnalysis::checkRegDiff(const MCInst &Inst, DWARFRegNum Reg,
224224 }
225225 // Case 2
226226 if (PrevLoc.getLocation () != NextLoc.getLocation ()) { // Case 2.a
227- Context->reportWarning (Inst.getLoc (),
228- formatv (" uncheckable change happened to register "
229- " {0} unwinding rule structure" ,
230- RegName));
227+ Context->reportWarning (
228+ Inst.getLoc (),
229+ formatv (" validating changes happening to register {0} unwinding "
230+ " rule structure is not implemented yet" ,
231+ RegName));
231232 return ;
232233 }
233234 auto &&PrevRegSet = getUnwindRuleRegSet (PrevRow, Reg);
234235 if (PrevRegSet != getUnwindRuleRegSet (NextRow, Reg)) { // Case 2.b
235236 Context->reportWarning (
236- Inst.getLoc (), formatv (" uncheckable change happened to register {0} "
237- " unwinding rule register set" ,
238- RegName));
237+ Inst.getLoc (),
238+ formatv (" validating changes happening to register {0} unwinding "
239+ " rule register set is not implemented yet" ,
240+ RegName));
239241 return ;
240242 }
241243 // Case 2.c
@@ -244,7 +246,8 @@ void DWARFCFIAnalysis::checkRegDiff(const MCInst &Inst, DWARFRegNum Reg,
244246 Context->reportWarning (
245247 Inst.getLoc (),
246248 formatv (" register {0} unwinding rule's offset is changed, and one of "
247- " the rule's registers is modified by an unknown amount" ,
249+ " the rule's registers is modified, but validating the "
250+ " modification amount is not implemented yet" ,
248251 RegName));
249252 return ;
250253 }
@@ -308,15 +311,17 @@ void DWARFCFIAnalysis::checkCFADiff(const MCInst &Inst,
308311 if (PrevCFA.Reg != NextCFA.Reg ) { // Case 2.b
309312 Context->reportWarning (
310313 Inst.getLoc (),
311- formatv (" CFA register changed from register {0} to register {1}" ,
314+ formatv (" CFA register changed from register {0} to register {1}, "
315+ " validating this change is not implemented yet" ,
312316 PrevCFARegName, NextCFARegName));
313317 return ;
314318 }
315319 // Case 2.c
316320 if (Writes.count (PrevCFA.Reg )) { // Case 2.c.i
317321 Context->reportWarning (
318- Inst.getLoc (), formatv (" CFA offset is changed from {0} to {1}, CFA "
319- " register {2} is changed by an unknown amount" ,
322+ Inst.getLoc (), formatv (" CFA offset is changed from {0} to {1}, and CFA "
323+ " register {2} is modified, but validating the "
324+ " modification amount is not implemented yet" ,
320325 PrevCFA.Offset , NextCFA.Offset , PrevCFARegName));
321326 return ;
322327 }
0 commit comments