[llvm] [TableGen] Rework error reporting for duplicate Feature/Processor. (PR #102257)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 6 18:06:58 PDT 2024


================
@@ -250,34 +250,37 @@ void SubtargetEmitter::EmitSubtargetInfoMacroCalls(raw_ostream &OS) {
 //
 unsigned SubtargetEmitter::FeatureKeyValues(
     raw_ostream &OS, const DenseMap<Record *, unsigned> &FeatureMap) {
-  // Gather and sort all the features
+  // Gather and sort all the features.
   std::vector<Record *> FeatureList =
       Records.getAllDerivedDefinitions("SubtargetFeature");
 
-  if (FeatureList.empty())
+  // Remove features with empty name.
+  auto End = llvm::remove_if(FeatureList, [](const Record *Rec) {
----------------
s-barannikov wrote:

Use `llvm::erase_if`?

https://github.com/llvm/llvm-project/pull/102257


More information about the llvm-commits mailing list