#include <array>
#include "clang/AST/ASTContext.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Rewrite/Core/Rewriter.h"
#include "clang/Tooling/CommonOptionsParser.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/raw_ostream.h"
#include <vector>
#include "CodeGenerator.h"
#include "DPrint.h"
#include "Insights.h"
#include "version.h"
#include "InsightsOptions.def"
#include "clang/Basic/Version.h"
Go to the source code of this file.
Classes | |
class | FindIncludes |
class | CppInsightASTConsumer |
class | CppInsightFrontendAction |
Namespaces | |
clang | |
clang::insights | |
Macros | |
#define | INSIGHTS_OPT(option, name, deflt, description, category) |
Typedefs | |
using | clang::insights::GlobalInsertMap = std::pair< bool, std::string_view > |
using | IncludeData = std::pair< const SourceLocation, std::string > |
Functions | |
const InsightsOptions & | GetInsightsOptions () |
Get the global C++ Insights options. More... | |
InsightsOptions & | GetInsightsOptionsRW () |
static llvm::cl::OptionCategory | gInsightCategory ("Insights"sv) |
static llvm::cl::OptionCategory | gInsightEduCategory ("Insights-Educational"sv, "This transformations are only for education purposes. The resulting code most likely does not compile."sv) |
static llvm::cl::opt< bool > | gStdinMode ("stdin", llvm::cl::desc("Read the input from <stdin>."sv), llvm::cl::init(false), llvm::cl::cat(gInsightCategory)) |
static llvm::cl::opt< bool > | gUseLibCpp ("use-libc++", llvm::cl::desc("Use libc++."sv), llvm::cl::init(false), llvm::cl::cat(gInsightCategory)) |
const ASTContext & | GetGlobalAST () |
Get access to the ASTContext. More... | |
const CompilerInstance & | GetGlobalCI () |
Get access to the CompilerInstance. More... | |
std::string | clang::insights::EmitGlobalVariableCtors () |
void | clang::insights::AddGLobalInsertMapEntry (GlobalInserts idx, std::string_view value) |
void | clang::insights::EnableGlobalInsert (GlobalInserts idx) |
static void | PrintVersion (raw_ostream &ostream) |
int | main (int argc, const char **argv) |
Variables | |
static InsightsOptions | gInsightsOptions {} |
static const ASTContext * | gAST {} |
static const CompilerInstance * | gCI {} |
static constinit std::array< GlobalInsertMap, static_cast< size_t >GlobalInserts::MAX)> | clang::insights::gGlobalInserts {} |
#define INSIGHTS_OPT | ( | option, | |
name, | |||
deflt, | |||
description, | |||
category | |||
) |
Definition at line 68 of file Insights.cpp.
using IncludeData = std::pair<const SourceLocation, std::string> |
Definition at line 113 of file Insights.cpp.
const ASTContext& GetGlobalAST | ( | ) |
Get access to the ASTContext.
Definition at line 81 of file Insights.cpp.
References gAST.
Referenced by clang::insights::asthelpers::_mkDeclStmt(), clang::insights::asthelpers::AccessMember(), clang::insights::asthelpers::ArraySubscript(), clang::insights::asthelpers::Bool(), clang::insights::asthelpers::Break(), clang::insights::BUILD_OPT_AND(), clang::insights::BuildSuspendVarName(), clang::insights::asthelpers::Call(), clang::insights::asthelpers::CallMemberFun(), clang::insights::asthelpers::Case(), clang::insights::asthelpers::CastLToRValue(), clang::insights::asthelpers::Catch(), clang::insights::asthelpers::Comment(), clang::insights::asthelpers::ContantArrayTy(), clang::insights::asthelpers::Equal(), clang::insights::EvaluateNTTPAsConstantExpr(), clang::insights::asthelpers::Function(), clang::insights::asthelpers::FunctionBase(), clang::insights::GetRecordLayout(), clang::insights::GetTemporaryName(), clang::insights::GetType(), clang::insights::asthelpers::Goto(), clang::insights::CodeGenerator::HandleLocalStaticNonTrivialClass(), clang::insights::asthelpers::If(), clang::insights::asthelpers::InitList(), clang::insights::CoroutinesCodeGenerator::InsertArg(), clang::insights::CfrontCodeGenerator::InsertArg(), clang::insights::CodeGenerator::InsertAttribute(), clang::insights::CoroutinesCodeGenerator::InsertCoroutine(), clang::insights::CfrontCodeGenerator::InsertCXXMethodDecl(), clang::insights::CodeGenerator::InsertTemplateArg(), clang::insights::CodeGenerator::InsertTemplateArgsObjectParam(), clang::insights::CodeGenerator::InsertTemplateParameters(), clang::insights::asthelpers::Int32(), clang::insights::asthelpers::Label(), clang::insights::asthelpers::mkBinaryOperator(), clang::insights::asthelpers::mkCompoundStmt(), clang::insights::asthelpers::mkDeclRefExpr(), clang::insights::asthelpers::mkFieldDecl(), clang::insights::asthelpers::mkLabelDecl(), clang::insights::asthelpers::mkNullStmt(), clang::insights::asthelpers::mkStdFunctionDecl(), clang::insights::asthelpers::mkUnaryOperator(), clang::insights::asthelpers::New(), clang::insights::asthelpers::Parameter(), clang::insights::asthelpers::Paren(), clang::insights::ProcessFields(), clang::insights::asthelpers::Ptr(), clang::insights::asthelpers::ReinterpretCast(), clang::insights::asthelpers::Return(), clang::insights::asthelpers::Sizeof(), clang::insights::asthelpers::StaticCast(), clang::insights::asthelpers::Struct(), clang::insights::asthelpers::Switch(), clang::insights::TemporaryDeclFinder::TemporaryDeclFinder(), clang::insights::asthelpers::Throw(), clang::insights::asthelpers::Try(), clang::insights::asthelpers::Typedef(), clang::insights::asthelpers::Variable(), clang::insights::CoroutineASTTransformer::VisitCoroutineBodyStmt(), clang::insights::TemporaryDeclFinder::VisitCXXTemporaryObjectExpr(), and clang::insights::asthelpers::VoidTy().
const CompilerInstance& GetGlobalCI | ( | ) |
Get access to the CompilerInstance.
Definition at line 88 of file Insights.cpp.
References gCI.
Referenced by clang::insights::HasOverload().
const InsightsOptions& GetInsightsOptions | ( | ) |
Get the global C++ Insights options.
Definition at line 37 of file Insights.cpp.
References gInsightsOptions.
Referenced by clang::insights::LifetimeTracker::Add(), CppInsightASTConsumer::CppInsightASTConsumer(), clang::insights::LifetimeTracker::EndScope(), clang::insights::GetCfrontOverloadedFunctionName(), clang::insights::GetNamePlain(), clang::insights::GetType(), CppInsightASTConsumer::HandleTranslationUnit(), clang::insights::CodeGenerator::InsertFunctionNameWithReturnType(), clang::insights::CodeGenerator::InsertMethodBody(), main(), clang::insights::LifetimeTracker::Return(), clang::insights::LifetimeTracker::StartScope(), clang::insights::TemporaryDeclFinder::TemporaryDeclFinder(), and clang::insights::TemporaryDeclFinder::VisitCXXTemporaryObjectExpr().
InsightsOptions& GetInsightsOptionsRW | ( | ) |
Definition at line 43 of file Insights.cpp.
References gInsightsOptions.
|
static |
Referenced by main().
|
static |
|
static |
Referenced by main().
|
static |
Referenced by main().
int main | ( | int | argc, |
const char ** | argv | ||
) |
Definition at line 349 of file Insights.cpp.
References clang::insights::AddGLobalInsertMapEntry(), clang::insights::EnableGlobalInsert(), clang::insights::Error(), clang::insights::FuncCxaAtExit, clang::insights::FuncCxaPureVirtual, clang::insights::FuncCxaStart, clang::insights::FuncCxaVecCtor, clang::insights::FuncCxaVecDel, clang::insights::FuncCxaVecDtor, clang::insights::FuncCxaVecNew, clang::insights::FuncFree, clang::insights::FuncMalloc, clang::insights::FuncMemcpy, clang::insights::FuncMemset, clang::insights::FuncVtableStruct, GetInsightsOptions(), gInsightCategory(), gStdinMode(), gUseLibCpp(), clang::insights::HeaderAssert, clang::insights::HeaderException, clang::insights::HeaderNew, clang::insights::HeaderStddef, clang::insights::HeaderStdlib, clang::insights::HeaderUtility, and PrintVersion().
|
static |
Definition at line 335 of file Insights.cpp.
Referenced by main().
|
static |
Definition at line 80 of file Insights.cpp.
Referenced by GetGlobalAST(), and CppInsightASTConsumer::HandleTranslationUnit().
|
static |
Definition at line 87 of file Insights.cpp.
Referenced by CppInsightFrontendAction::CreateASTConsumer(), and GetGlobalCI().
|
static |
Definition at line 34 of file Insights.cpp.
Referenced by CppInsightASTConsumer::CppInsightASTConsumer(), GetInsightsOptions(), and GetInsightsOptionsRW().