[clang] [compiler-rt] [llvm] [clang-tools-extra] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)
Erich Keane via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 13 07:45:27 PST 2023
================
@@ -4297,3 +4297,19 @@ def PreferredType: InheritableAttr {
let Args = [TypeArgument<"Type", 1>];
let Documentation = [PreferredTypeDocumentation];
}
+
+def CodeAlign: StmtAttr {
+ let Spellings = [Clang<"code_align">];
+ let Subjects = SubjectList<[ForStmt, CXXForRangeStmt, WhileStmt, DoStmt],
+ ErrorDiag, "'for', 'while', and 'do' statements">;
+ let Args = [ExprArgument<"Alignment">];
+ let Documentation = [CodeAlignAttrDocs];
+ let AdditionalMembers = [{
----------------
erichkeane wrote:
These members make little sense to be here to me. If we don't intend for them to ever be target specific, I could imagine making them static variables for the purpose of picking them up in a way that doesn't look like it uses 'magic numbers'. If some day they might be target specific, they should likely be a part of TargetInfo or similar.
https://github.com/llvm/llvm-project/pull/70762
More information about the llvm-commits
mailing list