This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe9877eca408e: [NFC] Initialize class member pointers to 
nullptr. (authored by schittir).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153892

Files:
  clang/lib/ARCMigrate/TransProperties.cpp
  clang/lib/AST/ExprConstant.cpp
  clang/lib/Frontend/ASTConsumers.cpp
  clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp


Index: clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
===================================================================
--- clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
+++ clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
@@ -29,7 +29,7 @@
 class StackAddrEscapeChecker
     : public Checker<check::PreCall, check::PreStmt<ReturnStmt>,
                      check::EndFunction> {
-  mutable IdentifierInfo *dispatch_semaphore_tII;
+  mutable IdentifierInfo *dispatch_semaphore_tII = nullptr;
   mutable std::unique_ptr<BuiltinBug> BT_stackleak;
   mutable std::unique_ptr<BuiltinBug> BT_returnstack;
   mutable std::unique_ptr<BuiltinBug> BT_capturedstackasync;
Index: clang/lib/Frontend/ASTConsumers.cpp
===================================================================
--- clang/lib/Frontend/ASTConsumers.cpp
+++ clang/lib/Frontend/ASTConsumers.cpp
@@ -183,21 +183,20 @@
 /// ASTViewer - AST Visualization
 
 namespace {
-  class ASTViewer : public ASTConsumer {
-    ASTContext *Context;
-  public:
-    void Initialize(ASTContext &Context) override {
-      this->Context = &Context;
-    }
+class ASTViewer : public ASTConsumer {
+  ASTContext *Context = nullptr;
 
-    bool HandleTopLevelDecl(DeclGroupRef D) override {
-      for (DeclGroupRef::iterator I = D.begin(), E = D.end(); I != E; ++I)
-        HandleTopLevelSingleDecl(*I);
-      return true;
-    }
+public:
+  void Initialize(ASTContext &Context) override { this->Context = &Context; }
 
-    void HandleTopLevelSingleDecl(Decl *D);
-  };
+  bool HandleTopLevelDecl(DeclGroupRef D) override {
+    for (DeclGroupRef::iterator I = D.begin(), E = D.end(); I != E; ++I)
+      HandleTopLevelSingleDecl(*I);
+    return true;
+  }
+
+  void HandleTopLevelSingleDecl(Decl *D);
+};
 }
 
 void ASTViewer::HandleTopLevelSingleDecl(Decl *D) {
Index: clang/lib/AST/ExprConstant.cpp
===================================================================
--- clang/lib/AST/ExprConstant.cpp
+++ clang/lib/AST/ExprConstant.cpp
@@ -583,7 +583,7 @@
     /// LambdaCaptureFields - Mapping from captured variables/this to
     /// corresponding data members in the closure class.
     llvm::DenseMap<const ValueDecl *, FieldDecl *> LambdaCaptureFields;
-    FieldDecl *LambdaThisCaptureField;
+    FieldDecl *LambdaThisCaptureField = nullptr;
 
     CallStackFrame(EvalInfo &Info, SourceLocation CallLoc,
                    const FunctionDecl *Callee, const LValue *This,
Index: clang/lib/ARCMigrate/TransProperties.cpp
===================================================================
--- clang/lib/ARCMigrate/TransProperties.cpp
+++ clang/lib/ARCMigrate/TransProperties.cpp
@@ -45,7 +45,7 @@
 class PropertiesRewriter {
   MigrationContext &MigrateCtx;
   MigrationPass &Pass;
-  ObjCImplementationDecl *CurImplD;
+  ObjCImplementationDecl *CurImplD = nullptr;
 
   enum PropActionKind {
     PropAction_None,


Index: clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
===================================================================
--- clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
+++ clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
@@ -29,7 +29,7 @@
 class StackAddrEscapeChecker
     : public Checker<check::PreCall, check::PreStmt<ReturnStmt>,
                      check::EndFunction> {
-  mutable IdentifierInfo *dispatch_semaphore_tII;
+  mutable IdentifierInfo *dispatch_semaphore_tII = nullptr;
   mutable std::unique_ptr<BuiltinBug> BT_stackleak;
   mutable std::unique_ptr<BuiltinBug> BT_returnstack;
   mutable std::unique_ptr<BuiltinBug> BT_capturedstackasync;
Index: clang/lib/Frontend/ASTConsumers.cpp
===================================================================
--- clang/lib/Frontend/ASTConsumers.cpp
+++ clang/lib/Frontend/ASTConsumers.cpp
@@ -183,21 +183,20 @@
 /// ASTViewer - AST Visualization
 
 namespace {
-  class ASTViewer : public ASTConsumer {
-    ASTContext *Context;
-  public:
-    void Initialize(ASTContext &Context) override {
-      this->Context = &Context;
-    }
+class ASTViewer : public ASTConsumer {
+  ASTContext *Context = nullptr;
 
-    bool HandleTopLevelDecl(DeclGroupRef D) override {
-      for (DeclGroupRef::iterator I = D.begin(), E = D.end(); I != E; ++I)
-        HandleTopLevelSingleDecl(*I);
-      return true;
-    }
+public:
+  void Initialize(ASTContext &Context) override { this->Context = &Context; }
 
-    void HandleTopLevelSingleDecl(Decl *D);
-  };
+  bool HandleTopLevelDecl(DeclGroupRef D) override {
+    for (DeclGroupRef::iterator I = D.begin(), E = D.end(); I != E; ++I)
+      HandleTopLevelSingleDecl(*I);
+    return true;
+  }
+
+  void HandleTopLevelSingleDecl(Decl *D);
+};
 }
 
 void ASTViewer::HandleTopLevelSingleDecl(Decl *D) {
Index: clang/lib/AST/ExprConstant.cpp
===================================================================
--- clang/lib/AST/ExprConstant.cpp
+++ clang/lib/AST/ExprConstant.cpp
@@ -583,7 +583,7 @@
     /// LambdaCaptureFields - Mapping from captured variables/this to
     /// corresponding data members in the closure class.
     llvm::DenseMap<const ValueDecl *, FieldDecl *> LambdaCaptureFields;
-    FieldDecl *LambdaThisCaptureField;
+    FieldDecl *LambdaThisCaptureField = nullptr;
 
     CallStackFrame(EvalInfo &Info, SourceLocation CallLoc,
                    const FunctionDecl *Callee, const LValue *This,
Index: clang/lib/ARCMigrate/TransProperties.cpp
===================================================================
--- clang/lib/ARCMigrate/TransProperties.cpp
+++ clang/lib/ARCMigrate/TransProperties.cpp
@@ -45,7 +45,7 @@
 class PropertiesRewriter {
   MigrationContext &MigrateCtx;
   MigrationPass &Pass;
-  ObjCImplementationDecl *CurImplD;
+  ObjCImplementationDecl *CurImplD = nullptr;
 
   enum PropActionKind {
     PropAction_None,
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to