Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Clang] Fix confusing diagnostic with explicit 'this' parameters. #99824

Closed
wants to merge 6 commits into from

Conversation

bradenhelmer
Copy link
Contributor

Fixes #97878

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Jul 21, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Jul 21, 2024

@llvm/pr-subscribers-backend-directx
@llvm/pr-subscribers-bolt
@llvm/pr-subscribers-hlsl
@llvm/pr-subscribers-pgo
@llvm/pr-subscribers-backend-nvptx
@llvm/pr-subscribers-mlir
@llvm/pr-subscribers-backend-spir-v
@llvm/pr-subscribers-mlir-spirv
@llvm/pr-subscribers-flang-runtime
@llvm/pr-subscribers-llvm-globalisel
@llvm/pr-subscribers-mlir-llvm
@llvm/pr-subscribers-mlir-linalg
@llvm/pr-subscribers-mc
@llvm/pr-subscribers-clang-format
@llvm/pr-subscribers-mlir-core
@llvm/pr-subscribers-backend-powerpc
@llvm/pr-subscribers-clang-codegen
@llvm/pr-subscribers-lld
@llvm/pr-subscribers-clang-modules
@llvm/pr-subscribers-lld-elf
@llvm/pr-subscribers-libc
@llvm/pr-subscribers-lld-coff
@llvm/pr-subscribers-backend-systemz
@llvm/pr-subscribers-clang-driver
@llvm/pr-subscribers-clang-static-analyzer-1
@llvm/pr-subscribers-backend-msp430
@llvm/pr-subscribers-backend-amdgpu

@llvm/pr-subscribers-clang

Author: Braden Helmer (bradenhelmer)

Changes

Fixes #97878


Full diff: https://github.com/llvm/llvm-project/pull/99824.diff

2 Files Affected:

  • (modified) clang/lib/Sema/SemaOverload.cpp (+1-1)
  • (modified) clang/test/SemaCXX/cxx2b-deducing-this.cpp (+8)
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index a8d250fbabfed..ac90ccd5643c1 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -11149,7 +11149,7 @@ static void DiagnoseBadConversion(Sema &S, OverloadCandidate *Cand,
   if (isa<CXXMethodDecl>(Fn) && !isa<CXXConstructorDecl>(Fn)) {
     if (I == 0)
       isObjectArgument = true;
-    else
+    else if (!Fn->hasCXXExplicitFunctionObjectParameter())
       I--;
   }
 
diff --git a/clang/test/SemaCXX/cxx2b-deducing-this.cpp b/clang/test/SemaCXX/cxx2b-deducing-this.cpp
index 5cbc1f735383b..6ad54b9b2c63d 100644
--- a/clang/test/SemaCXX/cxx2b-deducing-this.cpp
+++ b/clang/test/SemaCXX/cxx2b-deducing-this.cpp
@@ -959,3 +959,11 @@ void f();
 };
 void a::f(this auto) {} // expected-error {{an explicit object parameter cannot appear in a non-member function}}
 }
+
+struct R {
+  void f(this auto &&self, int &&r_value_ref) {} // expected-note {{candidate function template not viable: expects an rvalue for 2nd argument}}
+  void g(int &&r_value_ref) {
+	f(r_value_ref); // expected-error {{no matching member function for call to 'f'}}
+  }
+};
+

@Sirraide Sirraide requested a review from cor3ntin July 23, 2024 08:44
@cor3ntin
Copy link
Contributor

Thanks a lot of this fix, I think this makes sense.
Can you:

  • Update the title of the PR to be more descriptive
  • Add a release note? (clang/docs/ReleaseNotes.rst)

Thanks!

@bradenhelmer bradenhelmer changed the title Diag mismatch 97878 [Clang] Fix confusing diagnostic with explicit 'this' parameters. Jul 23, 2024
@bradenhelmer
Copy link
Contributor Author

bradenhelmer commented Jul 23, 2024

Crud, I think I messed up fixing a conflict, closing this and we reopen a clean one.

