Commit fd857f78 authored by Sindhu Chittireddy's avatar Sindhu Chittireddy
Browse files

[NFC] Initialize pointer fields and remove needless null check.

parent 9c96cc96
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4152,7 +4152,7 @@ CFGBlock *CFGBuilder::VisitCXXTypeidExpr(CXXTypeidExpr *S, AddStmtChoice asc) {
  //   operand. [...]
  // We add only potentially evaluated statements to the block to avoid
  // CFG generation for unevaluated operands.
  if (S && !S->isTypeDependent() && S->isPotentiallyEvaluated())
  if (!S->isTypeDependent() && S->isPotentiallyEvaluated())
    return VisitChildren(S);

  // Return block without CFG for unevaluated operands.
+5 −9
Original line number Diff line number Diff line
@@ -46,17 +46,13 @@ namespace {
/// types and the function declaration into a module if they're not used, and
/// avoids constructing the type more than once if it's used more than once.
class LazyRuntimeFunction {
  CodeGenModule *CGM;
  llvm::FunctionType *FTy;
  const char *FunctionName;
  llvm::FunctionCallee Function;
  CodeGenModule *CGM = nullptr;
  llvm::FunctionType *FTy = nullptr;
  const char *FunctionName = nullptr;
  llvm::FunctionCallee Function = nullptr;

public:
  /// Constructor leaves this class uninitialized, because it is intended to
  /// be used as a field in another class and not all of the types that are
  /// used as arguments will necessarily be available at construction time.
  LazyRuntimeFunction()
      : CGM(nullptr), FunctionName(nullptr), Function(nullptr) {}
  LazyRuntimeFunction() = default;

  /// Initialises the lazy function with the name, return type, and the types
  /// of the arguments.
+1 −1
Original line number Diff line number Diff line
@@ -306,7 +306,7 @@ private:
  // Since the next token might already be in a new unwrapped line, we need to
  // store the comments belonging to that token.
  SmallVector<FormatToken *, 1> CommentsBeforeNextToken;
  FormatToken *FormatTok;
  FormatToken *FormatTok = nullptr;
  bool MustBreakBeforeNextToken;

  // The parsed lines. Only added to through \c CurrentLines.
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ namespace {
/// conditional and the source range covered by it.
class PPValue {
  SourceRange Range;
  IdentifierInfo *II;
  IdentifierInfo *II = nullptr;

public:
  llvm::APSInt Val;
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ class CStringChecker : public Checker< eval::Call,
  mutable std::unique_ptr<BugType> BT_Null, BT_Bounds, BT_Overlap,
      BT_NotCString, BT_AdditionOverflow, BT_UninitRead;

  mutable const char *CurrentFunctionDescription;
  mutable const char *CurrentFunctionDescription = nullptr;

public:
  /// The filter is used to filter out the diagnostics which are not enabled by