forked from OSchip/llvm-project
[RISCV] Use std::map::count != 0 instead of std::map::count == 1. NFC
Maps always return 0 or 1 for count. Comparing to 0 can create simpler compiled code. Someday we'll get to use std::map::contains.
This commit is contained in:
parent
f44e41af41
commit
39057240f5
|
@ -699,13 +699,13 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension,
|
|||
|
||||
Error RISCVISAInfo::checkDependency() {
|
||||
bool IsRv32 = XLen == 32;
|
||||
bool HasE = Exts.count("e") == 1;
|
||||
bool HasD = Exts.count("d") == 1;
|
||||
bool HasF = Exts.count("f") == 1;
|
||||
bool HasZve32x = Exts.count("zve32x") == 1;
|
||||
bool HasZve32f = Exts.count("zve32f") == 1;
|
||||
bool HasZve64d = Exts.count("zve64d") == 1;
|
||||
bool HasV = Exts.count("v") == 1;
|
||||
bool HasE = Exts.count("e") != 0;
|
||||
bool HasD = Exts.count("d") != 0;
|
||||
bool HasF = Exts.count("f") != 0;
|
||||
bool HasZve32x = Exts.count("zve32x") != 0;
|
||||
bool HasZve32f = Exts.count("zve32f") != 0;
|
||||
bool HasZve64d = Exts.count("zve64d") != 0;
|
||||
bool HasV = Exts.count("v") != 0;
|
||||
bool HasVector = HasZve32x || HasV;
|
||||
bool HasZvl = MinVLen != 0;
|
||||
|
||||
|
@ -810,8 +810,8 @@ static constexpr ImpliedExtsEntry ImpliedExts[] = {
|
|||
};
|
||||
|
||||
void RISCVISAInfo::updateImplication() {
|
||||
bool HasE = Exts.count("e") == 1;
|
||||
bool HasI = Exts.count("i") == 1;
|
||||
bool HasE = Exts.count("e") != 0;
|
||||
bool HasI = Exts.count("i") != 0;
|
||||
|
||||
// If not in e extension and i extension does not exist, i extension is
|
||||
// implied
|
||||
|
|
Loading…
Reference in New Issue