[Lldb-commits] [lldb] b12fd13 - Fix bugprone argument comments.

Kazu Hirata via lldb-commits lldb-commits at lists.llvm.org
Sun Jan 9 12:21:21 PST 2022


Author: Kazu Hirata
Date: 2022-01-09T12:21:02-08:00
New Revision: b12fd138127e368a5d78109bef77713c0bcd536e

URL: https://github.com/llvm/llvm-project/commit/b12fd138127e368a5d78109bef77713c0bcd536e
DIFF: https://github.com/llvm/llvm-project/commit/b12fd138127e368a5d78109bef77713c0bcd536e.diff

LOG: Fix bugprone argument comments.

Identified by bugprone-argument-comment.

Added: 
    

Modified: 
    clang-tools-extra/clang-tidy/cppcoreguidelines/VirtualClassDestructorCheck.cpp
    clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
    clang-tools-extra/clangd/CodeComplete.cpp
    clang-tools-extra/clangd/SourceCode.cpp
    clang/lib/Sema/SemaTemplateDeduction.cpp
    lld/MachO/SyntheticSections.cpp
    lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp
    lldb/source/Expression/DWARFExpression.cpp
    lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
    lldb/source/Symbol/Function.cpp
    lldb/source/Target/TraceInstructionDumper.cpp
    lldb/source/Utility/Reproducer.cpp
    polly/include/polly/ScopPass.h

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/VirtualClassDestructorCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/VirtualClassDestructorCheck.cpp
index fa5e06c8e7b26..d6af020326eb0 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/VirtualClassDestructorCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/VirtualClassDestructorCheck.cpp
@@ -173,11 +173,11 @@ void VirtualClassDestructorCheck::check(
          "destructor of %0 is private and prevents using the type")
         << MatchedClassOrStruct;
     diag(MatchedClassOrStruct->getLocation(),
-         /*FixDescription=*/"make it public and virtual", DiagnosticIDs::Note)
+         /*Description=*/"make it public and virtual", DiagnosticIDs::Note)
         << changePrivateDestructorVisibilityTo(
                "public", *Destructor, *Result.SourceManager, getLangOpts());
     diag(MatchedClassOrStruct->getLocation(),
-         /*FixDescription=*/"make it protected", DiagnosticIDs::Note)
+         /*Description=*/"make it protected", DiagnosticIDs::Note)
         << changePrivateDestructorVisibilityTo(
                "protected", *Destructor, *Result.SourceManager, getLangOpts());
 

diff  --git a/clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp b/clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
index 882d254c6d9ea..411d6db582436 100644
--- a/clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
@@ -130,7 +130,7 @@ void DefinitionsInHeadersCheck::check(const MatchFinder::MatchResult &Result) {
     // inline is not allowed for main function.
     if (FD->isMain())
       return;
-    diag(FD->getLocation(), /*FixDescription=*/"make as 'inline'",
+    diag(FD->getLocation(), /*Description=*/"make as 'inline'",
          DiagnosticIDs::Note)
         << FixItHint::CreateInsertion(FD->getInnerLocStart(), "inline ");
   } else if (const auto *VD = dyn_cast<VarDecl>(ND)) {

diff  --git a/clang-tools-extra/clangd/CodeComplete.cpp b/clang-tools-extra/clangd/CodeComplete.cpp
index 50388e08c30aa..d9165599fb9ab 100644
--- a/clang-tools-extra/clangd/CodeComplete.cpp
+++ b/clang-tools-extra/clangd/CodeComplete.cpp
@@ -420,7 +420,7 @@ struct CodeCompletionBuilder {
         SetDoc(C.IndexResult->Documentation);
       } else if (C.SemaResult) {
         const auto DocComment = getDocComment(*ASTCtx, *C.SemaResult,
-                                              /*CommentsFromHeader=*/false);
+                                              /*CommentsFromHeaders=*/false);
         SetDoc(formatDocumentation(*SemaCCS, DocComment));
       }
     }
@@ -959,9 +959,9 @@ class SignatureHelpCollector final : public CodeCompleteConsumer {
             paramIndexForArg(Candidate, SigHelp.activeParameter);
       }
 
