Skip to content

Commit 4f5fb36

Browse files
authored
[RISCV] Use an enum class for AVL state ins RISCVInsertVSETVLI. NFC (#169455)
1 parent 9007b36 commit 4f5fb36

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -519,13 +519,13 @@ class VSETVLIInfo {
519519
unsigned AVLImm;
520520
};
521521

522-
enum : uint8_t {
522+
enum class AVLState : uint8_t {
523523
Uninitialized,
524524
AVLIsReg,
525525
AVLIsImm,
526526
AVLIsVLMAX,
527527
Unknown, // AVL and VTYPE are fully unknown
528-
} State = Uninitialized;
528+
} State = AVLState::Uninitialized;
529529

530530
// Fields from VTYPE.
531531
RISCVVType::VLMUL VLMul = RISCVVType::LMUL_1;
@@ -547,27 +547,27 @@ class VSETVLIInfo {
547547
return Info;
548548
}
549549

550-
bool isValid() const { return State != Uninitialized; }
551-
void setUnknown() { State = Unknown; }
552-
bool isUnknown() const { return State == Unknown; }
550+
bool isValid() const { return State != AVLState::Uninitialized; }
551+
void setUnknown() { State = AVLState::Unknown; }
552+
bool isUnknown() const { return State == AVLState::Unknown; }
553553

554554
void setAVLRegDef(const VNInfo *VNInfo, Register AVLReg) {
555555
assert(AVLReg.isVirtual());
556556
AVLRegDef.ValNo = VNInfo;
557557
AVLRegDef.DefReg = AVLReg;
558-
State = AVLIsReg;
558+
State = AVLState::AVLIsReg;
559559
}
560560

561561
void setAVLImm(unsigned Imm) {
562562
AVLImm = Imm;
563-
State = AVLIsImm;
563+
State = AVLState::AVLIsImm;
564564
}
565565

566-
void setAVLVLMAX() { State = AVLIsVLMAX; }
566+
void setAVLVLMAX() { State = AVLState::AVLIsVLMAX; }
567567

568-
bool hasAVLImm() const { return State == AVLIsImm; }
569-
bool hasAVLReg() const { return State == AVLIsReg; }
570-
bool hasAVLVLMAX() const { return State == AVLIsVLMAX; }
568+
bool hasAVLImm() const { return State == AVLState::AVLIsImm; }
569+
bool hasAVLReg() const { return State == AVLState::AVLIsReg; }
570+
bool hasAVLVLMAX() const { return State == AVLState::AVLIsVLMAX; }
571571
Register getAVLReg() const {
572572
assert(hasAVLReg() && AVLRegDef.DefReg.isVirtual());
573573
return AVLRegDef.DefReg;
@@ -839,19 +839,19 @@ class VSETVLIInfo {
839839
void print(raw_ostream &OS) const {
840840
OS << "{";
841841
switch (State) {
842-
case Uninitialized:
842+
case AVLState::Uninitialized:
843843
OS << "Uninitialized";
844844
break;
845-
case Unknown:
845+
case AVLState::Unknown:
846846
OS << "unknown";
847847
break;
848-
case AVLIsReg:
848+
case AVLState::AVLIsReg:
849849
OS << "AVLReg=" << llvm::printReg(getAVLReg());
850850
break;
851-
case AVLIsImm:
851+
case AVLState::AVLIsImm:
852852
OS << "AVLImm=" << (unsigned)AVLImm;
853853
break;
854-
case AVLIsVLMAX:
854+
case AVLState::AVLIsVLMAX:
855855
OS << "AVLVLMAX";
856856
break;
857857
}

0 commit comments

Comments
 (0)