clang: include/clang/AST/ASTContext.h File Reference (original) (raw)

Defines the clang::ASTContext interface. More...

#include "[clang/AST/ASTFwd.h](ASTFwd%5F8h%5Fsource.html)"
#include "[clang/AST/CanonicalType.h](CanonicalType%5F8h%5Fsource.html)"
#include "[clang/AST/CommentCommandTraits.h](CommentCommandTraits%5F8h%5Fsource.html)"
#include "[clang/AST/ComparisonCategories.h](ComparisonCategories%5F8h%5Fsource.html)"
#include "[clang/AST/Decl.h](Decl%5F8h%5Fsource.html)"
#include "[clang/AST/DeclarationName.h](DeclarationName%5F8h%5Fsource.html)"
#include "[clang/AST/ExternalASTSource.h](ExternalASTSource%5F8h%5Fsource.html)"
#include "[clang/AST/PrettyPrinter.h](PrettyPrinter%5F8h%5Fsource.html)"
#include "[clang/AST/RawCommentList.h](RawCommentList%5F8h%5Fsource.html)"
#include "[clang/AST/SYCLKernelInfo.h](SYCLKernelInfo%5F8h%5Fsource.html)"
#include "[clang/AST/TemplateName.h](TemplateName%5F8h%5Fsource.html)"
#include "[clang/Basic/LLVM.h](LLVM%5F8h%5Fsource.html)"
#include "[clang/Basic/PartialDiagnostic.h](PartialDiagnostic%5F8h%5Fsource.html)"
#include "[clang/Basic/SourceLocation.h](SourceLocation%5F8h%5Fsource.html)"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/PointerUnion.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/ADT/TinyPtrVector.h"
#include "llvm/Support/TypeSize.h"
#include <optional>
#include "clang/Basic/OpenCLImageTypes.def"
#include "clang/Basic/OpenCLExtensionTypes.def"
#include "clang/Basic/AArch64SVEACLETypes.def"
#include "clang/Basic/PPCTypes.def"
#include "clang/Basic/RISCVVTypes.def"
#include "clang/Basic/WebAssemblyReferenceTypes.def"
#include "clang/Basic/AMDGPUTypes.def"
#include "clang/Basic/HLSLIntangibleTypes.def"

Go to the source code of this file.

