clang 20.0.0git
|
#include "clang/Tooling/Syntax/BuildTree.h"
#include "clang/AST/ASTFwd.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclBase.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclarationName.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/IgnoreExpr.h"
#include "clang/AST/OperationKinds.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/AST/Stmt.h"
#include "clang/AST/TypeLoc.h"
#include "clang/AST/TypeLocVisitor.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/Specifiers.h"
#include "clang/Basic/TokenKinds.h"
#include "clang/Lex/Lexer.h"
#include "clang/Lex/LiteralSupport.h"
#include "clang/Tooling/Syntax/Nodes.h"
#include "clang/Tooling/Syntax/TokenBufferTokenManager.h"
#include "clang/Tooling/Syntax/Tokens.h"
#include "clang/Tooling/Syntax/Tree.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/PointerUnion.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/raw_ostream.h"
#include <cstddef>
#include <map>
Go to the source code of this file.
Classes | |
class | clang::syntax::TreeBuilder |
A helper class for constructing the syntax tree while traversing a clang AST. More... | |
Functions | |
static Expr * | IgnoreImplicitConstructorSingleStep (Expr *E) |
static Expr * | IgnoreCXXFunctionalCastExprWrappingConstructor (Expr *E) |
static Expr * | IgnoreImplicit (Expr *E) |
static LLVM_ATTRIBUTE_UNUSED bool | isImplicitExpr (Expr *E) |
static CallExpr::arg_range | dropDefaultArgs (CallExpr::arg_range Args) |
static syntax::NodeKind | getOperatorNodeKind (const CXXOperatorCallExpr &E) |
static SourceLocation | getQualifiedNameStart (NamedDecl *D) |
Get the start of the qualified name. | |
static SourceRange | getInitializerRange (Decl *D) |
Gets the range of the initializer inside an init-declarator C++ [dcl.decl]. | |
static SourceRange | getDeclaratorRange (const SourceManager &SM, TypeLoc T, SourceLocation Name, SourceRange Initializer) |
Gets the range of declarator as defined by the C++ grammar. | |
|
static |
Definition at line 158 of file BuildTree.cpp.
|
static |
Gets the range of declarator as defined by the C++ grammar.
E.g. int a;
-> range of a
, int *a;
-> range of *a
, int a[10];
-> range of a[10]
, int a[1][2][3];
-> range of a[1][2][3]
, int *a = nullptr
-> range of *a = nullptr
. int S::f(){}
-> range of S::f()
. FIXME: Name
must be a source range.
Definition at line 292 of file BuildTree.cpp.
References clang::Initializer, clang::SourceLocation::isInvalid(), SM, and clang::T.
|
static |
Gets the range of the initializer inside an init-declarator C++ [dcl.decl].
int a;
-> range of `,
int *a = nullptr-> range of
= nullptr.
int a{}-> range of
{}.
int a()-> range of
()`.
Definition at line 273 of file BuildTree.cpp.
|
static |
Definition at line 164 of file BuildTree.cpp.
References E, clang::NUM_OVERLOADED_OPERATORS, and clang::OO_None.
|
static |
Get the start of the qualified name.
In the examples below it gives the location of the ^
: int ^a;
int *^a;
int ^a::S::f(){}
Definition at line 250 of file BuildTree.cpp.
References D, and clang::Decl::getLocation().
Definition at line 80 of file BuildTree.cpp.
References E, IgnoreCXXFunctionalCastExprWrappingConstructor(), clang::IgnoreExprNodes(), IgnoreImplicitConstructorSingleStep(), and clang::IgnoreImplicitSingleStep().
Referenced by isImplicitExpr(), and clang::syntax::TreeBuilder::markExprChild().
Definition at line 53 of file BuildTree.cpp.
Referenced by IgnoreImplicit(), and clang::Expr::IgnoreUnlessSpelledInSource().
Definition at line 87 of file BuildTree.cpp.
References E, and IgnoreImplicit().