[PATCH] D118326: [RISCV] Use const reference when looping over Exts in RISCVISAInfo.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 27 09:24:39 PST 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG886dd1179572: [RISCV] Use const reference when looping over Exts in RISCVISAInfo. (authored by craig.topper).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118326/new/
https://reviews.llvm.org/D118326
Files:
llvm/lib/Support/RISCVISAInfo.cpp
Index: llvm/lib/Support/RISCVISAInfo.cpp
===================================================================
--- llvm/lib/Support/RISCVISAInfo.cpp
+++ llvm/lib/Support/RISCVISAInfo.cpp
@@ -308,7 +308,7 @@
void RISCVISAInfo::toFeatures(
std::vector<StringRef> &Features,
std::function<StringRef(const Twine &)> StrAlloc) const {
- for (auto &Ext : Exts) {
+ for (auto const &Ext : Exts) {
StringRef ExtName = Ext.first;
if (ExtName == "i")
@@ -825,7 +825,7 @@
// This loop may execute over 1 iteration since implication can be layered
// Exits loop if no more implication is applied
SmallSetVector<StringRef, 16> WorkList;
- for (auto &Ext : Exts)
+ for (auto const &Ext : Exts)
WorkList.insert(Ext.first);
while (!WorkList.empty()) {
@@ -855,7 +855,7 @@
}
void RISCVISAInfo::updateMinVLen() {
- for (auto Ext : Exts) {
+ for (auto const &Ext : Exts) {
StringRef ExtName = Ext.first;
bool IsZvlExt = ExtName.consume_front("zvl") && ExtName.consume_back("b");
if (IsZvlExt) {
@@ -868,7 +868,7 @@
void RISCVISAInfo::updateMaxELen() {
// handles EEW restriction by sub-extension zve
- for (auto Ext : Exts) {
+ for (auto const &Ext : Exts) {
StringRef ExtName = Ext.first;
bool IsZveExt = ExtName.consume_front("zve");
if (IsZveExt) {
@@ -896,7 +896,7 @@
Arch << "rv" << XLen;
ListSeparator LS("_");
- for (auto &Ext : Exts) {
+ for (auto const &Ext : Exts) {
StringRef ExtName = Ext.first;
auto ExtInfo = Ext.second;
Arch << LS << ExtName;
@@ -908,7 +908,7 @@
std::vector<std::string> RISCVISAInfo::toFeatureVector() const {
std::vector<std::string> FeatureVector;
- for (auto Ext : Exts) {
+ for (auto const &Ext : Exts) {
std::string ExtName = Ext.first;
if (ExtName == "i") // i is not recognized in clang -cc1
continue;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118326.403700.patch
Type: text/x-patch
Size: 1861 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220127/174e4ff6/attachment.bin>
More information about the llvm-commits
mailing list