[PATCH] D93185: [docs] Use make_unique in FrontendAction example

2021-04-06 Thread Nicolás Alvarez via Phabricator via cfe-commits
nicolas17 added a comment.

I don't have commit access, please push this for me.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93185

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D96738: [docs] Fix doxygen comments wrongly attached to the clang namespace

2021-02-15 Thread Nicolás Alvarez via Phabricator via cfe-commits
nicolas17 created this revision.
Herald added a subscriber: zzheng.
nicolas17 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Looking at the Doxygen-generated documentation for the clang namespace
currently shows several random comments from different parts of the
codebase. These are caused by:

- File doc comments that aren't marked with \file, so they're attached to the 
next declaration, which is usually "namespace clang {".
- Class doc comments placed before the namespace rather than before the class.

This commit fixes these comments. The generated doxygen documentation now
has proper docs for several classes and files, and the docs for the clang
namespace is now empty.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96738

Files:
  clang/include/clang/AST/ExternalASTSource.h
  clang/include/clang/Analysis/FlowSensitive/DataflowValues.h
  clang/include/clang/StaticAnalyzer/Core/PathSensitive/LoopUnrolling.h
  clang/include/clang/StaticAnalyzer/Core/PathSensitive/LoopWidening.h


Index: clang/include/clang/StaticAnalyzer/Core/PathSensitive/LoopWidening.h
===
--- clang/include/clang/StaticAnalyzer/Core/PathSensitive/LoopWidening.h
+++ clang/include/clang/StaticAnalyzer/Core/PathSensitive/LoopWidening.h
@@ -5,7 +5,7 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 
//===--===//
-///
+/// \file
 /// This header contains the declarations of functions which are used to widen
 /// loops which do not otherwise exit. The widening is done by invalidating
 /// anything which might be modified by the body of the loop.
Index: clang/include/clang/StaticAnalyzer/Core/PathSensitive/LoopUnrolling.h
===
--- clang/include/clang/StaticAnalyzer/Core/PathSensitive/LoopUnrolling.h
+++ clang/include/clang/StaticAnalyzer/Core/PathSensitive/LoopUnrolling.h
@@ -5,7 +5,7 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 
//===--===//
-///
+/// \file
 /// This header contains the declarations of functions which are used to decide
 /// which loops should be completely unrolled and mark their corresponding
 /// CFGBlocks. It is done by tracking a stack of loops in the ProgramState. 
This
@@ -18,7 +18,6 @@
 ///   has to be initialized by a literal in the corresponding initStmt.
 /// - Does not contain goto, switch and returnStmt.
 ///
-///
 
//===--===//
 
 #ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_LOOPUNROLLING_H
Index: clang/include/clang/Analysis/FlowSensitive/DataflowValues.h
===
--- clang/include/clang/Analysis/FlowSensitive/DataflowValues.h
+++ clang/include/clang/Analysis/FlowSensitive/DataflowValues.h
@@ -19,13 +19,14 @@
 #include "clang/Analysis/ProgramPoint.h"
 #include "llvm/ADT/DenseMap.h"
 