Copy link

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 73d78973fe072438f0f73088f889c66845b2b51a 1d1ba2ac408cbfdad9611ca6520968440a13f217 --extensions ,cpp,h,cppm,inc,c -- clang/test/CXX/cpp/cpp.module/p2.cppm libc/src/stdlib/exit_handler.cpp libcxx/test/libcxx/containers/sequences/vector/debug.iterator.index.pass.cpp libcxx/test/std/ranges/range.adaptors/range.transform/iterator/iter_move.pass.cpp bolt/lib/Core/BinaryContext.cpp bolt/lib/Rewrite/DWARFRewriter.cpp clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.h clang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.cpp clang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.h clang-tools-extra/clang-tidy/utils/ASTUtils.cpp clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp clang-tools-extra/clangd/IncludeCleaner.cpp clang-tools-extra/clangd/unittests/IncludeCleanerTests.cpp clang-tools-extra/include-cleaner/lib/Analysis.cpp clang-tools-extra/include-cleaner/unittests/AnalysisTest.cpp clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape.cpp clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-values.cpp clang/include/clang/AST/ASTContext.h clang/include/clang/AST/ExprCXX.h clang/include/clang/Basic/IdentifierTable.h clang/include/clang/Basic/PointerAuthOptions.h clang/include/clang/Frontend/FrontendOptions.h clang/include/clang/Lex/Preprocessor.h clang/include/clang/Lex/PreprocessorOptions.h clang/include/clang/Lex/Token.h clang/include/clang/Parse/Parser.h clang/lib/APINotes/APINotesFormat.h clang/lib/APINotes/APINotesYAMLCompiler.cpp clang/lib/AST/ASTConcept.cpp clang/lib/AST/ASTContext.cpp clang/lib/AST/ASTImporter.cpp clang/lib/AST/DeclCXX.cpp clang/lib/AST/ExprCXX.cpp clang/lib/AST/ExprConstant.cpp clang/lib/AST/Interp/ByteCodeEmitter.cpp clang/lib/AST/Interp/Compiler.cpp clang/lib/AST/Interp/Descriptor.cpp clang/lib/AST/Interp/Descriptor.h clang/lib/AST/Interp/Interp.h clang/lib/AST/Interp/InterpBuiltin.cpp clang/lib/AST/Interp/Pointer.cpp clang/lib/AST/Interp/Pointer.h clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp clang/lib/Basic/IdentifierTable.cpp clang/lib/Basic/Targets/AArch64.cpp clang/lib/Basic/Targets/LoongArch.cpp clang/lib/Basic/Targets/LoongArch.h clang/lib/Basic/Targets/X86.h clang/lib/CodeGen/CGCall.cpp clang/lib/CodeGen/CGExpr.cpp clang/lib/CodeGen/CGExprConstant.cpp clang/lib/CodeGen/CGPointerAuth.cpp clang/lib/CodeGen/CGRecordLayout.h clang/lib/CodeGen/CodeGenFunction.cpp clang/lib/CodeGen/CodeGenFunction.h clang/lib/CodeGen/CodeGenModule.cpp clang/lib/CodeGen/CodeGenModule.h clang/lib/CodeGen/ItaniumCXXABI.cpp clang/lib/CodeGen/TargetInfo.h clang/lib/Driver/ToolChain.cpp clang/lib/Driver/ToolChains/AIX.cpp clang/lib/Driver/ToolChains/Arch/AArch64.cpp clang/lib/Driver/ToolChains/Arch/AArch64.h clang/lib/Driver/ToolChains/Arch/LoongArch.cpp clang/lib/Driver/ToolChains/Clang.cpp clang/lib/Driver/ToolChains/Cuda.cpp clang/lib/Driver/ToolChains/Cuda.h clang/lib/Driver/ToolChains/Linux.cpp clang/lib/Driver/ToolChains/PS4CPU.h clang/lib/Format/TokenAnnotator.cpp clang/lib/Frontend/CompilerInvocation.cpp clang/lib/Frontend/PrintPreprocessedOutput.cpp clang/lib/Lex/DependencyDirectivesScanner.cpp clang/lib/Lex/PPLexerChange.cpp clang/lib/Lex/Preprocessor.cpp clang/lib/Lex/TokenConcatenation.cpp clang/lib/Parse/ParseAST.cpp clang/lib/Parse/ParseDecl.cpp clang/lib/Parse/ParseExpr.cpp clang/lib/Parse/ParsePragma.cpp clang/lib/Parse/ParseStmt.cpp clang/lib/Parse/Parser.cpp clang/lib/Sema/SemaAPINotes.cpp clang/lib/Sema/SemaAvailability.cpp clang/lib/Sema/SemaDeclAttr.cpp clang/lib/Sema/SemaExpr.cpp clang/lib/Sema/SemaOpenMP.cpp clang/lib/Sema/SemaOverload.cpp clang/lib/Sema/SemaTemplate.cpp clang/lib/Sema/SemaTemplateDeductionGuide.cpp clang/lib/Sema/SemaTemplateInstantiate.cpp clang/lib/Sema/SemaTemplateInstantiateDecl.cpp clang/lib/Serialization/ASTReaderStmt.cpp clang/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp clang/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp clang/lib/StaticAnalyzer/Core/BugReporter.cpp clang/test/APINotes/Inputs/Headers/Methods.h clang/test/APINotes/Inputs/Headers/Namespaces.h clang/test/APINotes/methods.cpp clang/test/APINotes/namespaces.cpp clang/test/AST/Interp/atomic.c clang/test/AST/Interp/codegen.cpp clang/test/AST/ast-dump-ctad-alias.cpp clang/test/Analysis/Inputs/system-header-simulator-cxx.h clang/test/Analysis/builtin-functions.cpp clang/test/Analysis/diagnostics/explicit-suppression.cpp clang/test/Analysis/out-of-bounds-diagnostics.c clang/test/Analysis/stream.c clang/test/Analysis/use-after-move.cpp clang/test/CXX/drs/cwg6xx.cpp clang/test/CXX/expr/expr.unary/expr.unary.op/p4.cpp clang/test/CXX/module/basic/basic.link/module-declaration.cpp clang/test/CXX/module/dcl.dcl/dcl.module/dcl.module.import/p1.cppm clang/test/CXX/temp/temp.arg/temp.arg.template/p3-0x.cpp clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3-0x.cpp clang/test/CXX/temp/temp.spec/temp.expl.spec/p2-20.cpp clang/test/CodeGen/attr-counted-by.c clang/test/CodeGen/ptrauth-function-attributes.c clang/test/Driver/aarch64-ptrauth.c clang/test/Driver/cuda-cross-compiling.c clang/test/Driver/fpatchable-function-entry.c clang/test/Driver/ftime-trace-sections.cpp clang/test/Driver/ftime-trace.cpp clang/test/Driver/loongarch-features.c clang/test/Driver/loongarch-march.c clang/test/Driver/loongarch-mlasx.c clang/test/Driver/loongarch-msimd.c clang/test/Driver/loongarch-msingle-float.c clang/test/Driver/loongarch-msoft-float.c clang/test/Driver/loongarch-mtune.c clang/test/Driver/print-supported-extensions-riscv.c clang/test/Driver/ps4-ps5-runtime-flags.c clang/test/Parser/cxx-template-decl.cpp clang/test/Preprocessor/embed_weird.cpp clang/test/Preprocessor/init-loongarch.c clang/test/Preprocessor/riscv-target-features.c clang/test/Sema/atomic-ops.c clang/test/Sema/patchable-function-entry-attr.cpp clang/test/SemaCXX/builtin_vectorelements.cpp clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp clang/test/SemaCXX/cxx20-ctad-type-alias.cpp clang/test/SemaCXX/cxx2b-deducing-this.cpp clang/test/SemaCXX/modules.cppm clang/test/SemaTemplate/class-template-decl.cpp clang/test/SemaTemplate/deduction-guide.cpp clang/test/SemaTemplate/nested-template.cpp clang/tools/driver/cc1_main.cpp clang/unittests/AST/ASTImporterTest.cpp clang/unittests/Analysis/FlowSensitive/DataflowEnvironmentTest.cpp clang/unittests/Format/FormatTest.cpp clang/unittests/Format/TokenAnnotatorTest.cpp clang/unittests/Lex/DependencyDirectivesScannerTest.cpp clang/unittests/Support/TimeProfilerTest.cpp clang/unittests/Tooling/RecursiveASTVisitorTests/DeductionGuide.cpp clang/utils/TableGen/NeonEmitter.cpp compiler-rt/include/profile/InstrProfData.inc compiler-rt/lib/builtins/aarch64/sme-libc-routines.c compiler-rt/lib/builtins/fp_extend.h compiler-rt/lib/builtins/fp_lib.h compiler-rt/lib/rtsan/rtsan.cpp compiler-rt/lib/rtsan/rtsan.h compiler-rt/lib/rtsan/rtsan_interceptors.cpp compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cpp compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_printer.cpp compiler-rt/test/asan/TestCases/Posix/ignore_free_hook.cpp compiler-rt/test/hwasan/TestCases/Posix/ignore_free_hook.cpp compiler-rt/test/profile/Linux/instrprof-vtable-value-prof.cpp flang/lib/Lower/ConvertCall.cpp flang/lib/Lower/DirectivesCommon.h flang/lib/Lower/OpenMP/DataSharingProcessor.cpp flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp flang/lib/Optimizer/Transforms/AddDebugInfo.cpp flang/runtime/derived.cpp libc/benchmarks/gpu/LibcGpuBenchmark.cpp libc/benchmarks/gpu/LibcGpuBenchmark.h libc/include/llvm-libc-types/fsblkcnt_t.h libc/include/llvm-libc-types/fsfilcnt_t.h libc/src/__support/FPUtil/BasicOperations.h libc/src/__support/FPUtil/generic/FMA.h libc/src/__support/FPUtil/generic/add_sub.h libc/src/__support/FPUtil/generic/div.h libc/src/__support/FPUtil/generic/mul.h libc/src/__support/OSUtil/linux/fcntl.cpp libc/src/__support/libc_assert.h libc/src/__support/threads/linux/raw_mutex.h libc/src/__support/threads/thread.h libc/src/math/generic/copysign.cpp libc/src/math/generic/copysignf.cpp libc/src/math/generic/copysignf16.cpp libc/src/math/generic/expm1.cpp libc/src/math/generic/fabs.cpp libc/src/math/generic/fabsf.cpp libc/src/math/generic/fabsf16.cpp libc/src/stdlib/at_quick_exit.cpp libc/src/stdlib/atexit.cpp libc/src/stdlib/exit_handler.h libc/src/sys/epoll/linux/epoll_pwait2.cpp libc/test/src/__support/blockstore_test.cpp libc/test/src/math/performance_testing/BinaryOpSingleOutputPerf.h libc/test/src/math/performance_testing/SingleInputSingleOutputPerf.h libc/test/src/math/smoke/AddTest.h libc/test/src/math/smoke/DivTest.h libc/test/src/math/smoke/MulTest.h libc/test/src/math/smoke/SubTest.h libc/test/src/sys/statvfs/linux/fstatvfs_test.cpp libc/test/src/sys/statvfs/linux/statvfs_test.cpp libc/utils/MPFRWrapper/MPFRUtils.cpp libcxx/include/__config libcxx/include/__configuration/abi.h libcxx/include/__iterator/bounded_iter.h libcxx/include/__ranges/transform_view.h libcxx/include/string libcxx/include/vector libcxx/test/libcxx/containers/sequences/vector/abi.compile.pass.cpp libcxx/test/libcxx/strings/basic.string/alignof.compile.pass.cpp libcxx/test/libcxx/strings/basic.string/sizeof.compile.pass.cpp libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp libcxx/test/std/ranges/range.adaptors/range.transform/iterator/deref.pass.cpp libcxx/test/std/strings/basic.string/string.capacity/resize_and_overwrite.pass.cpp lld/COFF/Symbols.h lld/ELF/Arch/RISCV.cpp lld/MachO/Driver.cpp lld/MachO/Writer.cpp lldb/include/lldb/Target/DynamicLoader.h lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h llvm/include/llvm/Analysis/TargetTransformInfo.h llvm/include/llvm/Analysis/TargetTransformInfoImpl.h llvm/include/llvm/Analysis/ValueTracking.h llvm/include/llvm/CodeGen/AsmPrinter.h llvm/include/llvm/CodeGen/GlobalISel/GenericMachineInstrs.h llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h llvm/include/llvm/CodeGen/ISDOpcodes.h llvm/include/llvm/CodeGen/Passes.h llvm/include/llvm/CodeGen/RegAllocCommon.h llvm/include/llvm/CodeGen/RegAllocFast.h llvm/include/llvm/CodeGen/TargetInstrInfo.h llvm/include/llvm/ExecutionEngine/Orc/Shared/MemoryFlags.h llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h llvm/include/llvm/MC/MCAsmBackend.h llvm/include/llvm/MC/MCAssembler.h llvm/include/llvm/MC/MCContext.h llvm/include/llvm/MC/MCELFObjectWriter.h llvm/include/llvm/MC/MCELFStreamer.h llvm/include/llvm/MC/MCMachObjectWriter.h llvm/include/llvm/MC/MCObjectWriter.h llvm/include/llvm/MC/MCSPIRVObjectWriter.h llvm/include/llvm/MC/MCSection.h llvm/include/llvm/MC/MCWinCOFFObjectWriter.h llvm/include/llvm/MC/MCWinCOFFStreamer.h llvm/include/llvm/MC/MCXCOFFObjectWriter.h llvm/include/llvm/Passes/PassBuilder.h llvm/include/llvm/ProfileData/InstrProfData.inc llvm/include/llvm/SandboxIR/SandboxIR.h llvm/include/llvm/Support/TimeProfiler.h llvm/include/llvm/Support/raw_socket_stream.h llvm/include/llvm/TargetParser/LoongArchTargetParser.h llvm/include/llvm/TargetParser/RISCVTargetParser.h llvm/include/llvm/TargetParser/Triple.h llvm/include/llvm/Transforms/Instrumentation.h llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h llvm/include/llvm/Transforms/Utils/SimplifyCFGOptions.h llvm/lib/Analysis/Loads.cpp llvm/lib/Analysis/TargetTransformInfo.cpp llvm/lib/Analysis/ValueTracking.cpp llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp llvm/lib/CodeGen/BranchFolding.cpp llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp llvm/lib/CodeGen/RegAllocBase.h llvm/lib/CodeGen/RegAllocBasic.cpp llvm/lib/CodeGen/RegAllocFast.cpp llvm/lib/CodeGen/RegAllocGreedy.cpp llvm/lib/CodeGen/RegAllocGreedy.h llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/lib/CodeGen/StackFrameLayoutAnalysisPass.cpp llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp llvm/lib/IR/Metadata.cpp llvm/lib/MC/ELFObjectWriter.cpp llvm/lib/MC/MCAsmBackend.cpp llvm/lib/MC/MCAssembler.cpp llvm/lib/MC/MCContext.cpp llvm/lib/MC/MCELFStreamer.cpp llvm/lib/MC/MCMachOStreamer.cpp llvm/lib/MC/MCObjectFileInfo.cpp llvm/lib/MC/MCObjectStreamer.cpp llvm/lib/MC/MCObjectWriter.cpp llvm/lib/MC/MCSection.cpp llvm/lib/MC/MCSectionXCOFF.cpp llvm/lib/MC/MCWinCOFFStreamer.cpp llvm/lib/MC/MCXCOFFStreamer.cpp llvm/lib/MC/MachObjectWriter.cpp llvm/lib/MC/SPIRVObjectWriter.cpp llvm/lib/MC/WinCOFFObjectWriter.cpp llvm/lib/MC/XCOFFObjectWriter.cpp llvm/lib/Object/COFFImportFile.cpp llvm/lib/Passes/PassBuilder.cpp llvm/lib/Passes/PassBuilderPipelines.cpp llvm/lib/SandboxIR/SandboxIR.cpp llvm/lib/Support/TimeProfiler.cpp llvm/lib/Support/raw_socket_stream.cpp llvm/lib/Support/xxhash.cpp llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp llvm/lib/Target/AArch64/AArch64FastISel.cpp llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp llvm/lib/Target/AArch64/AArch64ISelLowering.cpp llvm/lib/Target/AArch64/AArch64ISelLowering.h llvm/lib/Target/AArch64/AArch64Subtarget.cpp llvm/lib/Target/AArch64/AArch64Subtarget.h llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp llvm/lib/Target/AMDGPU/AMDGPULateCodeGenPrepare.cpp llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp llvm/lib/Target/AMDGPU/AMDGPULowerBufferFatPointers.cpp llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp llvm/lib/Target/AMDGPU/GCNHazardRecognizer.h llvm/lib/Target/AMDGPU/GCNSubtarget.h llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp llvm/lib/Target/AMDGPU/SIISelLowering.cpp llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp llvm/lib/Target/AVR/MCTargetDesc/AVRELFStreamer.cpp llvm/lib/Target/CSKY/MCTargetDesc/CSKYELFStreamer.cpp llvm/lib/Target/CSKY/MCTargetDesc/CSKYELFStreamer.h llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp llvm/lib/Target/Hexagon/MCTargetDesc/HexagonAsmBackend.cpp llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp llvm/lib/Target/LoongArch/LoongArchISelLowering.h llvm/lib/Target/LoongArch/LoongArchTargetTransformInfo.cpp llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchELFStreamer.cpp llvm/lib/Target/MSP430/MCTargetDesc/MSP430ELFStreamer.cpp llvm/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h llvm/lib/Target/RISCV/RISCVISelLowering.cpp llvm/lib/Target/RISCV/RISCVTargetMachine.cpp llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp llvm/lib/Target/SPIRV/SPIRVAsmPrinter.cpp llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp llvm/lib/Target/X86/X86ISelLowering.cpp llvm/lib/Target/X86/X86TargetMachine.cpp llvm/lib/Target/X86/X86TargetTransformInfo.cpp llvm/lib/Target/X86/X86TargetTransformInfo.h llvm/lib/TargetParser/Host.cpp llvm/lib/TargetParser/LoongArchTargetParser.cpp llvm/lib/TargetParser/RISCVTargetParser.cpp llvm/lib/TargetParser/Triple.cpp llvm/lib/Transforms/Coroutines/CoroEarly.cpp llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp llvm/lib/Transforms/Utils/DXILResource.cpp llvm/lib/Transforms/Utils/LoopUnroll.cpp llvm/lib/Transforms/Utils/SimplifyCFG.cpp llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp llvm/lib/Transforms/Vectorize/LoopVectorize.cpp llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp llvm/lib/Transforms/Vectorize/VPlan.h llvm/tools/llvm-profgen/PerfReader.cpp llvm/unittests/SandboxIR/SandboxIRTest.cpp llvm/unittests/Support/raw_socket_stream_test.cpp llvm/unittests/TargetParser/RISCVISAInfoTest.cpp llvm/unittests/TargetParser/TripleTest.cpp llvm/utils/TableGen/RISCVTargetDefEmitter.cpp mlir/include/mlir-c/BuiltinTypes.h mlir/include/mlir/Dialect/Utils/IndexingUtils.h mlir/include/mlir/IR/Builders.h mlir/include/mlir/IR/BuiltinTypes.h mlir/include/mlir/IR/Types.h mlir/lib/AsmParser/TypeParser.cpp mlir/lib/Bindings/Python/IRTypes.cpp mlir/lib/CAPI/IR/BuiltinTypes.cpp mlir/lib/Conversion/LLVMCommon/TypeConverter.cpp mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp mlir/lib/Dialect/Arith/Transforms/EmulateUnsupportedFloats.cpp mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp mlir/lib/Dialect/Utils/IndexingUtils.cpp mlir/lib/IR/AffineExpr.cpp mlir/lib/IR/AsmPrinter.cpp mlir/lib/IR/Builders.cpp mlir/lib/IR/BuiltinTypes.cpp mlir/lib/IR/MLIRContext.cpp mlir/lib/IR/Types.cpp mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp mlir/lib/Target/LLVMIR/ModuleImport.cpp mlir/lib/Transforms/Utils/DialectConversion.cpp mlir/unittests/IR/AffineExprTest.cpp mlir/unittests/IR/ShapedTypeTest.cpp offload/DeviceRTL/src/Parallelism.cpp libcxx/test/libcxx/containers/sequences/vector/debug.iterator.add.pass.cpp libcxx/test/libcxx/containers/sequences/vector/debug.iterator.decrement.pass.cpp libcxx/test/libcxx/containers/sequences/vector/debug.iterator.dereference.pass.cpp libcxx/test/libcxx/containers/sequences/vector/debug.iterator.increment.pass.cpp libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.add.pass.cpp libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.decrement.pass.cpp libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.dereference.pass.cpp libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.increment.pass.cpp libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.index.pass.cpp
View the diff from clang-format here.
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 5af712dd72..8af3a724a1 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -12956,8 +12956,11 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
           // and _Atomic(T) is appropriately-aligned.
           return Success(1, E);
 