Classes
struct clang::TypeInfo
struct clang::TypeInfoChars
class clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic analysis of a file. More...
struct clang::ASTContext::CUDAConstantEvalContext
struct clang::ASTContext::CUDAConstantEvalContextRAII
struct clang::ASTContext::BuiltinVectorTypeInfo
struct clang::ASTContext::SectionInfo
Namespaces
namespace llvm
Diagnostic wrappers for TextAPI types for error reporting.
namespace clang
The JSON file list parser is used to communicate input to InstallAPI.
namespace clang::Builtin
namespace clang::comments
namespace clang::interp
namespace clang::serialization
Macros
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) CanQualType SingletonId;
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) CanQualType Id##Ty;
#define SVE_TYPE(Name, Id, SingletonId) CanQualType SingletonId;
#define PPC_VECTOR_TYPE(Name, Id, Size) CanQualType Id##Ty;
#define RVV_TYPE(Name, Id, SingletonId) CanQualType SingletonId;
#define WASM_TYPE(Name, Id, SingletonId) CanQualType SingletonId;
#define AMDGPU_TYPE(Name, Id, SingletonId, Width, Align) CanQualType SingletonId;
#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) CanQualType SingletonId;
#define OPT_LIST(V)
#define V(N, I) ObjCEncOptions& set##N() { Bits |= 1 << I; return *this; }
#define V(N, I) bool N() const { return Bits & 1 << I; }
Typedefs
typedef SmallVector< CXXBaseSpecifier *, 4 > clang::CXXCastPath
A simple array of base specifiers.
Functions
const StreamingDiagnostic & clang::operator<< (const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
Selector clang::GetNullarySelector (StringRef name, ASTContext &Ctx)
Utility function for constructing a nullary selector.
Selector clang::GetUnarySelector (StringRef name, ASTContext &Ctx)
Utility function for constructing an unary selector.
void * operator new (size_t Bytes, const clang::ASTContext &C, size_t Alignment)
Placement new for using the ASTContext's allocator.
void operator delete (void *Ptr, const clang::ASTContext &C, size_t)
Placement delete companion to the new above.
void * operator new[] (size_t Bytes, const clang::ASTContext &C, size_t Alignment)
This placement form of operator new[] uses the ASTContext's allocator for obtaining memory.
void operator delete[] (void *Ptr, const clang::ASTContext &C, size_t)
Placement delete[] companion to the new[] above.

Defines the clang::ASTContext interface.

Definition in file ASTContext.h.

AMDGPU_TYPE

| #define AMDGPU_TYPE | ( | | Name, | | --------------------------------------------------------------- | ------------------------ | | ----- | | | Id, | | | | | | SingletonId, | | | | | | Width, | | | | | | Align | | | | | ) | CanQualType SingletonId; | | |

EXT_OPAQUE_TYPE

| #define EXT_OPAQUE_TYPE | ( | | ExtType, | | --------------------------------------------------------------- | ---------------------------------------------------------------------------- | | -------- | | | Id, | | | | | | Ext | | | | | ) | CanQualType Id##Ty; | | |

HLSL_INTANGIBLE_TYPE

| #define HLSL_INTANGIBLE_TYPE | ( | | Name, | | --------------------------------------------------------------- | ------------------------ | | ----- | | | Id, | | | | | | SingletonId | | | | | ) | CanQualType SingletonId; | | |

IMAGE_TYPE

| #define IMAGE_TYPE | ( | | ImgType, | | --------------------------------------------------------------- | ------------------------ | | -------- | | | Id, | | | | | | SingletonId, | | | | | | Access, | | | | | | Suffix | | | | | ) | CanQualType SingletonId; | | |

OPT_LIST

Value:

V(ExpandPointedToStructures, 0) \

V(ExpandStructures, 1) \

V(IsOutermostType, 2) \

V(EncodingProperty, 3) \

V(IsStructField, 4) \

V(EncodeBlockParameters, 5) \

V(EncodeClassNames, 6) \

Definition at line 3447 of file ASTContext.h.

PPC_VECTOR_TYPE

| #define PPC_VECTOR_TYPE | ( | | Name, | | --------------------------------------------------------------- | ---------------------------------------------------------------------------- | | ----- | | | Id, | | | | | | Size | | | | | ) | CanQualType Id##Ty; | | |

RVV_TYPE

| #define RVV_TYPE | ( | | Name, | | --------------------------------------------------------------- | ------------------------ | | ----- | | | Id, | | | | | | SingletonId | | | | | ) | CanQualType SingletonId; | | |

SVE_TYPE

| #define SVE_TYPE | ( | | Name, | | --------------------------------------------------------------- | ------------------------ | | ----- | | | Id, | | | | | | SingletonId | | | | | ) | CanQualType SingletonId; | | |

V [1/2]

| #define V | ( | | N, | | --------- | ------------------------------------------------------------------------------------------------------------------------- | | -- | | | I | | | | | ) | ObjCEncOptions& set##N() { Bits |= 1 << I; return *this; } | | |

V [2/2]

| #define V | ( | | N, | | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | | -- | | | I | | | | | ) | bool N() const { return Bits & 1 << I; } | | |

WASM_TYPE

| #define WASM_TYPE | ( | | Name, | | --------------------------------------------------------------- | ------------------------ | | ----- | | | Id, | | | | | | SingletonId | | | | | ) | CanQualType SingletonId; | | |

operator delete()

Placement delete companion to the new above.

This operator is just a companion to the new above. There is no way of invoking it directly; see the new operator for more details. This operator is called implicitly by the compiler if a placement new expression using the ASTContext throws in the object constructor.

Definition at line 3663 of file ASTContext.h.

operator delete[]()

Placement delete[] companion to the new[] above.

This operator is just a companion to the new[] above. There is no way of invoking it directly; see the new[] operator for more details. This operator is called implicitly by the compiler if a placement new[] expression using the ASTContext throws in the object constructor.

Definition at line 3701 of file ASTContext.h.

operator new()

Placement new for using the ASTContext's allocator.

This placement form of operator new uses the ASTContext's allocator for obtaining memory.

IMPORTANT: These are also declared in clang/AST/ASTContextAllocate.h! Any changes here need to also be made there.

We intentionally avoid using a nothrow specification here so that the calls to this operator will not perform a null check on the result – the underlying allocator never returns null pointers.

Usage looks like this (assuming there's an ASTContext 'Context' in scope):

IntegerLiteral *Ex = new (Context) IntegerLiteral(arguments);

IntegerLiteral *Ex2 = new (Context, 4) IntegerLiteral(arguments);

Memory allocated through this placement new operator does not need to be explicitly freed, as ASTContext will free all of this memory when it gets destroyed. Please note that you cannot use delete on the pointer.

Parameters

Bytes The number of bytes to allocate. Calculated by the compiler.
C The ASTContext that provides the allocator.
Alignment The alignment of the allocated memory (if the underlying allocator supports it).

Returns

The allocated memory. Could be nullptr.

Definition at line 3652 of file ASTContext.h.

operator new[]()

This placement form of operator new[] uses the ASTContext's allocator for obtaining memory.

We intentionally avoid using a nothrow specification here so that the calls to this operator will not perform a null check on the result – the underlying allocator never returns null pointers.

Usage looks like this (assuming there's an ASTContext 'Context' in scope):

char *data = new (Context) char[10];

char *data = new (Context, 4) char[10];

Memory allocated through this placement new[] operator does not need to be explicitly freed, as ASTContext will free all of this memory when it gets destroyed. Please note that you cannot use delete on the pointer.

Parameters

Bytes The number of bytes to allocate. Calculated by the compiler.
C The ASTContext that provides the allocator.
Alignment The alignment of the allocated memory (if the underlying allocator supports it).

Returns

The allocated memory. Could be nullptr.

Definition at line 3690 of file ASTContext.h.