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,h -- 
clang/lib/CodeGen/BackendUtil.cpp clang/lib/CodeGen/CGClass.cpp 
clang/lib/CodeGen/CGVTables.cpp clang/lib/CodeGen/ItaniumCXXABI.cpp 
clang/lib/Driver/ToolChains/Clang.cpp clang/test/CodeGenCXX/type-metadata.cpp 
llvm/include/llvm/Passes/PassBuilder.h llvm/lib/Passes/PassBuilderPipelines.cpp 
llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
``````````

: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/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp
index 23af3357c..caa9871dc 100644
--- a/clang/lib/CodeGen/CGClass.cpp
+++ b/clang/lib/CodeGen/CGClass.cpp
@@ -2828,10 +2828,10 @@ void 
CodeGenFunction::EmitTypeMetadataCodeForVCall(const CXXRecordDecl *RD,
   if (SanOpts.has(SanitizerKind::CFIVCall))
     EmitVTablePtrCheckForCall(RD, VTable, CodeGenFunction::CFITCK_VCall, Loc);
   else if ((CGM.getCodeGenOpts().WholeProgramVTables &&
-           // Don't insert type test assumes if we are forcing public
-           // visibility.
-           !CGM.AlwaysHasLTOVisibilityPublic(RD)) ||
-            CGM.getCodeGenOpts().DevirtualizeSpeculatively) {
+            // Don't insert type test assumes if we are forcing public
+            // visibility.
+            !CGM.AlwaysHasLTOVisibilityPublic(RD)) ||
+           CGM.getCodeGenOpts().DevirtualizeSpeculatively) {
     CanQualType Ty = CGM.getContext().getCanonicalTagType(RD);
     llvm::Metadata *MD = CGM.CreateMetadataIdentifierForType(Ty);
     llvm::Value *TypeId =
@@ -2990,7 +2990,7 @@ void CodeGenFunction::EmitVTablePtrCheck(const 
CXXRecordDecl *RD,
 
 bool CodeGenFunction::ShouldEmitVTableTypeCheckedLoad(const CXXRecordDecl *RD) 
{
   if ((!CGM.getCodeGenOpts().WholeProgramVTables ||
-      !CGM.HasHiddenLTOVisibility(RD)) &&
+       !CGM.HasHiddenLTOVisibility(RD)) &&
       !CGM.getCodeGenOpts().DevirtualizeSpeculatively)
     return false;
 
diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp 
b/clang/lib/CodeGen/ItaniumCXXABI.cpp
index fcccf218c..71d36b5d6 100644
--- a/clang/lib/CodeGen/ItaniumCXXABI.cpp
+++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp
@@ -718,8 +718,8 @@ CGCallee ItaniumCXXABI::EmitLoadOfMemberFunctionPointer(
                            CGM.HasHiddenLTOVisibility(RD);
   bool ShouldEmitWPDInfo =
       (CGM.getCodeGenOpts().WholeProgramVTables &&
-      // Don't insert type tests if we are forcing public visibility.
-      !CGM.AlwaysHasLTOVisibilityPublic(RD)) ||
+       // Don't insert type tests if we are forcing public visibility.
+       !CGM.AlwaysHasLTOVisibilityPublic(RD)) ||
       CGM.getCodeGenOpts().DevirtualizeSpeculatively;
   llvm::Value *VirtualFn = nullptr;
 
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp 
b/clang/lib/Driver/ToolChains/Clang.cpp
index 34f8e6f26..1e39a0cdd 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -7805,12 +7805,12 @@ void Clang::ConstructJob(Compilation &C, const 
JobAction &JA,
   }
 
   addOpenMPHostOffloadingArgs(C, JA, Args, CmdArgs);
-  
+
   // Temporarily disable this for LTO if it's not explicitly enabled.
   // TODO: enable it by default for LTO also.
-  if (Args.hasFlag(
-      options::OPT_fdevirtualize_speculatively,
-      options::OPT_fno_devirtualize_speculatively, /*Default value*/ 
!IsUsingLTO)) 
+  if (Args.hasFlag(options::OPT_fdevirtualize_speculatively,
+                   options::OPT_fno_devirtualize_speculatively,
+                   /*Default value*/ !IsUsingLTO))
     CmdArgs.push_back("-fdevirtualize-speculatively");
 
   bool VirtualFunctionElimination =
diff --git a/llvm/lib/Passes/PassBuilderPipelines.cpp 
b/llvm/lib/Passes/PassBuilderPipelines.cpp
index da88c5139..2b76dc1db 100644
--- a/llvm/lib/Passes/PassBuilderPipelines.cpp
+++ b/llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -1651,7 +1651,8 @@ 
PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level,
     MPM.addPass(LowerTypeTestsPass(nullptr, nullptr,
                                    lowertypetests::DropTestKind::Assume));
     if (EnableModuleInliner) {
-      MPM.addPass(ModuleInlinerPass(getInlineParamsFromOptLevel(Level), 
UseInlineAdvisor,
+      MPM.addPass(ModuleInlinerPass(getInlineParamsFromOptLevel(Level),
+                                    UseInlineAdvisor,
                                     ThinOrFullLTOPhase::None));
     } else {
       MPM.addPass(ModuleInlinerWrapperPass(
diff --git a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp 
b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
index d210fd73c..9a3bc9a8c 100644
--- a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
+++ b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
@@ -818,7 +818,8 @@ PreservedAnalyses WholeProgramDevirtPass::run(Module &M,
     // so we enable the speculative devirtualization.
     ClDevirtualizeSpeculatively = true;
     // Build the ExportSummary from the module.
-    assert(!ExportSummary && "ExportSummary is expected to be empty in non-LTO 
mode");
+    assert(!ExportSummary &&
+           "ExportSummary is expected to be empty in non-LTO mode");
     ProfileSummaryInfo PSI(M);
     Index.emplace(buildModuleSummaryIndex(M, nullptr, &PSI));
     ExportSummary = Index.has_value() ? &Index.value() : nullptr;
@@ -2381,7 +2382,7 @@ bool DevirtModule::run() {
   // this transformation. We already checked for the presense of type tests
   // with partially split modules during the thin link, and would have emitted
   // an error if any were found, so here we can simply return.
-    if ((ExportSummary && ExportSummary->partiallySplitLTOUnits()) ||
+  if ((ExportSummary && ExportSummary->partiallySplitLTOUnits()) ||
       (ImportSummary && ImportSummary->partiallySplitLTOUnits()))
     return false;
 

``````````

</details>


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

Reply via email to