clang 20.0.0git
Namespaces
SourceCodeBuilders.h File Reference

This file collects facilities for generating source code strings. More...

#include "clang/AST/ASTContext.h"
#include "clang/AST/Expr.h"
#include <string>

Go to the source code of this file.

Namespaces

namespace  clang
 The JSON file list parser is used to communicate input to InstallAPI.
 
namespace  clang::tooling
 

Functions

Code analysis utilities.

Ignores implicit object-construction expressions in addition to the normal implicit expressions that are ignored.

const Exprclang::tooling::reallyIgnoreImplicit (const Expr &E)
 
bool clang::tooling::mayEverNeedParens (const Expr &E)
 Determines whether printing this expression in any expression requires parentheses to preserve its meaning.
 
bool clang::tooling::needParensBeforeDotOrArrow (const Expr &E)
 Determines whether printing this expression to the left of a dot or arrow operator requires a parentheses to preserve its meaning.
 
bool clang::tooling::needParensAfterUnaryOperator (const Expr &E)
 Determines whether printing this expression to the right of a unary operator requires a parentheses to preserve its meaning.
 
bool clang::tooling::isKnownPointerLikeType (QualType Ty, ASTContext &Context)
 

Basic code-string generation utilities.

enum class  clang::tooling::PLTClass : bool { clang::tooling::Value , clang::tooling::Pointer }
 Specifies how to classify pointer-like types – like values or like pointers – with regard to generating member-access syntax. More...
 
std::optional< std::string > clang::tooling::buildParens (const Expr &E, const ASTContext &Context)
 Builds source for an expression, adding parens if needed for unambiguous parsing.
 
std::optional< std::string > clang::tooling::buildDereference (const Expr &E, const ASTContext &Context)
 Builds idiomatic source for the dereferencing of E: prefix with * but simplify when it already begins with &.
 
std::optional< std::string > clang::tooling::buildAddressOf (const Expr &E, const ASTContext &Context)
 Builds idiomatic source for taking the address of E: prefix with & but simplify when it already begins with *.
 
std::optional< std::string > clang::tooling::buildDot (const Expr &E, const ASTContext &Context)
 Adds a dot to the end of the given expression, but adds parentheses when needed by the syntax, and simplifies to -> when possible, e.g.:
 
std::optional< std::string > clang::tooling::buildArrow (const Expr &E, const ASTContext &Context)
 Adds an arrow to the end of the given expression, but adds parentheses when needed by the syntax, and simplifies to .
 
std::optional< std::string > clang::tooling::buildAccess (const Expr &E, ASTContext &Context, PLTClass Classification=PLTClass::Pointer)
 Adds an appropriate access operator (.
 

Detailed Description

This file collects facilities for generating source code strings.

Definition in file SourceCodeBuilders.h.