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 origin/main HEAD --extensions cpp,c,h -- 
clang/test/CodeGen/stack-protector-vars.cpp 
clang/test/Sema/stack_protector_ignore.c clang/lib/CodeGen/CGDecl.cpp 
clang/lib/CodeGen/CodeGenModule.cpp clang/lib/CodeGen/CodeGenModule.h 
--diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index e4642fda8..f39e282f3 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -1644,7 +1644,7 @@ CodeGenFunction::EmitAutoVarAlloca(const VarDecl &D) {
       }
 
       std::optional<llvm::Attribute::AttrKind> Attr =
-        CGM.StackProtectorAttribute(&D);
+          CGM.StackProtectorAttribute(&D);
       if (Attr && (*Attr == llvm::Attribute::StackProtectReq)) {
         CGM.getDiags().Report(D.getLocation(),
                               diag::warn_stack_protection_ignore_attribute);
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp 
b/clang/lib/CodeGen/CodeGenModule.cpp
index e841deb9b..728546b11 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -951,8 +951,7 @@ static bool isStackProtectorOn(const LangOptions &LangOpts,
 }
 
 std::optional<llvm::Attribute::AttrKind>
-CodeGenModule::StackProtectorAttribute(const Decl *D) const
-{
+CodeGenModule::StackProtectorAttribute(const Decl *D) const {
   if (D && D->hasAttr<NoStackProtectorAttr>())
     ; // Do nothing.
   else if (D && D->hasAttr<StrictGuardStackCheckAttr>() &&
@@ -2754,7 +2753,7 @@ void 
CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
     B.addAttribute(llvm::Attribute::NoUnwind);
 
   if (std::optional<llvm::Attribute::AttrKind> Attr =
-      StackProtectorAttribute(D)) {
+          StackProtectorAttribute(D)) {
     B.addAttribute(*Attr);
   }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/173311
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to