[clang] [Clang][AArch64] Include SME attributes in the name mangling of function types (PR #114209)
Sander de Smalen via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 28 05:55:33 PST 2024
================
@@ -3535,6 +3536,70 @@ void CXXNameMangler::mangleExtFunctionInfo(const FunctionType *T) {
// FIXME: noreturn
}
+enum class AAPCSBitmaskSME : unsigned {
+ ArmStreamingBit = 1 << 0,
+ ArmStreamingCompatibleBit = 1 << 1,
+ ArmAgnosticSMEZAStateBit = 1 << 2,
+ ZA_Shift = 3,
+ ZT0_Shift = 6,
+ NoState = 0b000,
+ ArmIn = 0b001,
+ ArmOut = 0b010,
+ ArmInOut = 0b011,
+ ArmPreserves = 0b100
+};
+
+static unsigned encodeAAPCSZAState(unsigned SMEAttrs) {
+ switch (SMEAttrs) {
+ case FunctionType::ARM_None:
+ return static_cast<unsigned>(AAPCSBitmaskSME::NoState);
----------------
sdesmalen-arm wrote:
You can remove the `static_cast` if you use BitmaskEnum, see `LLVM_MARK_AS_BITMASK_ENUM` or `LLVM_DECLARE_ENUM_AS_BITMASK`.
Unfortunately I found that `operator<<` is not supported (needed below in mangleSMEAttrs), so I've created #118007.
https://github.com/llvm/llvm-project/pull/114209
More information about the cfe-commits
mailing list