[PATCH] D150492: [AST] Initialize local counter

Vitaly Buka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 18 01:19:31 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGe8cd04624e50: [AST] Initialize local counter (authored by vitalybuka).

Changed prior to commit:
  https://reviews.llvm.org/D150492?vs=521819&id=523292#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150492/new/

https://reviews.llvm.org/D150492

Files:
  clang/lib/Frontend/ASTUnit.cpp


Index: clang/lib/Frontend/ASTUnit.cpp
===================================================================
--- clang/lib/Frontend/ASTUnit.cpp
+++ clang/lib/Frontend/ASTUnit.cpp
@@ -822,7 +822,6 @@
   // Gather Info for preprocessor construction later on.
 
   HeaderSearch &HeaderInfo = *AST->HeaderInfo;
-  unsigned Counter;
 
   AST->PP = std::make_shared<Preprocessor>(
       AST->PPOpts, AST->getDiagnostics(), *AST->LangOpts,
@@ -846,6 +845,7 @@
       /*isysroot=*/"",
       /*DisableValidationKind=*/disableValid, AllowASTWithCompilerErrors);
 
+  unsigned Counter = 0;
   AST->Reader->setListener(std::make_unique<ASTInfoCollector>(
       *AST->PP, AST->Ctx.get(), *AST->HSOpts, *AST->PPOpts, *AST->LangOpts,
       AST->TargetOpts, AST->Target, Counter));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150492.523292.patch
Type: text/x-patch
Size: 767 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230518/3f21e565/attachment.bin>


More information about the cfe-commits mailing list