[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

Tomas Matheson via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 4 10:02:26 PDT 2024


================
@@ -250,13 +248,17 @@ void AArch64::ExtensionSet::addArchDefaults(const ArchInfo &Arch) {
 bool AArch64::ExtensionSet::parseModifier(StringRef Modifier) {
   LLVM_DEBUG(llvm::dbgs() << "parseModifier(" << Modifier << ")\n");
 
-  bool IsNegated = Modifier.starts_with("no");
-  StringRef ArchExt = IsNegated ? Modifier.drop_front(2) : Modifier;
+  size_t NChars = 0;
+  if (Modifier.starts_with("no-"))
+    NChars = 3;
+  else if (Modifier.starts_with("no"))
+    NChars = 2;
+  StringRef ArchExt = Modifier.drop_front(NChars);
 
   if (auto AE = parseArchExtension(ArchExt)) {
     if (AE->Feature.empty() || AE->NegFeature.empty())
       return false;
-    if (IsNegated)
+    if (NChars)
----------------
tmatheson-arm wrote:

```suggestion
    if (NChars != 0)
```

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


More information about the cfe-commits mailing list