+namespace clang {
+
 
//===--===//
 /// Dataflow Directional Tag Classes.  These are used for tag dispatching
 ///  within the dataflow solver/transfer functions to determine what direction
 ///  a dataflow analysis flows.
 
//===--===//
 
-namespace clang {
 namespace dataflow {
   struct forward_analysis_tag {};
   struct backward_analysis_tag {};
Index: clang/include/clang/AST/ExternalASTSource.h
===
--- clang/include/clang/AST/ExternalASTSource.h
+++ clang/include/clang/AST/ExternalASTSource.h
@@ -462,10 +462,10 @@
 
 } // namespace clang
 
-/// Specialize PointerLikeTypeTraits to allow LazyGenerationalUpdatePtr to be
-/// placed into a PointerUnion.
 namespace llvm {
 
+/// Specialize PointerLikeTypeTraits to allow LazyGenerationalUpdatePtr to be
+/// placed into a PointerUnion.
 template
 struct PointerLikeTypeTraits<


Index: clang/include/clang/StaticAnalyzer/Core/PathSensitive/LoopWidening.h
===
--- clang/include/clang/StaticAnalyzer/Core/PathSensitive/LoopWidening.h
+++ clang/include/clang/StaticAnalyzer/Core/PathSensitive/LoopWidening.h
@@ -5,7 +5,7 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===--===//
-///
+/// \file
 /// This header contains the declarations of functions which are used to widen
 /// loops which do not otherwise exit. The widening is done by invalidating
 /// anything which might be modified by the body of the loop.
Index: clang/include/clang/StaticAnalyzer/Core/PathSensitive/LoopUnrolling.h

[PATCH] D93185: [docs] Use make_unique in FrontendAction example

2020-12-13 Thread Nicolás Alvarez via Phabricator via cfe-commits
nicolas17 created this revision.
nicolas17 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

The code example for "RecursiveASTVisitor based ASTFrontendActions"
was using unique_ptr(new X) when creating the AST consumer; change
it to use make_unique instead. The main function of the same example
already used make_unique.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93185

Files:
  clang/docs/RAVFrontendAction.rst


Index: clang/docs/RAVFrontendAction.rst
===
--- clang/docs/RAVFrontendAction.rst
+++ clang/docs/RAVFrontendAction.rst
@@ -27,8 +27,7 @@
   public:
 virtual std::unique_ptr CreateASTConsumer(
   clang::CompilerInstance , llvm::StringRef InFile) {
-  return std::unique_ptr(
-  new FindNamedClassConsumer);
+  return std::make_unique();
 }
   };
 
@@ -114,8 +113,7 @@
 
   virtual std::unique_ptr CreateASTConsumer(
 clang::CompilerInstance , llvm::StringRef InFile) {
-return std::unique_ptr(
-new FindNamedClassConsumer(()));
+return 
std::make_unique(());
   }
 
 Now that the ASTContext is available in the RecursiveASTVisitor, we can
@@ -189,8 +187,7 @@
   public:
 virtual std::unique_ptr CreateASTConsumer(
   clang::CompilerInstance , llvm::StringRef InFile) {
-  return std::unique_ptr(
-  new FindNamedClassConsumer(()));
+  return 
std::make_unique(());
 }
   };
 


Index: clang/docs/RAVFrontendAction.rst
===
--- clang/docs/RAVFrontendAction.rst
+++ clang/docs/RAVFrontendAction.rst
@@ -27,8 +27,7 @@
   public:
 virtual std::unique_ptr CreateASTConsumer(
   clang::CompilerInstance , llvm::StringRef InFile) {
-  return std::unique_ptr(
-  new FindNamedClassConsumer);
+  return std::make_unique();
 }
   };
 
@@ -114,8 +113,7 @@
 
   virtual std::unique_ptr CreateASTConsumer(
 clang::CompilerInstance , llvm::StringRef InFile) {
-return std::unique_ptr(
-new FindNamedClassConsumer(()));
+return std::make_unique(());
   }
 
 Now that the ASTContext is available in the RecursiveASTVisitor, we can
@@ -189,8 +187,7 @@
   public:
 virtual std::unique_ptr CreateASTConsumer(
   clang::CompilerInstance , llvm::StringRef InFile) {
-  return std::unique_ptr(
-  new FindNamedClassConsumer(()));
+  return std::make_unique(());
 }
   };
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-12 Thread Nicolás Alvarez via Phabricator via cfe-commits
nicolas17 added inline comments.



Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:484
+const NoteTag *ChangeTag =
+  getChangeTag(C, "shrinked from the right by 1 position", ContReg, ContE);
 // For vector-like and deque-like containers invalidate the last and the

Past tense is "shrank", not "shrinked".


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

https://reviews.llvm.org/D73720



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D74385: [ARCMT][NFC] Reduce #include dependencies

2020-02-12 Thread Nicolás Alvarez via Phabricator via cfe-commits
nicolas17 added a comment.

In D74385#1872298 , @serge-sans-paille 
wrote:

> Sure, can you just confirm that you're this guy: https://github.com/nicolas17 
> (I need that for proper email attribution)


Yes that's me :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74385



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D74385: [ARCMT][NFC] Reduce #include dependencies

2020-02-11 Thread Nicolás Alvarez via Phabricator via cfe-commits
nicolas17 added a comment.

