llvm/clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp

//===--- PreferMemberInitializerCheck.cpp - clang-tidy -------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "PreferMemberInitializerCheck.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Lex/Lexer.h"
#include "llvm/ADT/DenseMap.h"

usingnamespaceclang::ast_matchers;

namespace clang::tidy::cppcoreguidelines {

static bool isControlStatement(const Stmt *S) {}

static bool isNoReturnCallStatement(const Stmt *S) {}

namespace {

AST_MATCHER_P(FieldDecl, indexNotLessThan, unsigned, Index) {}

enum class AssignedLevel {};

} // namespace

static bool canAdvanceAssignment(AssignedLevel Level) {}

// Checks if Field is initialised using a field that will be initialised after
// it.
// TODO: Probably should guard against function calls that could have side
// effects or if they do reference another field that's initialized before
// this field, but is modified before the assignment.
static void updateAssignmentLevel(
    const FieldDecl *Field, const Expr *Init, const CXXConstructorDecl *Ctor,
    llvm::DenseMap<const FieldDecl *, AssignedLevel> &AssignedFields) {}

struct AssignmentPair {};

static std::optional<AssignmentPair>
isAssignmentToMemberOf(const CXXRecordDecl *Rec, const Stmt *S,
                       const CXXConstructorDecl *Ctor) {}

PreferMemberInitializerCheck::PreferMemberInitializerCheck(
    StringRef Name, ClangTidyContext *Context)
    :{}

void PreferMemberInitializerCheck::registerMatchers(MatchFinder *Finder) {}

void PreferMemberInitializerCheck::check(
    const MatchFinder::MatchResult &Result) {}

} // namespace clang::tidy::cppcoreguidelines