llvm/clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp

//===--- ElseAfterReturnCheck.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 "ElseAfterReturnCheck.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Lex/Lexer.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Tooling/FixIt.h"
#include "llvm/ADT/SmallVector.h"

usingnamespaceclang::ast_matchers;

namespace clang::tidy::readability {

namespace {

class PPConditionalCollector : public PPCallbacks {};

} // namespace

static const char InterruptingStr[] =;
static const char WarningMessage[] =;
static const char WarnOnUnfixableStr[] =;
static const char WarnOnConditionVariablesStr[] =;

static const DeclRefExpr *findUsage(const Stmt *Node, int64_t DeclIdentifier) {}

static const DeclRefExpr *
findUsageRange(const Stmt *Node,
               const llvm::ArrayRef<int64_t> &DeclIdentifiers) {}

static const DeclRefExpr *checkInitDeclUsageInElse(const IfStmt *If) {}

static const DeclRefExpr *checkConditionVarUsageInElse(const IfStmt *If) {}

static bool containsDeclInScope(const Stmt *Node) {}

static void removeElseAndBrackets(DiagnosticBuilder &Diag, ASTContext &Context,
                                  const Stmt *Else, SourceLocation ElseLoc) {}

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

void ElseAfterReturnCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {}

void ElseAfterReturnCheck::registerPPCallbacks(const SourceManager &SM,
                                               Preprocessor *PP,
                                               Preprocessor *ModuleExpanderPP) {}

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

static bool hasPreprocessorBranchEndBetweenLocations(
    const ElseAfterReturnCheck::ConditionalBranchMap &ConditionalBranchMap,
    const SourceManager &SM, SourceLocation StartLoc, SourceLocation EndLoc) {}

static StringRef getControlFlowString(const Stmt &Stmt) {}

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

} // namespace clang::tidy::readability