I don't have commit access, can someone push this for me?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74385



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D74385: [ARCMT][NFC] Reduce #include dependencies

2020-02-10 Thread Nicolás Alvarez via Phabricator via cfe-commits
nicolas17 created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Replace some #includes in ARCMigrate source files with more specific includes 
and forward declarations. This reduces the number of files that need to be 
rebuilt when a header changes (and saves like 1 second of build time). For 
example, several files no longer need to be rebuilt when the list of static 
analyzer checkers(!) changes.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74385

Files:
  clang/lib/ARCMigrate/ARCMT.cpp
  clang/lib/ARCMigrate/Internals.h
  clang/lib/ARCMigrate/Transforms.cpp


Index: clang/lib/ARCMigrate/Transforms.cpp
===
--- clang/lib/ARCMigrate/Transforms.cpp
+++ clang/lib/ARCMigrate/Transforms.cpp
@@ -8,6 +8,7 @@
 
 #include "Transforms.h"
 #include "Internals.h"
+#include "clang/ARCMigrate/ARCMT.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/RecursiveASTVisitor.h"
 #include "clang/Analysis/DomainSpecific/CocoaConventions.h"
Index: clang/lib/ARCMigrate/Internals.h
===
--- clang/lib/ARCMigrate/Internals.h
+++ clang/lib/ARCMigrate/Internals.h
@@ -9,13 +9,15 @@
 #ifndef LLVM_CLANG_LIB_ARCMIGRATE_INTERNALS_H
 #define LLVM_CLANG_LIB_ARCMIGRATE_INTERNALS_H
 
-#include "clang/ARCMigrate/ARCMT.h"
+#include "clang/Basic/LangOptions.h"
 #include "clang/Basic/Diagnostic.h"
+#include "clang/Frontend/MigratorOptions.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/Optional.h"
 #include 
 
 namespace clang {
+  class ASTContext;
   class Sema;
   class Stmt;
 
Index: clang/lib/ARCMigrate/ARCMT.cpp
===
--- clang/lib/ARCMigrate/ARCMT.cpp
+++ clang/lib/ARCMigrate/ARCMT.cpp
@@ -7,6 +7,7 @@
 
//===--===//
 
 #include "Internals.h"
+#include "clang/ARCMigrate/ARCMT.h"
 #include "clang/AST/ASTConsumer.h"
 #include "clang/Basic/DiagnosticCategories.h"
 #include "clang/Frontend/ASTUnit.h"


Index: clang/lib/ARCMigrate/Transforms.cpp
===
--- clang/lib/ARCMigrate/Transforms.cpp
+++ clang/lib/ARCMigrate/Transforms.cpp
@@ -8,6 +8,7 @@
 
 #include "Transforms.h"
 #include "Internals.h"
+#include "clang/ARCMigrate/ARCMT.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/RecursiveASTVisitor.h"
 #include "clang/Analysis/DomainSpecific/CocoaConventions.h"
Index: clang/lib/ARCMigrate/Internals.h
===
--- clang/lib/ARCMigrate/Internals.h
+++ clang/lib/ARCMigrate/Internals.h
@@ -9,13 +9,15 @@
 #ifndef LLVM_CLANG_LIB_ARCMIGRATE_INTERNALS_H
 #define LLVM_CLANG_LIB_ARCMIGRATE_INTERNALS_H
 
-#include "clang/ARCMigrate/ARCMT.h"
+#include "clang/Basic/LangOptions.h"
 #include "clang/Basic/Diagnostic.h"
+#include "clang/Frontend/MigratorOptions.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/Optional.h"
 #include 
 
 namespace clang {
+  class ASTContext;
   class Sema;
   class Stmt;
 
Index: clang/lib/ARCMigrate/ARCMT.cpp
===
--- clang/lib/ARCMigrate/ARCMT.cpp
+++ clang/lib/ARCMigrate/ARCMT.cpp
@@ -7,6 +7,7 @@
 //===--===//
 
 #include "Internals.h"
+#include "clang/ARCMigrate/ARCMT.h"
 #include "clang/AST/ASTConsumer.h"
 #include "clang/Basic/DiagnosticCategories.h"
 #include "clang/Frontend/ASTUnit.h"
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits