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 HEAD~1 HEAD --extensions h,cpp -- clang/test/Sema/fdump_auto-type-inference.cpp clang/include/clang/Basic/LangOptions.h clang/include/clang/Sema/Sema.h clang/lib/Sema/Sema.cpp clang/lib/Sema/SemaDecl.cpp clang/lib/Sema/SemaStmt.cpp `````````` </details> <details> <summary> View the diff from clang-format here. </summary> ``````````diff diff --git a/clang/include/clang/Basic/LangOptions.h b/clang/include/clang/Basic/LangOptions.h index f80ccb7ee..aee773d09 100644 --- a/clang/include/clang/Basic/LangOptions.h +++ b/clang/include/clang/Basic/LangOptions.h @@ -510,7 +510,7 @@ public: SanitizerSet Sanitize; /// Is at least one coverage instrumentation type enabled. bool SanitizeCoverage = false; - + bool DumpAutoTypeInference = false; /// Paths to files specifying which objects /// (files, functions, variables) should not be instrumented. diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h index c955766cf..781f0a509 100644 --- a/clang/include/clang/Sema/Sema.h +++ b/clang/include/clang/Sema/Sema.h @@ -89,10 +89,10 @@ #include "llvm/ADT/StringMap.h" #include "llvm/ADT/TinyPtrVector.h" #include "llvm/Support/Allocator.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/Error.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/CommandLine.h" #include <cassert> #include <climits> #include <cstddef> @@ -108,15 +108,12 @@ #include <utility> #include <vector> - - namespace opts { // Option for dumping auto type inference extern llvm::cl::OptionCategory DumpAutoInference; extern llvm::cl::opt<bool> DumpAutoTypeInference; } // namespace opts - namespace llvm { struct InlineAsmIdentifierInfo; } // namespace llvm @@ -933,14 +930,12 @@ public: /// Print out statistics about the semantic analysis. void PrintStats() const; - /// Emits diagnostic remark indicating the compiler-deduced types and return + /// Emits diagnostic remark indicating the compiler-deduced types and return /// type for variables and functions void DumpAutoTypeInference(SourceManager &SM, SourceLocation Loc, bool isVar, ASTContext &Context, llvm::StringRef Name, QualType DeducedType); - - /// Run some code with "sufficient" stack space. (Currently, at least 256K is /// guaranteed). Produces a warning if we're low on stack space and allocates /// more in that case. Use this in code that may recurse deeply (for example, diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index 707d7c0d5..e735b2529 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -84,8 +84,9 @@ namespace opts { llvm::cl::OptionCategory DumpAutoInference("DumpAutoInference"); llvm::cl::opt<bool> DumpAutoTypeInference{ "fdump-auto-type-inference", - llvm::cl::desc("Dump compiler-deduced type for variables and return expressions declared using C++ 'auto' keyword"), llvm::cl::ZeroOrMore, - llvm::cl::cat(DumpAutoInference)}; + llvm::cl::desc("Dump compiler-deduced type for variables and return " + "expressions declared using C++ 'auto' keyword"), + llvm::cl::ZeroOrMore, llvm::cl::cat(DumpAutoInference)}; } // namespace opts SourceLocation Sema::getLocForEndOfToken(SourceLocation Loc, unsigned Offset) { @@ -651,8 +652,6 @@ void Sema::DumpAutoTypeInference(SourceManager &SM, SourceLocation Loc, } } - - void Sema::runWithSufficientStackSpace(SourceLocation Loc, llvm::function_ref<void()> Fn) { StackHandler.runWithSufficientStackSpace(Loc, Fn); diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index de3a662d6..643135b10 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -13159,7 +13159,7 @@ bool Sema::DeduceVariableDeclarationType(VarDecl *VDecl, bool DirectInit, VDecl->setType(DeducedType); assert(VDecl->isLinkageValid()); - + // Emit a remark indicating the compiler-deduced type for variables declared // using the C++ 'auto' keyword SourceManager &SM = getSourceManager(); diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index a5406d279..796e81a58 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -3834,7 +3834,7 @@ bool Sema::DeduceFunctionTypeFromReturnExpr(FunctionDecl *FD, // Update all declarations of the function to have the deduced return type. Context.adjustDeducedFunctionResultType(FD, Deduced); - // Emit a remark indicating the compiler-deduced return type for functions + // Emit a remark indicating the compiler-deduced return type for functions // declared using the C++ 'auto' keyword SourceManager &SM = getSourceManager(); Sema::DumpAutoTypeInference(SM, FD->getLocation(), false, Context, `````````` </details> https://github.com/llvm/llvm-project/pull/144478 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits