#include "PtrTypesSemantics.h"
#include "ASTUtils.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/StmtVisitor.h"
#include <optional>
usingnamespaceclang;
namespace {
bool hasPublicMethodInBaseClass(const CXXRecordDecl *R,
const char *NameToMatch) { … }
}
namespace clang {
std::optional<const clang::CXXRecordDecl *>
hasPublicMethodInBase(const CXXBaseSpecifier *Base, const char *NameToMatch) { … }
std::optional<bool> isRefCountable(const CXXRecordDecl* R)
{ … }
bool isRefType(const std::string &Name) { … }
bool isCtorOfRefCounted(const clang::FunctionDecl *F) { … }
bool isReturnValueRefCounted(const clang::FunctionDecl *F) { … }
std::optional<bool> isUncounted(const CXXRecordDecl* Class)
{ … }
std::optional<bool> isUncountedPtr(const Type* T)
{ … }
std::optional<bool> isGetterOfRefCounted(const CXXMethodDecl* M)
{ … }
bool isRefCounted(const CXXRecordDecl *R) { … }
bool isPtrConversion(const FunctionDecl *F) { … }
bool isSingleton(const FunctionDecl *F) { … }
class TrivialFunctionAnalysisVisitor
: public ConstStmtVisitor<TrivialFunctionAnalysisVisitor, bool> { … };
bool TrivialFunctionAnalysis::isTrivialImpl(
const Decl *D, TrivialFunctionAnalysis::CacheTy &Cache) { … }
bool TrivialFunctionAnalysis::isTrivialImpl(
const Stmt *S, TrivialFunctionAnalysis::CacheTy &Cache) { … }
}