-      const auto *CCS =
-          Candidate.CreateSignatureString(CurrentArg, S, *Allocator, CCTUInfo,
-                                          /*IncludeBriefComment=*/true, Braced);
+      const auto *CCS = Candidate.CreateSignatureString(
+          CurrentArg, S, *Allocator, CCTUInfo,
+          /*IncludeBriefComments=*/true, Braced);
       assert(CCS && "Expected the CodeCompletionString to be non-null");
       ScoredSignatures.push_back(processOverloadCandidate(
           Candidate, *CCS,

diff  --git a/clang-tools-extra/clangd/SourceCode.cpp b/clang-tools-extra/clangd/SourceCode.cpp
index f3a60d6419513..6f6d936ac3a7e 100644
--- a/clang-tools-extra/clangd/SourceCode.cpp
+++ b/clang-tools-extra/clangd/SourceCode.cpp
@@ -457,7 +457,7 @@ llvm::Expected<SourceLocation> sourceLocationInMainFile(const SourceManager &SM,
                                                         Position P) {
   llvm::StringRef Code = SM.getBufferOrFake(SM.getMainFileID()).getBuffer();
   auto Offset =
-      positionToOffset(Code, P, /*AllowColumnBeyondLineLength=*/false);
+      positionToOffset(Code, P, /*AllowColumnsBeyondLineLength=*/false);
   if (!Offset)
     return Offset.takeError();
   return SM.getLocForStartOfFile(SM.getMainFileID()).getLocWithOffset(*Offset);

diff  --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp
index 8e1f1d294d6ec..22dd395d99439 100644
--- a/clang/lib/Sema/SemaTemplateDeduction.cpp
+++ b/clang/lib/Sema/SemaTemplateDeduction.cpp
@@ -5355,7 +5355,7 @@ static bool isAtLeastAsSpecializedAs(Sema &S, QualType T1, QualType T2,
   bool AtLeastAsSpecialized;
   S.runWithSufficientStackSpace(Info.getLocation(), [&] {
     AtLeastAsSpecialized = !FinishTemplateArgumentDeduction(
-        S, P2, /*PartialOrdering=*/true,
+        S, P2, /*IsPartialOrdering=*/true,
         TemplateArgumentList(TemplateArgumentList::OnStack,
                              TST1->template_arguments()),
         Deduced, Info);

diff  --git a/lld/MachO/SyntheticSections.cpp b/lld/MachO/SyntheticSections.cpp
index b64a9db485c50..398f2e7e1c092 100644
--- a/lld/MachO/SyntheticSections.cpp
+++ b/lld/MachO/SyntheticSections.cpp
@@ -1474,7 +1474,7 @@ void WordLiteralSection::writeTo(uint8_t *buf) const {
 void macho::createSyntheticSymbols() {
   auto addHeaderSymbol = [](const char *name) {
     symtab->addSynthetic(name, in.header->isec, /*value=*/0,
-                         /*privateExtern=*/true, /*includeInSymtab=*/false,
+                         /*isPrivateExtern=*/true, /*includeInSymtab=*/false,
                          /*referencedDynamically=*/false);
   };
 
@@ -1487,11 +1487,11 @@ void macho::createSyntheticSymbols() {
     // Otherwise, it's an absolute symbol.
     if (config->isPic)
       symtab->addSynthetic("__mh_execute_header", in.header->isec, /*value=*/0,
-                           /*privateExtern=*/false, /*includeInSymtab=*/true,
+                           /*isPrivateExtern=*/false, /*includeInSymtab=*/true,
                            /*referencedDynamically=*/true);
     else
       symtab->addSynthetic("__mh_execute_header", /*isec=*/nullptr, /*value=*/0,
-                           /*privateExtern=*/false, /*includeInSymtab=*/true,
+                           /*isPrivateExtern=*/false, /*includeInSymtab=*/true,
                            /*referencedDynamically=*/true);
     break;
 

diff  --git a/lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp b/lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp
index 435983769c052..4a11d82ecc6e9 100644
--- a/lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp
+++ b/lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp
@@ -110,7 +110,7 @@ Searcher::CallbackReturn BreakpointResolverFileRegex::SearchCallback(
     // TODO: Handle SourceLocationSpec column information
     SourceLocationSpec location_spec(cu_file_spec, line_matches[i],
                                      /*column=*/llvm::None,
-                                     /*search_inlines=*/false, m_exact_match);
+                                     /*check_inlines=*/false, m_exact_match);
     cu->ResolveSymbolContext(location_spec, eSymbolContextEverything, sc_list);
     // Find all the function names:
     if (!m_function_names.empty()) {

diff  --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp
index 890d8b5d3107a..ccd41fb4a94ea 100644
--- a/lldb/source/Expression/DWARFExpression.cpp
+++ b/lldb/source/Expression/DWARFExpression.cpp
@@ -825,7 +825,7 @@ static bool Evaluate_DW_OP_entry_value(std::vector<Value> &stack,
   const DWARFExpression &param_expr = matched_param->LocationInCaller;
   if (!param_expr.Evaluate(&parent_exe_ctx,
                            parent_frame->GetRegisterContext().get(),
-                           /*loclist_base_addr=*/LLDB_INVALID_ADDRESS,
+                           /*loclist_base_load_addr=*/LLDB_INVALID_ADDRESS,
                            /*initial_value_ptr=*/nullptr,
                            /*object_address_ptr=*/nullptr, result, error_ptr)) {
     LLDB_LOG(log,

diff  --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
index d9cbcce22c528..188b6da7a7122 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
@@ -338,7 +338,7 @@ bool DynamicLoaderPOSIXDYLD::SetRendezvousBreakpoint() {
       dyld_break = target.CreateBreakpoint(
           &containingModules, /*containingSourceFiles=*/nullptr,
           DebugStateCandidates, eFunctionNameTypeFull, eLanguageTypeC,
-          /*offset=*/0,
+          /*m_offset=*/0,
           /*skip_prologue=*/eLazyBoolNo,
           /*internal=*/true,
           /*request_hardware=*/false);
@@ -348,7 +348,7 @@ bool DynamicLoaderPOSIXDYLD::SetRendezvousBreakpoint() {
       dyld_break = target.CreateBreakpoint(
           &containingModules, /*containingSourceFiles=*/nullptr,
           DebugStateCandidates, eFunctionNameTypeFull, eLanguageTypeC,
-          /*offset=*/0,
+          /*m_offset=*/0,
           /*skip_prologue=*/eLazyBoolNo,
           /*internal=*/true,
           /*request_hardware=*/false);

diff  --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp
index 37479651fb453..dda9ec2327151 100644
--- a/lldb/source/Symbol/Function.cpp
+++ b/lldb/source/Symbol/Function.cpp
@@ -195,7 +195,7 @@ Function *IndirectCallEdge::GetCallee(ModuleList &images,
   Status error;
   Value callee_addr_val;
   if (!call_target.Evaluate(&exe_ctx, exe_ctx.GetRegisterContext(),
-                            /*loclist_base_addr=*/LLDB_INVALID_ADDRESS,
+                            /*loclist_base_load_addr=*/LLDB_INVALID_ADDRESS,
                             /*initial_value_ptr=*/nullptr,
                             /*object_address_ptr=*/nullptr, callee_addr_val,
                             &error)) {

diff  --git a/lldb/source/Target/TraceInstructionDumper.cpp b/lldb/source/Target/TraceInstructionDumper.cpp
index dc1e86481c363..69d59dcfb12f5 100644
--- a/lldb/source/Target/TraceInstructionDumper.cpp
+++ b/lldb/source/Target/TraceInstructionDumper.cpp
@@ -137,7 +137,7 @@ DumpInstructionSymbolContext(Stream &s,
              insn.sc.module_sp->GetFileSpec().GetFilename().AsCString());
   else
     insn.sc.DumpStopContext(&s, insn.exe_ctx.GetTargetPtr(), insn.address,
-                            /*show_fullpath=*/false,
+                            /*show_fullpaths=*/false,
                             /*show_module=*/true, /*show_inlined_frames=*/false,
                             /*show_function_arguments=*/true,
                             /*show_function_name=*/true);

diff  --git a/lldb/source/Utility/Reproducer.cpp b/lldb/source/Utility/Reproducer.cpp
index a306d6c1ef255..1e71dba472ed7 100644
--- a/lldb/source/Utility/Reproducer.cpp
+++ b/lldb/source/Utility/Reproducer.cpp
@@ -362,7 +362,7 @@ llvm::Error repro::Finalize(Loader *loader) {
 
   FileSpec mapping =
       reproducer_root.CopyByAppendingPathComponent(FileProvider::Info::file);
-  if (auto ec = collector.copyFiles(/*stop_on_error=*/false))
+  if (auto ec = collector.copyFiles(/*StopOnError=*/false))
     return errorCodeToError(ec);
   collector.writeMapping(mapping.GetPath());
 

diff  --git a/polly/include/polly/ScopPass.h b/polly/include/polly/ScopPass.h
index 34eea0431f44b..db910572bcc7e 100644
--- a/polly/include/polly/ScopPass.h
+++ b/polly/include/polly/ScopPass.h
@@ -255,7 +255,7 @@ class FunctionToScopPassAdaptor
 
     while (!Worklist.empty()) {
       Region *R = Worklist.pop_back_val();
-      if (!SD.isMaxRegionInScop(*R, /*Verifying=*/false))
+      if (!SD.isMaxRegionInScop(*R, /*Verify=*/false))
         continue;
       Scop *scop = SI.getScop(R);
       if (!scop)


        


More information about the lldb-commits mailing list