-        QualType PointeeType = E->getArg(1)->IgnoreImpCasts()->getType()->
-          castAs<PointerType>()->getPointeeType();
+        QualType PointeeType = E->getArg(1)
+                                   ->IgnoreImpCasts()
+                                   ->getType()
+                                   ->castAs<PointerType>()
+                                   ->getPointeeType();
         if (!PointeeType->isIncompleteType() &&
             Info.Ctx.getTypeAlignInChars(PointeeType) >= Size) {
           // OK, we will inline operations on this object.
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index d582aba679..52f250d74d 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -5890,7 +5890,8 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
       unsigned unpaddedIndex = 0;
       for (unsigned i = 0, e = coercionType->getNumElements(); i != e; ++i) {
         llvm::Type *eltType = coercionType->getElementType(i);
-        if (ABIArgInfo::isPaddingForCoerceAndExpand(eltType)) continue;
+        if (ABIArgInfo::isPaddingForCoerceAndExpand(eltType))
+          continue;
         Address eltAddr = Builder.CreateStructGEP(addr, i);
         llvm::Value *elt = CI;
         if (requiresExtract)
@@ -5937,7 +5938,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
           return RValue::getAggregate(DestPtr);
         }
         case TEK_Scalar: {
-          // If the argument doesn't match, perform a bitcast to coerce it.  This
+          // If the argument doesn't match, perform a bitcast to coerce it. This
           // can happen due to trivial type mismatches.
           llvm::Value *V = CI;
           if (V->getType() != RetIRTy)
@@ -5989,7 +5990,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
     }
 
     llvm_unreachable("Unhandled ABIArgInfo::Kind");
-  } ();
+  }();
 
   // Emit the assume_aligned check on the return value.
   if (Ret.isScalar() && TargetDecl) {
diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp
index 37b436a21f..833a726d3b 100644
--- a/clang/lib/CodeGen/ItaniumCXXABI.cpp
+++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp
@@ -425,31 +425,31 @@ public:
   LoadVTablePtr(CodeGenFunction &CGF, Address This,
                 const CXXRecordDecl *RD) override;
 
- private:
-   bool hasAnyUnusedVirtualInlineFunction(const CXXRecordDecl *RD) const {
-     const auto &VtableLayout =
-         CGM.getItaniumVTableContext().getVTableLayout(RD);
-
-     for (const auto &VtableComponent : VtableLayout.vtable_components()) {
-       // Skip empty slot.
-       if (!VtableComponent.isUsedFunctionPointerKind())
-         continue;
-
-       const CXXMethodDecl *Method = VtableComponent.getFunctionDecl();
-       if (!Method->getCanonicalDecl()->isInlined())
-         continue;
-
-       StringRef Name = CGM.getMangledName(VtableComponent.getGlobalDecl());
-       auto *Entry = CGM.GetGlobalValue(Name);
-       // This checks if virtual inline function has already been emitted.
-       // Note that it is possible that this inline function would be emitted
-       // after trying to emit vtable speculatively. Because of this we do
-       // an extra pass after emitting all deferred vtables to find and emit
-       // these vtables opportunistically.
-       if (!Entry || Entry->isDeclaration())
-         return true;
-     }
-     return false;
+private:
+  bool hasAnyUnusedVirtualInlineFunction(const CXXRecordDecl *RD) const {
+    const auto &VtableLayout =
+        CGM.getItaniumVTableContext().getVTableLayout(RD);
+
+    for (const auto &VtableComponent : VtableLayout.vtable_components()) {
+      // Skip empty slot.
+      if (!VtableComponent.isUsedFunctionPointerKind())
+        continue;
+
+      const CXXMethodDecl *Method = VtableComponent.getFunctionDecl();
+      if (!Method->getCanonicalDecl()->isInlined())
+        continue;
+
+      StringRef Name = CGM.getMangledName(VtableComponent.getGlobalDecl());
+      auto *Entry = CGM.GetGlobalValue(Name);
+      // This checks if virtual inline function has already been emitted.
+      // Note that it is possible that this inline function would be emitted
+      // after trying to emit vtable speculatively. Because of this we do
+      // an extra pass after emitting all deferred vtables to find and emit
+      // these vtables opportunistically.
+      if (!Entry || Entry->isDeclaration())
+        return true;
+    }
+    return false;
   }
 
   bool isVTableHidden(const CXXRecordDecl *RD) const {
@@ -876,10 +876,9 @@ llvm::Value *ItaniumCXXABI::EmitMemberDataPointerAddress(
 /// MP when the derived MP does not point to a member of the base.
 /// This is why -1 is a reasonable choice for null data member
 /// pointers.
-llvm::Value *
-ItaniumCXXABI::EmitMemberPointerConversion(CodeGenFunction &CGF,
-                                           const CastExpr *E,
-                                           llvm::Value *src) {
+llvm::Value *ItaniumCXXABI::EmitMemberPointerConversion(CodeGenFunction &CGF,
+                                                        const CastExpr *E,
+                                                        llvm::Value *src) {
   assert(E->getCastKind() == CK_DerivedToBaseMemberPointer ||
          E->getCastKind() == CK_BaseToDerivedMemberPointer ||
          E->getCastKind() == CK_ReinterpretMemberPointer);
diff --git a/clang/lib/Serialization/ASTReaderStmt.cpp b/clang/lib/Serialization/ASTReaderStmt.cpp
index a7fe20bd0a..f918b3779f 100644
--- a/clang/lib/Serialization/ASTReaderStmt.cpp
+++ b/clang/lib/Serialization/ASTReaderStmt.cpp
@@ -932,9 +932,8 @@ void ASTStmtReader::VisitRequiresExpr(RequiresExpr *E) {
         if (E->isInstantiationDependent())
           R = new (Record.getContext()) concepts::NestedRequirement(E);
         else
-          R = new (Record.getContext())
-              concepts::NestedRequirement(Record.getContext(), E,
-                                          readConstraintSatisfaction(Record));
+          R = new (Record.getContext()) concepts::NestedRequirement(
+              Record.getContext(), E, readConstraintSatisfaction(Record));
       } break;
     }
     if (!R)
diff --git a/clang/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp
index 1a75d7b52a..c9518189d7 100644
--- a/clang/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp
@@ -31,7 +31,6 @@ class BuiltinFunctionChecker : public Checker<eval::Call> {
 public:
   bool evalCall(const CallEvent &Call, CheckerContext &C) const;
 };
-
 }
 
 bool BuiltinFunctionChecker::evalCall(const CallEvent &Call,
diff --git a/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/iter_move.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/iter_move.pass.cpp
index ea1e4b6141..5c2d7513c2 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/iter_move.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/iter_move.pass.cpp
@@ -33,9 +33,9 @@ constexpr bool test() {
 
   {
     LIBCPP_ASSERT_NOEXCEPT(std::ranges::iter_move(
-      std::declval<std::ranges::iterator_t<std::ranges::transform_view<MoveOnlyView, PlusOneNoexcept>>&>()));
+        std::declval<std::ranges::iterator_t<std::ranges::transform_view<MoveOnlyView, PlusOneNoexcept>>&>()));
     ASSERT_NOT_NOEXCEPT(std::ranges::iter_move(
-      std::declval<std::ranges::iterator_t<std::ranges::transform_view<MoveOnlyView, PlusOneMutable>>&>()));
+        std::declval<std::ranges::iterator_t<std::ranges::transform_view<MoveOnlyView, PlusOneMutable>>&>()));
   }
 
   return true;
diff --git a/llvm/include/llvm/MC/MCAssembler.h b/llvm/include/llvm/MC/MCAssembler.h
index 4b08d50de9..abfe932dcd 100644
--- a/llvm/include/llvm/MC/MCAssembler.h
+++ b/llvm/include/llvm/MC/MCAssembler.h
@@ -65,8 +65,8 @@ public:
   using VersionInfoType = struct {
     bool EmitBuildVersion;
     union {
-      MCVersionMinType Type;          ///< Used when EmitBuildVersion==false.
-      MachO::PlatformType Platform;   ///< Used when EmitBuildVersion==true.
+      MCVersionMinType Type;        ///< Used when EmitBuildVersion==false.
+      MachO::PlatformType Platform; ///< Used when EmitBuildVersion==true.
     } TypeOrPlatform;
     unsigned Major;
     unsigned Minor;
diff --git a/llvm/include/llvm/TargetParser/Triple.h b/llvm/include/llvm/TargetParser/Triple.h
index b3bb354b38..46e2d54268 100644
--- a/llvm/include/llvm/TargetParser/Triple.h
+++ b/llvm/include/llvm/TargetParser/Triple.h
@@ -268,7 +268,7 @@ public:
     Cygnus,
     CoreCLR,
     Simulator, // Simulator variants of other systems, e.g., Apple's iOS
-    MacABI, // Mac Catalyst variant of Apple's iOS deployment target.
+    MacABI,    // Mac Catalyst variant of Apple's iOS deployment target.
 
     // Shader Stages
     // The order of these values matters, and must be kept in sync with the
diff --git a/llvm/lib/CodeGen/RegAllocBasic.cpp b/llvm/lib/CodeGen/RegAllocBasic.cpp
index e78a447969..0d67245495 100644
--- a/llvm/lib/CodeGen/RegAllocBasic.cpp
+++ b/llvm/lib/CodeGen/RegAllocBasic.cpp
@@ -168,10 +168,8 @@ void RABasic::LRE_WillShrinkVirtReg(Register VirtReg) {
   enqueue(&LI);
 }
 
-RABasic::RABasic(RegClassFilterFunc F):
-  MachineFunctionPass(ID),
-  RegAllocBase(F) {
-}
+RABasic::RABasic(RegClassFilterFunc F)
+    : MachineFunctionPass(ID), RegAllocBase(F) {}
 
 void RABasic::getAnalysisUsage(AnalysisUsage &AU) const {
   AU.setPreservesCFG();
@@ -333,6 +331,6 @@ FunctionPass* llvm::createBasicRegisterAllocator() {
   return new RABasic();
 }
 
-FunctionPass* llvm::createBasicRegisterAllocator(RegClassFilterFunc F) {
+FunctionPass *llvm::createBasicRegisterAllocator(RegClassFilterFunc F) {
   return new RABasic(F);
 }
diff --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp
index 310050d92d..941bf5b8f4 100644
--- a/llvm/lib/CodeGen/RegAllocGreedy.cpp
+++ b/llvm/lib/CodeGen/RegAllocGreedy.cpp
@@ -196,10 +196,8 @@ FunctionPass *llvm::createGreedyRegisterAllocator(RegClassFilterFunc Ftor) {
   return new RAGreedy(Ftor);
 }
 
-RAGreedy::RAGreedy(RegClassFilterFunc F):
-  MachineFunctionPass(ID),
-  RegAllocBase(F) {
-}
+RAGreedy::RAGreedy(RegClassFilterFunc F)
+    : MachineFunctionPass(ID), RegAllocBase(F) {}
 
 void RAGreedy::getAnalysisUsage(AnalysisUsage &AU) const {
   AU.setPreservesCFG();
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 9b2153c68c..b68645871c 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -13784,7 +13784,8 @@ SDValue DAGCombiner::visitSIGN_EXTEND(SDNode *N) {
 /// destination type, widen the pop-count to the destination type.
 static SDValue widenCtPop(SDNode *Extend, SelectionDAG &DAG) {
   assert((Extend->getOpcode() == ISD::ZERO_EXTEND ||
-          Extend->getOpcode() == ISD::ANY_EXTEND) && "Expected extend op");
+          Extend->getOpcode() == ISD::ANY_EXTEND) &&
+         "Expected extend op");
 
   SDValue CtPop = Extend->getOperand(0);
   if (CtPop.getOpcode() != ISD::CTPOP || !CtPop.hasOneUse())
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index 59d796b419..b883d933f7 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -1526,7 +1526,7 @@ std::unique_ptr<MCObjectWriter>
 llvm::createELFObjectWriter(std::unique_ptr<MCELFObjectTargetWriter> MOTW,
                             raw_pwrite_stream &OS, bool IsLittleEndian) {
   return std::make_unique<ELFSingleObjectWriter>(std::move(MOTW), OS,
-                                                  IsLittleEndian);
+                                                 IsLittleEndian);
 }
 
 std::unique_ptr<MCObjectWriter>
@@ -1534,5 +1534,5 @@ llvm::createELFDwoObjectWriter(std::unique_ptr<MCELFObjectTargetWriter> MOTW,
                                raw_pwrite_stream &OS, raw_pwrite_stream &DwoOS,
                                bool IsLittleEndian) {
   return std::make_unique<ELFDwoObjectWriter>(std::move(MOTW), OS, DwoOS,
-                                               IsLittleEndian);
+                                              IsLittleEndian);
 }
diff --git a/llvm/lib/MC/MCELFStreamer.cpp b/llvm/lib/MC/MCELFStreamer.cpp
index 38ebaccf3b..75da15bfeb 100644
--- a/llvm/lib/MC/MCELFStreamer.cpp
+++ b/llvm/lib/MC/MCELFStreamer.cpp
@@ -86,10 +86,14 @@ void MCELFStreamer::emitAssemblerFlag(MCAssemblerFlag Flag) {
   getAssembler().getBackend().handleAssemblerFlag(Flag);
   // Do any generic stuff we need to do.
   switch (Flag) {
-  case MCAF_SyntaxUnified: return; // no-op here.
-  case MCAF_Code16: return; // Change parsing mode; no-op here.
-  case MCAF_Code32: return; // Change parsing mode; no-op here.
-  case MCAF_Code64: return; // Change parsing mode; no-op here.
+  case MCAF_SyntaxUnified:
+    return; // no-op here.
+  case MCAF_Code16:
+    return; // Change parsing mode; no-op here.
+  case MCAF_Code32:
+    return; // Change parsing mode; no-op here.
+  case MCAF_Code64:
+    return; // Change parsing mode; no-op here.
   case MCAF_SubsectionsViaSymbols:
     getAssembler().setSubsectionsViaSymbols(true);
     return;
diff --git a/llvm/lib/SandboxIR/SandboxIR.cpp b/llvm/lib/SandboxIR/SandboxIR.cpp
index 209b677baf..a9a39a9efe 100644
--- a/llvm/lib/SandboxIR/SandboxIR.cpp
+++ b/llvm/lib/SandboxIR/SandboxIR.cpp
@@ -626,7 +626,7 @@ Value *Context::registerValue(std::unique_ptr<Value> &&VPtr) {
          "Can't register a user!");
   Value *V = VPtr.get();
   [[maybe_unused]] auto Pair =
-         LLVMValueToValueMap.insert({VPtr->Val, std::move(VPtr)});
+      LLVMValueToValueMap.insert({VPtr->Val, std::move(VPtr)});
   assert(Pair.second && "Already exists!");
   return V;
 }
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
index 192996f84c..0c01555259 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
@@ -94,7 +94,6 @@ static bool onlyAllocateVGPRs(const TargetRegisterInfo &TRI,
   return !static_cast<const SIRegisterInfo &>(TRI).isSGPRClass(&RC);
 }
 
-
 /// -{sgpr|vgpr}-regalloc=... command line option.
 static FunctionPass *useDefaultRegisterAllocator() { return nullptr; }
 
diff --git a/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp b/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
index 8b42d4a1de..5ab3ab8bf9 100644
--- a/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
+++ b/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
@@ -216,7 +216,8 @@ private:
                                    CombineInfo &Paired, bool Modify = false);
   static bool widthsFit(const GCNSubtarget &STI, const CombineInfo &CI,
                         const CombineInfo &Paired);
-  static unsigned getNewOpcode(const CombineInfo &CI, const CombineInfo &Paired);
+  static unsigned getNewOpcode(const CombineInfo &CI,
+                               const CombineInfo &Paired);
   static std::pair<unsigned, unsigned> getSubRegIdxs(const CombineInfo &CI,
                                                      const CombineInfo &Paired);
   const TargetRegisterClass *
diff --git a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
index d74143b487..9c8afd73f2 100644
--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -908,7 +908,8 @@ void PPCAsmPrinter::emitInstruction(const MachineInstr *MI) {
 
   // Lower multi-instruction pseudo operations.
   switch (MI->getOpcode()) {
-  default: break;
+  default:
+    break;
   case TargetOpcode::DBG_VALUE:
     llvm_unreachable("Should be handled target independently");
   case TargetOpcode::STACKMAP:
diff --git a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
index f9eef60f77..06fca7405a 100644
--- a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
+++ b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
@@ -1688,7 +1688,6 @@ InstructionCost RISCVTTIImpl::getArithmeticInstrCost(
     return BaseT::getArithmeticInstrCost(Opcode, Ty, CostKind, Op1Info, Op2Info,
                                          Args, CxtI);
 
-
   auto getConstantMatCost =
     [&](unsigned Operand, TTI::OperandValueInfo OpInfo) -> InstructionCost {
     if (OpInfo.isUniform() && TLI->canSplatOperand(Opcode, Operand))
diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp
index 4fc1ff5aaa..a9bf9a366f 100644
--- a/llvm/lib/TargetParser/Triple.cpp
+++ b/llvm/lib/TargetParser/Triple.cpp
@@ -351,7 +351,8 @@ StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) {
   case Amplification: return "amplification";
   case OpenCL:
     return "opencl";
-  case OpenHOS: return "ohos";
+  case OpenHOS:
+    return "ohos";
   }
 
   llvm_unreachable("Invalid EnvironmentType!");
diff --git a/llvm/lib/Transforms/Coroutines/CoroEarly.cpp b/llvm/lib/Transforms/Coroutines/CoroEarly.cpp
index 489106422e..65b5ca9daf 100644
--- a/llvm/lib/Transforms/Coroutines/CoroEarly.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroEarly.cpp
@@ -145,9 +145,9 @@ void Lowerer::lowerCoroNoop(IntrinsicInst *II) {
     // Create a constant struct for the frame.
     Constant* Values[] = {NoopFn, NoopFn};
     Constant* NoopCoroConst = ConstantStruct::get(FrameTy, Values);
-    NoopCoro = new GlobalVariable(M, NoopCoroConst->getType(), /*isConstant=*/true,
-                                GlobalVariable::PrivateLinkage, NoopCoroConst,
-                                "NoopCoro.Frame.Const");
+    NoopCoro = new GlobalVariable(
+        M, NoopCoroConst->getType(), /*isConstant=*/true,
+        GlobalVariable::PrivateLinkage, NoopCoroConst, "NoopCoro.Frame.Const");
   }
 
   Builder.SetInsertPoint(II);
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index 149866a8e4..7219386399 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -2946,7 +2946,8 @@ bool AddressSanitizer::instrumentFunction(Function &F,
     return false;
   if (F.getLinkage() == GlobalValue::AvailableExternallyLinkage) return false;
   if (!ClDebugFunc.empty() && ClDebugFunc == F.getName()) return false;
-  if (F.getName().starts_with("__asan_")) return false;
+  if (F.getName().starts_with("__asan_"))
+    return false;
 
   bool FunctionModified = false;
 
diff --git a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
index b7baf34f27..bbfab744aa 100644
--- a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
+++ b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
@@ -77,7 +77,6 @@ static cl::opt<bool> UserSinkCommonInsts(
     "sink-common-insts", cl::Hidden, cl::init(false),
     cl::desc("Sink common instructions (default = false)"));
 
-
 STATISTIC(NumSimpl, "Number of blocks simplified");
 
 static bool
diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
index 9372caf6e3..1241651911 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
@@ -1182,7 +1182,7 @@ void CallOp::print(OpAsmPrinter &p) {
   if (getCConv() != LLVM::CConv::C)
     p << stringifyCConv(getCConv()) << ' ';
 
-  if(getTailCallKind() != LLVM::TailCallKind::None)
+  if (getTailCallKind() != LLVM::TailCallKind::None)
     p << tailcallkind::stringifyTailCallKind(getTailCallKind()) << ' ';
 
   // Print the direct callee if present as a function attribute, or an indirect
@@ -1198,9 +1198,9 @@ void CallOp::print(OpAsmPrinter &p) {
   if (isVarArg)
     p << " vararg(" << calleeType << ")";
 
-  p.printOptionalAttrDict(processFMFAttr((*this)->getAttrs()),
-                          {getCConvAttrName(), "callee", "callee_type",
-                           getTailCallKindAttrName()});
+  p.printOptionalAttrDict(
+      processFMFAttr((*this)->getAttrs()),
+      {getCConvAttrName(), "callee", "callee_type", getTailCallKindAttrName()});
 
   p << " : ";
   if (!isDirect)
diff --git a/mlir/lib/IR/BuiltinTypes.cpp b/mlir/lib/IR/BuiltinTypes.cpp
index 179797cb94..9c01ab0ba5 100644
--- a/mlir/lib/IR/BuiltinTypes.cpp
+++ b/mlir/lib/IR/BuiltinTypes.cpp
@@ -88,7 +88,7 @@ IntegerType IntegerType::scaleElementBitwidth(unsigned scale) {
 
 unsigned FloatType::getWidth() {
   if (llvm::isa<Float8E5M2Type, Float8E4M3FNType, Float8E5M2FNUZType,
-          Float8E4M3FNUZType, Float8E4M3B11FNUZType>(*this))
+                Float8E4M3FNUZType, Float8E4M3B11FNUZType>(*this))
     return 8;
   if (llvm::isa<Float16Type, BFloat16Type>(*this))
     return 16;

@bradenhelmer bradenhelmer deleted the diag-mismatch-97878 branch July 23, 2024 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:AArch64 backend:AMDGPU backend:ARM backend:DirectX backend:Hexagon backend:loongarch backend:MSP430 backend:NVPTX backend:PowerPC backend:RISC-V backend:SPIR-V backend:SystemZ backend:X86 bazel "Peripheral" support tier build system: utils/bazel BOLT clang:analysis clang:codegen clang:dataflow Clang Dataflow Analysis framework - https://clang.llvm.org/docs/DataFlowAnalysisIntro.html clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:modules C++20 modules and Clang Header Modules clang:openmp OpenMP related changes to Clang clang:static analyzer clang Clang issues not falling into any other category clang-format clang-tidy clang-tools-extra clangd cmake Build system in general and CMake in particular compiler-rt:asan Address sanitizer compiler-rt:builtins compiler-rt:hwasan Hardware-assisted address sanitizer compiler-rt:sanitizer compiler-rt:scudo Scudo Hardened Allocator compiler-rt coroutines C++20 coroutines debuginfo flang:codegen flang:fir-hlfir flang:openmp flang:runtime flang Flang issues not falling into any other category github:workflow HLSL HLSL Language Support libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. libc lld:COFF lld:ELF lld:MachO lld lldb llvm:analysis llvm:binary-utilities llvm:globalisel llvm:ir llvm:SelectionDAG SelectionDAGISel as well llvm:support llvm:transforms llvm-lit mc Machine (object) code mlir:arith mlir:core MLIR Core Infrastructure mlir:linalg mlir:llvm mlir:ods mlir:openmp mlir:python MLIR Python bindings mlir:spirv mlir:vector mlir:vectorops mlir offload openmp:libomp OpenMP host runtime openmp:libomptarget OpenMP offload runtime PGO Profile Guided Optimizations platform:windows testing-tools vectorization
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Clang] Confusing mismatch in diagnostics related to explicit this parameters
3 participants