Classes | Namespaces | Macros | Functions
InsightsHelpers.cpp File Reference
#include "InsightsHelpers.h"
#include "ASTHelpers.h"
#include "ClangCompat.h"
#include "CodeGenerator.h"
#include "DPrint.h"
#include "Insights.h"
#include "InsightsStaticStrings.h"
#include "OutputFormatHelper.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Sema/Lookup.h"
#include "clang/Basic/OperatorKinds.def"
Include dependency graph for InsightsHelpers.cpp:

Go to the source code of this file.

Classes

struct  clang::insights::CppInsightsPrintingPolicy
 
class  clang::insights::details::SimpleTypePrinter
 SimpleTypePrinter a partially substitution of Clang's TypePrinter. More...
 
struct  clang::insights::overloaded< Ts >
 

Namespaces

 clang
 
 clang::insights
 
 clang::insights::details
 

Macros

#define OVERLOADED_OPERATOR(Name, Spelling, Token, Unary, Binary, MemberOnly)    case OO_##Name: return "operator" #Name;
 
#define HANDLE_TYPE(t)
 
#define HANDLE_TYPE(t)
 

Functions

static std::string clang::insights::GetNamePlain (const NamedDecl &decl)
 
std::string clang::insights::GetPlainName (const DeclRefExpr &DRE)
 
 clang::insights::STRONG_BOOL (InsightsSuppressScope)
 
 clang::insights::STRONG_BOOL (InsightsCanonicalTypes)
 
static std::string clang::insights::GetUnqualifiedScopelessName (const Type *type, const InsightsSuppressScope supressScope)
 
void clang::insights::ReplaceAll (std::string &str, std::string_view from, std::string_view to)
 
static void clang::insights::details::BuildNamespace (std::string &fullNamespace, const NestedNameSpecifier *stmt, const IgnoreNamespace ignoreNamespace)
 
std::string clang::insights::GetNestedName (const NestedNameSpecifier *nns, const IgnoreNamespace ignoreNamespace)
 
static const std::string clang::insights::GetAsCPPStyleString (const QualType &t, const CppInsightsPrintingPolicy &printingPolicy)
 
std::string clang::insights::BuildInternalVarName (const std::string_view &varName)
 
static std::string clang::insights::BuildInternalVarName (const std::string_view &varName, const SourceLocation &loc, const SourceManager &sm)
 
void clang::insights::InsertBefore (std::string &source, const std::string_view &find, const std::string_view &replace)
 
static void clang::insights::InsertAfter (std::string &source, const std::string_view &find, const std::string_view &replace)
 
std::string clang::insights::MakeLineColumnName (const SourceManager &sm, const SourceLocation &loc, const std::string_view &prefix)
 
static std::string clang::insights::MakeLineColumnName (const Decl &decl, const std::string_view prefix)
 
std::string clang::insights::GetLambdaName (const CXXRecordDecl &lambda)
 
static std::string clang::insights::GetAnonymStructOrUnionName (const CXXRecordDecl &cxxRecordDecl)
 
std::string clang::insights::BuildRetTypeName (const Decl &decl)
 
const QualType clang::insights::GetDesugarType (const QualType &QT)
 Remove decltype from a QualType, if possible. More...
 
static const VarDecl * clang::insights::GetVarDeclFromDeclRefExpr (const DeclRefExpr &declRefExpr)
 
std::string clang::insights::GetDeclContext (const DeclContext *ctx, WithTemplateParameters withTemplateParameters)
 
 clang::insights::details::STRONG_BOOL (RemoveCurrentScope)
 
static std::string clang::insights::details::GetQualifiedName (const NamedDecl &decl, const RemoveCurrentScope removeCurrentScope=RemoveCurrentScope::Yes)
 
static std::string clang::insights::details::GetScope (const DeclContext *declCtx, const RemoveCurrentScope removeCurrentScope=RemoveCurrentScope::Yes)
 
static std::string clang::insights::details::GetName (QualType t, const Unqualified unqualified=Unqualified::No, const InsightsSuppressScope supressScope=InsightsSuppressScope::No)
 
static bool clang::insights::HasOverload (const FunctionDecl *fd)
 
