[clang] [llvm] [TargetParser][ARM][NFC] Make string tables reloc-free (PR #206937)

Michael Platings via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 1 06:22:51 PDT 2026


================
@@ -351,14 +352,14 @@ static void getARMMultilibFlags(const Driver &D, const llvm::Triple &Triple,
   llvm::DenseSet<StringRef> FeatureSet(UnifiedFeatures.begin(),
                                        UnifiedFeatures.end());
   std::vector<std::string> MArch;
-  for (const auto &Ext : ARM::ARCHExtNames)
-    if (!Ext.Name.empty())
-      if (FeatureSet.contains(Ext.Feature))
-        MArch.push_back(Ext.Name.str());
-  for (const auto &Ext : ARM::ARCHExtNames)
-    if (!Ext.Name.empty())
-      if (FeatureSet.contains(Ext.NegFeature))
-        MArch.push_back(("no" + Ext.Name).str());
+  for (const auto &Ext : ARM::getArchExts())
+    if (!Ext.name().empty())
+      if (FeatureSet.contains(Ext.name(1)))
----------------
mplatings wrote:

I'm not sufficiently familiar with your new EnumStrings class to judge what would fit well there.
I wouldn't be happy with comments.
I don't love it, but something this would be clearer:
```
enum ArchExtField {
ArchExtFeature = 1
};
// ...
Ext.name(ArchExtFeature);
```

If you want more background on the class of problem: https://en.wikipedia.org/wiki/Magic_number_(programming)

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


More information about the cfe-commits mailing list