llvm/clang/lib/StaticAnalyzer/Core/CheckerHelpers.cpp

//===---- CheckerHelpers.cpp - Helper functions for checkers ----*- C++ -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//
//
//  This file defines several static functions for use in checkers.
//
//===----------------------------------------------------------------------===//

#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h"
#include "clang/AST/Decl.h"
#include "clang/AST/Expr.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
#include <optional>

namespace clang {

namespace ento {

// Recursively find any substatements containing macros
bool containsMacro(const Stmt *S) {}

// Recursively find any substatements containing enum constants
bool containsEnum(const Stmt *S) {}

// Recursively find any substatements containing static vars
bool containsStaticLocal(const Stmt *S) {}

// Recursively find any substatements containing __builtin_offsetof
bool containsBuiltinOffsetOf(const Stmt *S) {}

// Extract lhs and rhs from assignment statement
std::pair<const clang::VarDecl *, const clang::Expr *>
parseAssignment(const Stmt *S) {}

Nullability getNullabilityAnnotation(QualType Type) {}

std::optional<int> tryExpandAsInteger(StringRef Macro, const Preprocessor &PP) {}

OperatorKind operationKindFromOverloadedOperator(OverloadedOperatorKind OOK,
                                                 bool IsBinary) {}

std::optional<SVal> getPointeeVal(SVal PtrSVal, ProgramStateRef State) {}

bool isWithinStdNamespace(const Decl *D) {}

} // namespace ento
} // namespace clang