ΒΆllvm::Optional<std::string> buildAccess(
const clang::Expr& E,
clang::ASTContext& Context,
clang::tooling::PLTClass Classification =
PLTClass::Pointer)
llvm::Optional<std::string> buildAccess(
const clang::Expr& E,
clang::ASTContext& Context,
clang::tooling::PLTClass Classification =
PLTClass::Pointer)
Description
Adds an appropriate access operator (`.`, `->` or nothing, in the case of implicit `this`) to the end of the given expression. Adds parentheses when needed by the syntax and simplifies when possible. If `PLTypeClass` is `Pointer`, for known pointer-like types (see `isKnownPointerLikeType`), treats `operator->` and `operator*` like the built-in `->` and `*` operators. `x` becomes `x->` or `x.`, depending on `E`'s type `a+b` becomes `(a+b)->` or `(a+b).`, depending on `E`'s type ` &a ` becomes `a.` `*a` becomes `a->`
Declared at: clang/include/clang/Tooling/Transformer/SourceCodeBuilders.h:115
Parameters
- const clang::Expr& E
- clang::ASTContext& Context
- clang::tooling::PLTClass Classification = PLTClass::Pointer