[clang] [clang] Split up `SemaDeclAttr.cpp` (PR #93966)
via cfe-commits
cfe-commits at lists.llvm.org
Fri May 31 09:37:50 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff c5fdb5c34e0dc3f5f3c0db19cf704b30a778cd0e b7d132f0a9d2b6acc67c227af6ce86eeeb394b82 -- clang/include/clang/Sema/SemaAVR.h clang/include/clang/Sema/SemaM68k.h clang/include/clang/Sema/SemaMSP430.h clang/include/clang/Sema/SemaOpenCL.h clang/include/clang/Sema/SemaSwift.h clang/lib/Sema/SemaAVR.cpp clang/lib/Sema/SemaM68k.cpp clang/lib/Sema/SemaMSP430.cpp clang/lib/Sema/SemaOpenCL.cpp clang/lib/Sema/SemaSwift.cpp clang/include/clang/Sema/Attr.h clang/include/clang/Sema/Sema.h clang/include/clang/Sema/SemaARM.h clang/include/clang/Sema/SemaBPF.h clang/include/clang/Sema/SemaHLSL.h clang/include/clang/Sema/SemaMIPS.h clang/include/clang/Sema/SemaObjC.h clang/include/clang/Sema/SemaOpenMP.h clang/include/clang/Sema/SemaRISCV.h clang/include/clang/Sema/SemaSYCL.h clang/include/clang/Sema/SemaX86.h clang/lib/Sema/Sema.cpp clang/lib/Sema/SemaAPINotes.cpp clang/lib/Sema/SemaARM.cpp clang/lib/Sema/SemaBPF.cpp clang/lib/Sema/SemaDecl.cpp clang/lib/Sema/SemaDeclAttr.cpp clang/lib/Sema/SemaHLSL.cpp clang/lib/Sema/SemaMIPS.cpp clang/lib/Sema/SemaObjC.cpp clang/lib/Sema/SemaOpenMP.cpp clang/lib/Sema/SemaRISCV.cpp clang/lib/Sema/SemaSYCL.cpp clang/lib/Sema/SemaTemplateInstantiateDecl.cpp clang/lib/Sema/SemaType.cpp clang/lib/Sema/SemaX86.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/include/clang/Sema/Attr.h b/clang/include/clang/Sema/Attr.h
index f5b240abf4..3f0b102127 100644
--- a/clang/include/clang/Sema/Attr.h
+++ b/clang/include/clang/Sema/Attr.h
@@ -19,9 +19,9 @@
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/Type.h"
+#include "clang/Basic/AttributeCommonInfo.h"
#include "clang/Basic/DiagnosticSema.h"
#include "clang/Basic/SourceLocation.h"
-#include "clang/Basic/AttributeCommonInfo.h"
#include "clang/Sema/ParsedAttr.h"
#include "clang/Sema/SemaBase.h"
#include "llvm/Support/Casting.h"
@@ -160,13 +160,14 @@ const SemaBase::SemaDiagnosticBuilder &
appendDiagnostics(const SemaBase::SemaDiagnosticBuilder &Bldr, T &&ExtraArg,
DiagnosticArgs &&...ExtraArgs) {
return appendDiagnostics(Bldr << std::forward<T>(ExtraArg),
- std::forward<DiagnosticArgs>(ExtraArgs)...);
+ std::forward<DiagnosticArgs>(ExtraArgs)...);
}
/// Applies the given attribute to the Decl without performing any
/// additional semantic checking.
template <typename AttrType>
-void handleSimpleAttribute(SemaBase &S, Decl *D, const AttributeCommonInfo &CI) {
+void handleSimpleAttribute(SemaBase &S, Decl *D,
+ const AttributeCommonInfo &CI) {
D->addAttr(::new (S.getASTContext()) AttrType(S.getASTContext(), CI));
}
@@ -175,9 +176,10 @@ void handleSimpleAttribute(SemaBase &S, Decl *D, const AttributeCommonInfo &CI)
/// Otherwise, emit diagnostic @c DiagID, passing in all parameters
/// specified in @c ExtraArgs.
template <typename AttrType, typename... DiagnosticArgs>
-void handleSimpleAttributeOrDiagnose(SemaBase &S, Decl *D, const AttributeCommonInfo &CI,
- bool PassesCheck, unsigned DiagID,
- DiagnosticArgs &&...ExtraArgs) {
+void handleSimpleAttributeOrDiagnose(SemaBase &S, Decl *D,
+ const AttributeCommonInfo &CI,
+ bool PassesCheck, unsigned DiagID,
+ DiagnosticArgs &&...ExtraArgs) {
if (!PassesCheck) {
SemaBase::SemaDiagnosticBuilder DB = S.Diag(D->getBeginLoc(), DiagID);
appendDiagnostics(DB, std::forward<DiagnosticArgs>(ExtraArgs)...);
``````````
</details>
https://github.com/llvm/llvm-project/pull/93966
More information about the cfe-commits
mailing list