diff --git a/clang/include/clang/AST/RawCommentList.h b/clang/include/clang/AST/RawCommentList.h --- a/clang/include/clang/AST/RawCommentList.h +++ b/clang/include/clang/AST/RawCommentList.h @@ -173,7 +173,7 @@ SourceRange Range; mutable StringRef RawText; - mutable const char *BriefText; + mutable const char *BriefText = nullptr; mutable bool RawTextValid : 1; ///< True if RawText is valid mutable bool BriefTextValid : 1; ///< True if BriefText is valid diff --git a/clang/include/clang/AST/Redeclarable.h b/clang/include/clang/AST/Redeclarable.h --- a/clang/include/clang/AST/Redeclarable.h +++ b/clang/include/clang/AST/Redeclarable.h @@ -240,7 +240,7 @@ class redecl_iterator { /// Current - The current declaration. decl_type *Current = nullptr; - decl_type *Starter; + decl_type *Starter = nullptr; bool PassedFirst = false; public: diff --git a/clang/include/clang/CodeGen/CodeGenAction.h b/clang/include/clang/CodeGen/CodeGenAction.h --- a/clang/include/clang/CodeGen/CodeGenAction.h +++ b/clang/include/clang/CodeGen/CodeGenAction.h @@ -83,7 +83,7 @@ CodeGenerator *getCodeGenerator() const; - BackendConsumer *BEConsumer; + BackendConsumer *BEConsumer = nullptr; }; class EmitAssemblyAction : public CodeGenAction { diff --git a/clang/include/clang/Sema/HLSLExternalSemaSource.h b/clang/include/clang/Sema/HLSLExternalSemaSource.h --- a/clang/include/clang/Sema/HLSLExternalSemaSource.h +++ b/clang/include/clang/Sema/HLSLExternalSemaSource.h @@ -23,7 +23,7 @@ class HLSLExternalSemaSource : public ExternalSemaSource { Sema *SemaPtr = nullptr; NamespaceDecl *HLSLNamespace = nullptr; - CXXRecordDecl *ResourceDecl; + CXXRecordDecl *ResourceDecl = nullptr; using CompletionFunction = std::function; llvm::DenseMap Completions; diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h --- a/clang/include/clang/Sema/Sema.h +++ b/clang/include/clang/Sema/Sema.h @@ -937,7 +937,7 @@ class DelayedDiagnostics; class DelayedDiagnosticsState { - sema::DelayedDiagnosticPool *SavedPool; + sema::DelayedDiagnosticPool *SavedPool = nullptr; friend class Sema::DelayedDiagnostics; }; typedef DelayedDiagnosticsState ParsingDeclState; diff --git a/clang/include/clang/Serialization/ModuleFile.h b/clang/include/clang/Serialization/ModuleFile.h --- a/clang/include/clang/Serialization/ModuleFile.h +++ b/clang/include/clang/Serialization/ModuleFile.h @@ -196,7 +196,7 @@ /// The memory buffer that stores the data associated with /// this AST file, owned by the InMemoryModuleCache. - llvm::MemoryBuffer *Buffer; + llvm::MemoryBuffer *Buffer = nullptr; /// The size of this file, in bits. uint64_t SizeInBits = 0; diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -318,10 +318,10 @@ /// CurFuncDecl - Holds the Decl for the current outermost /// non-closure context. - const Decl *CurFuncDecl; + const Decl *CurFuncDecl = nullptr; /// CurCodeDecl - This is the inner-most code context, which includes blocks. - const Decl *CurCodeDecl; - const CGFunctionInfo *CurFnInfo; + const Decl *CurCodeDecl = nullptr; + const CGFunctionInfo *CurFnInfo = nullptr; QualType FnRetTy; llvm::Function *CurFn = nullptr; @@ -748,11 +748,11 @@ /// An i1 variable indicating whether or not the @finally is /// running for an exception. - llvm::AllocaInst *ForEHVar; + llvm::AllocaInst *ForEHVar = nullptr; /// An i8* variable into which the exception pointer to rethrow /// has been saved. - llvm::AllocaInst *SavedExnVar; + llvm::AllocaInst *SavedExnVar = nullptr; public: void enter(CodeGenFunction &CGF, const Stmt *Finally, diff --git a/clang/lib/Format/SortJavaScriptImports.cpp b/clang/lib/Format/SortJavaScriptImports.cpp --- a/clang/lib/Format/SortJavaScriptImports.cpp +++ b/clang/lib/Format/SortJavaScriptImports.cpp @@ -217,8 +217,8 @@ } private: - FormatToken *Current; - FormatToken *LineEnd; + FormatToken *Current = nullptr; + FormatToken *LineEnd = nullptr; FormatToken invalidToken; diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp --- a/clang/lib/Serialization/ASTReaderDecl.cpp +++ b/clang/lib/Serialization/ASTReaderDecl.cpp @@ -478,7 +478,7 @@ /// been merged into the same redeclaration chain. template class MergedRedeclIterator { - DeclT *Start; + DeclT *Start = nullptr; DeclT *Canonical = nullptr; DeclT *Current = nullptr; diff --git a/clang/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp b/clang/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp --- a/clang/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp @@ -754,7 +754,7 @@ ObjCDeallocChecker::ObjCDeallocChecker() : NSObjectII(nullptr), SenTestCaseII(nullptr), XCTestCaseII(nullptr), - CIFilterII(nullptr) { + Block_releaseII(nullptr), CIFilterII(nullptr) { MissingReleaseBugType.reset( new BugType(this, "Missing ivar release (leak)", diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedLambdaCapturesChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedLambdaCapturesChecker.cpp --- a/clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedLambdaCapturesChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedLambdaCapturesChecker.cpp @@ -25,7 +25,7 @@ private: BugType Bug{this, "Lambda capture of uncounted variable", "WebKit coding guidelines"}; - mutable BugReporter *BR; + mutable BugReporter *BR = nullptr; public: void checkASTDecl(const TranslationUnitDecl *TUD, AnalysisManager &MGR,