Skip to content

Commit 66dd38e

Browse files
committed
[RISCV] Use references to avoid unnecessary struct copies. NFC
1 parent 417324a commit 66dd38e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2716,7 +2716,7 @@ ParseStatus RISCVAsmParser::parseDirective(AsmToken DirectiveID) {
27162716

27172717
bool RISCVAsmParser::resetToArch(StringRef Arch, SMLoc Loc, std::string &Result,
27182718
bool FromOptionDirective) {
2719-
for (auto Feature : RISCVFeatureKV)
2719+
for (auto &Feature : RISCVFeatureKV)
27202720
if (llvm::RISCVISAInfo::isSupportedExtensionFeature(Feature.Key))
27212721
clearFeatureBits(Feature.Value, Feature.Key);
27222722

@@ -2735,7 +2735,7 @@ bool RISCVAsmParser::resetToArch(StringRef Arch, SMLoc Loc, std::string &Result,
27352735
}
27362736
auto &ISAInfo = *ParseResult;
27372737

2738-
for (auto Feature : RISCVFeatureKV)
2738+
for (auto &Feature : RISCVFeatureKV)
27392739
if (ISAInfo->hasExtension(Feature.Key))
27402740
setFeatureBits(Feature.Value, Feature.Key);
27412741

@@ -2857,7 +2857,7 @@ bool RISCVAsmParser::parseDirectiveOption() {
28572857
// It is invalid to disable an extension that there are other enabled
28582858
// extensions depend on it.
28592859
// TODO: Make use of RISCVISAInfo to handle this
2860-
for (auto Feature : RISCVFeatureKV) {
2860+
for (auto &Feature : RISCVFeatureKV) {
28612861
if (getSTI().hasFeature(Feature.Value) &&
28622862
Feature.Implies.test(Ext->Value))
28632863
return Error(Loc,

0 commit comments

Comments
 (0)