[clang] Type safety tweak for AttributeCommonInfo::Form
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 11 Apr 2023 16:58:56 +0000 (17:58 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Thu, 13 Apr 2023 09:14:49 +0000 (10:14 +0100)
commitaec3f951bf368d45b441554dac6e027678f9f3ee
treef67243737c4be7a12fbe6720871ff6017f7ed6bd
parent265d87e46535bef2b718759ba39bb9fa30b1ef48
[clang] Type safety tweak for AttributeCommonInfo::Form

This patch adds static functions for constructing most
AttributeCommonInfo::Forms.  Direct construction is only retained where
all fields (currently the syntax and spelling) are specified explicitly.

This is a wash on its own.  The purpose is to allow extra fields
to be added to Form without disrupting all callers.  In particular,
it allows extra information to be stored about keywords without
affecting non-keyword uses.

No functional change intended.

Differential Revision: https://reviews.llvm.org/D148104
12 files changed:
clang/include/clang/Basic/AttributeCommonInfo.h
clang/lib/Parse/ParseCXXInlineMethods.cpp
clang/lib/Parse/ParseDecl.cpp
clang/lib/Parse/ParseDeclCXX.cpp
clang/lib/Parse/ParseHLSL.cpp
clang/lib/Parse/ParseObjc.cpp
clang/lib/Parse/ParsePragma.cpp
clang/lib/Parse/ParseStmt.cpp
clang/lib/Sema/SemaAttr.cpp
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaType.cpp
clang/utils/TableGen/ClangAttrEmitter.cpp