[clang] [Clang][attr] Add 'cfi_salt' attribute (PR #141846)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 5 09:47:22 PDT 2025
================
@@ -7941,6 +7942,32 @@ static bool handleFunctionTypeAttr(TypeProcessingState &state, ParsedAttr &attr,
return true;
}
+ if (attr.getKind() == ParsedAttr::AT_CFISalt) {
+ if (attr.getNumArgs() == 0)
+ return true;
+
+ // Delay if this is not a function type.
+ StringRef Argument;
+ if (!S.checkStringLiteralArgumentAttr(attr, 0, Argument))
+ return false;
+
+ // Delay if this is not a function type.
+ if (!unwrapped.isFunctionType())
+ return false;
+
+ const auto *FnTy = unwrapped.get()->getAs<FunctionProtoType>();
+ if (!FnTy)
----------------
erichkeane wrote:
Huh, interesting, I could have sworn we had a different location for no-prototype-attribute handling, but I don't think so anymore (after digging in for a few mins).
My bullets still are relevant. I wouldn't expect an attribute that doesn't pass the builtin-TableGen'd stuff to reach this function (like for arg counts/appertainment/etc), so if this _IS_ getting here, it either needs to diagnose here, or figure out WHY we're continuing after failing tablegen.
https://github.com/llvm/llvm-project/pull/141846
More information about the cfe-commits
mailing list