[flang] [llvm] [clang] [AArch64][Driver] Better handling of target feature dependencies (PR #78270)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 17 06:40:05 PST 2024


================
@@ -308,6 +312,94 @@ inline constexpr ExtensionInfo Extensions[] = {
 };
 // clang-format on
 
+struct ExtensionSet {
+  // Set of extensions which are currently enabled.
+  ExtensionBitset Enabled;
+  // Set of extensions which have been enabled or disabled at any point. Used
+  // to avoid cluttering the cc1 command-line with lots of unneeded features.
+  ExtensionBitset Touched;
+  // Base architecture version, which we need to know because some feature
+  // dependencies change depending on this.
+  const ArchInfo *BaseArch;
+
+  ExtensionSet() : Enabled(), Touched(), BaseArch(nullptr) {}
+
+  // Enable the given architecture extension, and any other extensions it
+  // depends on.
+  void enable(ArchExtKind E);
+  // Disable the given architecture extension, and any other extensions which
+  // depend on it.
----------------
ostannard wrote:

Yes, that's what happens. That's also the current behaviour on most cases, because it's what the LLVM backend does if passed an inconsistent set of options.

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


More information about the cfe-commits mailing list