[PATCH] D118334: [NFC][RISCV] Bundle up ISAInfo updates and checks
Yueh-Ting Chen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 27 01:38:58 PST 2022
eopXD updated this revision to Diff 403547.
eopXD added a comment.
Update code. Try to encapsulate more.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118334/new/
https://reviews.llvm.org/D118334
Files:
llvm/include/llvm/Support/RISCVISAInfo.h
llvm/lib/Support/RISCVISAInfo.cpp
Index: llvm/lib/Support/RISCVISAInfo.cpp
===================================================================
--- llvm/lib/Support/RISCVISAInfo.cpp
+++ llvm/lib/Support/RISCVISAInfo.cpp
@@ -461,15 +461,7 @@
ISAInfo->Exts.erase(ExtName.str());
}
- ISAInfo->updateImplication();
- ISAInfo->updateFLen();
- ISAInfo->updateMinVLen();
- ISAInfo->updateMaxELen();
-
- if (Error Result = ISAInfo->checkDependency())
- return std::move(Result);
-
- return std::move(ISAInfo);
+ return RISCVISAInfo::postProcessAndChecking(std::move(ISAInfo));
}
llvm::Expected<std::unique_ptr<RISCVISAInfo>>
@@ -686,15 +678,7 @@
}
}
- ISAInfo->updateImplication();
- ISAInfo->updateFLen();
- ISAInfo->updateMinVLen();
- ISAInfo->updateMaxELen();
-
- if (Error Result = ISAInfo->checkDependency())
- return std::move(Result);
-
- return std::move(ISAInfo);
+ return RISCVISAInfo::postProcessAndChecking(std::move(ISAInfo));
}
Error RISCVISAInfo::checkDependency() {
@@ -919,3 +903,15 @@
}
return FeatureVector;
}
+
+llvm::Expected<std::unique_ptr<RISCVISAInfo>>
+RISCVISAInfo::postProcessAndChecking(std::unique_ptr<RISCVISAInfo> &&ISAInfo) {
+ ISAInfo->updateImplication();
+ ISAInfo->updateFLen();
+ ISAInfo->updateMinVLen();
+ ISAInfo->updateMaxELen();
+
+ if (Error Result = ISAInfo->checkDependency())
+ return std::move(Result);
+ return std::move(ISAInfo);
+}
Index: llvm/include/llvm/Support/RISCVISAInfo.h
===================================================================
--- llvm/include/llvm/Support/RISCVISAInfo.h
+++ llvm/include/llvm/Support/RISCVISAInfo.h
@@ -92,6 +92,9 @@
void updateFLen();
void updateMinVLen();
void updateMaxELen();
+
+ static llvm::Expected<std::unique_ptr<RISCVISAInfo>>
+ postProcessAndChecking(std::unique_ptr<RISCVISAInfo> &&ISAInfo);
};
} // namespace llvm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118334.403547.patch
Type: text/x-patch
Size: 1855 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220127/65c89dfb/attachment.bin>
More information about the llvm-commits
mailing list