Skip to content

Commit 3c0f871

Browse files
committed
[X86][fold-table] Add an assertion in addEntryWithFlags, NFCI
1 parent ced0f28 commit 3c0f871

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

llvm/utils/TableGen/X86FoldTablesEmitter.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class X86FoldTablesEmitter {
171171
// the appropriate flags - then adds it to Table.
172172
void addEntryWithFlags(FoldTable &Table, const CodeGenInstruction *RegInst,
173173
const CodeGenInstruction *MemInst, uint16_t S,
174-
unsigned FoldedIdx, bool isManual);
174+
unsigned FoldedIdx, bool IsManual);
175175

176176
// Print the given table as a static const C++ array of type
177177
// X86FoldTableEntry.
@@ -391,8 +391,10 @@ void X86FoldTablesEmitter::addEntryWithFlags(FoldTable &Table,
391391
const CodeGenInstruction *RegInst,
392392
const CodeGenInstruction *MemInst,
393393
uint16_t S, unsigned FoldedIdx,
394-
bool isManual) {
394+
bool IsManual) {
395395

396+
assert((IsManual || Table.find(RegInst) == Table.end()) &&
397+
"Override entry unexpectedly");
396398
X86FoldTableEntry Result = X86FoldTableEntry(RegInst, MemInst);
397399
Record *RegRec = RegInst->TheDef;
398400
Record *MemRec = MemInst->TheDef;
@@ -402,7 +404,7 @@ void X86FoldTablesEmitter::addEntryWithFlags(FoldTable &Table,
402404
Result.FoldLoad = S & TB_FOLDED_LOAD;
403405
Result.FoldStore = S & TB_FOLDED_STORE;
404406
Result.Alignment = Align(1ULL << ((S & TB_ALIGN_MASK) >> TB_ALIGN_SHIFT));
405-
if (isManual) {
407+
if (IsManual) {
406408
Table[RegInst] = Result;
407409
return;
408410
}

0 commit comments

Comments
 (0)