clang: lib/Interpreter/InterpreterUtils.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

15

17

22

27

31 assert(Result && "Cannot create CStyleCastPtrExpr");

33}

34

39

42 DeclsInGroup.push_back(D);

44 return DeclGroupPtr;

45}

46

53 if (!Within)

55 else {

56 if (const auto *TD = dyn_castclang::TagDecl(Within);

57 TD && !TD->getDefinition())

58

59 return nullptr;

60

62 }

63

65 return nullptr;

66

68

69 return dyn_cast(R.getFoundDecl());

70}

71

77

79

80 if (!Within)

82 else {

83 const DeclContext *PrimaryWithin = nullptr;

84 if (const auto *TD = dyn_cast(Within))

85 PrimaryWithin = dyn_cast_if_present(TD->getDefinition());

86 else

88

89

90 if (!PrimaryWithin)

91 return nullptr;

92

94 }

95

97 return nullptr;

99

101 return dyn_cast(R.getFoundDecl());

102

103 return nullptr;

104}

105

113}

@ ForVisibleRedeclaration

The lookup results will be used for redeclaration of a name, if an entity by that name already exists...

Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...

QualType getPointerType(QualType T) const

Return the uniqued reference to the type for a pointer to the specified type.

TypeSourceInfo * getTrivialTypeSourceInfo(QualType T, SourceLocation Loc=SourceLocation()) const

Allocate a TypeSourceInfo where all locations have been initialized to a given location,...

const clang::PrintingPolicy & getPrintingPolicy() const

DeclContext - This is used only as base class of specific decl types that can act as declaration cont...

DeclContext * getPrimaryContext()

getPrimaryContext - There may be many different declarations of the same entity (including forward de...

Decl - This represents one declaration (or definition), e.g.

The name of a declaration.

This represents one expression.

IdentifierInfo & get(StringRef Name)

Return the identifier token info for the specified named identifier.

static IntegerLiteral * Create(const ASTContext &C, const llvm::APInt &V, QualType type, SourceLocation l)

Returns a new integer literal with value 'V' and type 'type'.

Represents the results of name lookup.

bool empty() const

Return true if no decls were found.

void resolveKind()

Resolves the result kind of the lookup, possibly hiding decls.

NamedDecl * getFoundDecl() const

Fetch the unique decl found by this lookup.

bool isSingleResult() const

Determines if this names a single result which is not an unresolved value using decl.

void suppressDiagnostics()

Suppress the diagnostics that would normally fire because of this lookup.

This represents a decl that may have a name.

Represent a C++ namespace.

A (possibly-)qualified type.

static std::string getAsString(SplitQualType split, const PrintingPolicy &Policy)

Sema - This implements semantic analysis and AST building for C.

@ LookupOrdinaryName

Ordinary name lookup, which finds ordinary names (functions, variables, typedefs, etc....

@ LookupNestedNameSpecifierName

Look up of a name that precedes the '::' scope resolution operator in C++.

ASTContext & getASTContext() const

ExprResult BuildCStyleCastExpr(SourceLocation LParenLoc, TypeSourceInfo *Ty, SourceLocation RParenLoc, Expr *Op)

DeclGroupPtrTy BuildDeclaratorGroup(MutableArrayRef< Decl * > Group)

BuildDeclaratorGroup - convert a list of declarations into a declaration group, performing any necess...

Scope * TUScope

Translation Unit Scope - useful to Objective-C actions that need to lookup file scope declarations in...

bool LookupQualifiedName(LookupResult &R, DeclContext *LookupCtx, bool InUnqualifiedLookup=false)

Perform qualified name lookup into a given context.

bool LookupName(LookupResult &R, Scope *S, bool AllowBuiltinCreation=false, bool ForceNoCPlusPlus=false)

Perform unqualified name lookup starting from a given scope.

OpaquePtr< DeclGroupRef > DeclGroupPtrTy

Encodes a location in the source.

A container of type source information.

bool isPointerType() const

QualType getFullyQualifiedType(QualType QT, const ASTContext &Ctx, bool WithGlobalNsPrefix=false)

Generates a QualType that can be used to name the same type if used at the end of the current transla...

The JSON file list parser is used to communicate input to InstallAPI.

NamedDecl * LookupNamed(Sema &S, llvm::StringRef Name, const DeclContext *Within)

Definition InterpreterUtils.cpp:72

Sema::DeclGroupPtrTy CreateDGPtrFrom(Sema &S, Decl *D)

Definition InterpreterUtils.cpp:40

std::string GetFullTypeName(ASTContext &Ctx, QualType QT)

Definition InterpreterUtils.cpp:106

@ Result

The result type of a method or function.

IntegerLiteral * IntegerLiteralExpr(ASTContext &C, uint64_t Val)

Definition InterpreterUtils.cpp:18

NamespaceDecl * LookupNamespace(Sema &S, llvm::StringRef Name, const DeclContext *Within)

Definition InterpreterUtils.cpp:47

Expr * CStyleCastPtrExpr(Sema &S, QualType Ty, Expr *E)

Definition InterpreterUtils.cpp:23

__UINTPTR_TYPE__ uintptr_t

An unsigned integer type with the property that any valid pointer to void can be converted to this ty...

Describes how types, statements, expressions, and declarations should be printed.

unsigned AnonymousTagLocations

When printing an anonymous tag name, also print the location of that entity (e.g.,...

unsigned SuppressScope

Suppresses printing of scope specifiers.