[llvm] [SystemZ] Implement .machine (push|pop) directives (PR #137302)

Dominik Steenken via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 28 05:22:47 PDT 2025


================
@@ -410,6 +411,18 @@ class SystemZAsmParser : public MCTargetAsmParser {
 
 private:
   MCAsmParser &Parser;
+
+  // A vector to contain the stack of FeatureBitsets created by `.machine push`.
+  // `.machine pop` pops the top of the stack and resets `CurrentFeatures` to
+  // the result.
+  SmallVector<FeatureBitset> MachineStack;
+  // Specifies the current FeatureBitset. It is initialized from the
+  // SubtargetInfo handed to the constructor of the AsmParser. During parsing,
+  // it always reflects the current FeatureBitset used to determine which
+  // machine features are available, i.e. either the default or the result
+  // of the most reecent `.machine` directive.
+  FeatureBitset CurrentFeatures;
----------------
dominik-steenken wrote:

Good point, i have removed the copy and use `getAvailableFeatures()` instead.

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


More information about the llvm-commits mailing list