std::string clang::insights::GetSpecialMemberName (const ValueDecl *vd)
 
std::string clang::insights::GetCfrontOverloadedFunctionName (const FunctionDecl *fd)
 
 clang::insights::STRONG_BOOL (UseLexicalParent)
 
static bool clang::insights::NeedsNamespace (const Decl &decl, UseLexicalParent useLexicalParent)
 
static const SubstTemplateTypeParmType * clang::insights::GetSubstTemplateTypeParmType (const Type *t)
 
static const DeclRefExpr * clang::insights::FindVarDeclRef (const Stmt *stmt)
 
static std::string clang::insights::GetTemplateParameterPackArgumentName (std::string_view name, const Decl *decl)
 
std::string clang::insights::GetName (const NamedDecl &nd, const QualifiedName qualifiedName)
 
std::string clang::insights::BuildTemplateParamObjectName (std::string name)
 
std::string clang::insights::GetName (const TemplateParamObjectDecl &decl)
 
std::string clang::insights::GetName (const CXXRecordDecl &RD)
 
std::string clang::insights::GetTemporaryName (const Expr &tmp)
 
std::string clang::insights::GetName (const CXXTemporaryObjectExpr &tmp)
 
std::string clang::insights::GetName (const QualType &t, const Unqualified unqualified)
 
std::string clang::insights::GetUnqualifiedScopelessName (const Type *type)
 
QualType clang::insights::GetType (QualType)
 In Cfront mode we transform references to pointers. More...
 
template<typename QT , typename SUB_T , typename SUB_T2 = void>
static bool clang::insights::HasTypeWithSubType (const QualType &t)
 
template<typename QT , typename SUB_T >
static bool clang::insights::HasTypePath (const QualType &t)
 
std::string clang::insights::GetTypeNameAsParameter (const QualType &t, std::string_view varName, const Unqualified unqualified)
 
void clang::insights::AppendTemplateTypeParamName (OutputFormatHelper &ofm, const TemplateTypeParmDecl *decl, const bool isParameter, const TemplateTypeParmType *type)
 
static bool clang::insights::IsTrivialStaticClassVarDecl (const DeclRefExpr &declRefExpr)
 
APValue * clang::insights::GetEvaluatedValue (const VarDecl &varDecl)
 Get the evaluated APValue from a VarDecl More...
 
bool clang::insights::IsEvaluatable (const VarDecl &varDecl)
 Check whether a VarDecls initialization can be done a compile-time. More...
 
bool clang::insights::IsTrivialStaticClassVarDecl (const VarDecl &varDecl)
 
std::string clang::insights::GetName (const DeclRefExpr &declRefExpr)
 
const DeclRefExpr * clang::insights::FindDeclRef (const Stmt *stmt)
 Go deep in a Stmt if necessary and look to all childs for a DeclRefExpr. More...
 
std::string clang::insights::GetName (const VarDecl &VD)
 
static std::optional< bool > clang::insights::EvaluateAsBoolenCondition (const Expr &expr, const Decl &decl)
 
const std::string clang::insights::GetNoExcept (const FunctionDecl &decl)
 
const std::string_view clang::insights::GetConst (const FunctionDecl &decl)
 
std::string clang::insights::GetElaboratedTypeKeyword (const ElaboratedTypeKeyword keyword)
 
uint64_t clang::insights::GetSize (const ConstantArrayType *arrayType)
 
template<class... Ts>
 clang::insights::overloaded (Ts...) -> overloaded< Ts... >
 

Macro Definition Documentation

◆ HANDLE_TYPE [1/2]

#define HANDLE_TYPE (   t)
Value:
if(isa<t>(type)) { \
return HandleType(dyn_cast_or_null<t>(type)); \
}

◆ HANDLE_TYPE [2/2]

#define HANDLE_TYPE (   t)
Value:
if(isa<t>(type)) { \
HandleTypeAfter(dyn_cast_or_null<t>(type)); \
}

◆ OVERLOADED_OPERATOR

#define OVERLOADED_OPERATOR (   Name,
  Spelling,
  Token,
  Unary,
  Binary,
  MemberOnly 
)     case OO_##Name: return "operator" #Name;