clang  6.0.0svn
Classes | Namespaces | Macros | Functions
ASTContext.h File Reference

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

#include "clang/AST/ASTTypeTraits.h"
#include "clang/AST/CanonicalType.h"
#include "clang/AST/CommentCommandTraits.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclarationName.h"
#include "clang/AST/DeclBase.h"
#include "clang/AST/ExternalASTSource.h"
#include "clang/AST/NestedNameSpecifier.h"
#include "clang/AST/PrettyPrinter.h"
#include "clang/AST/RawCommentList.h"
#include "clang/AST/TemplateBase.h"
#include "clang/AST/TemplateName.h"
#include "clang/AST/Type.h"
#include "clang/Basic/AddressSpaces.h"
#include "clang/Basic/IdentifierTable.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/Linkage.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/Module.h"
#include "clang/Basic/OperatorKinds.h"
#include "clang/Basic/PartialDiagnostic.h"
#include "clang/Basic/SanitizerBlacklist.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/Specifiers.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Basic/XRayLists.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/PointerUnion.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/TinyPtrVector.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/AlignOf.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <iterator>
#include <memory>
#include <new>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
#include "clang/Basic/OpenCLImageTypes.def"

Go to the source code of this file.

Classes

struct  clang::TypeInfo
 
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...
 
class  clang::ASTContext::DynTypedNodeList
 Container for either a single DynTypedNode or for an ArrayRef to DynTypedNode. More...
 
class  clang::ASTContext::RawCommentAndCacheFlags
 
struct  clang::ASTContext::SectionInfo
 

Namespaces

 llvm
 DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterators.
 
 clang
 Dataflow Directional Tag Classes.
 
 clang::Builtin
 
 clang::comments
 

Macros

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

Functions

Selector clang::GetNullarySelector (StringRef name, ASTContext &Ctx)
 Utility function for constructing a nullary selector. More...
 
Selector clang::GetUnarySelector (StringRef name, ASTContext &Ctx)
 Utility function for constructing an unary selector. More...
 
void * operator new (size_t Bytes, const clang::ASTContext &C, size_t Alignment)
 Placement new for using the ASTContext's allocator. More...
 
void operator delete (void *Ptr, const clang::ASTContext &C, size_t)
 Placement delete companion to the new above. More...
 
void * operator new[] (size_t Bytes, const clang::ASTContext &C, size_t Alignment=8)
 This placement form of operator new[] uses the ASTContext's allocator for obtaining memory. More...
 
void operator delete[] (void *Ptr, const clang::ASTContext &C, size_t)
 Placement delete[] companion to the new[] above. More...
 

Detailed Description

Defines the clang::ASTContext interface.

Definition in file ASTContext.h.

Macro Definition Documentation

◆ IMAGE_TYPE

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

Definition at line 987 of file ASTContext.h.

Function Documentation

◆ operator delete()

void operator delete ( void *  Ptr,
const clang::ASTContext C,
size_t   
)
inline

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 2835 of file ASTContext.h.

◆ operator delete[]()

void operator delete[] ( void *  Ptr,
const clang::ASTContext C,
size_t   
)
inline

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 2873 of file ASTContext.h.

References clang::T, and clang::diff::Update.

◆ operator new()

void* operator new ( size_t  Bytes,
const clang::ASTContext C,
size_t  Alignment 
)
inline

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/AttrIterator.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):

// Default alignment (8)
IntegerLiteral *Ex = new (Context) IntegerLiteral(arguments);
// Specific alignment
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
BytesThe number of bytes to allocate. Calculated by the compiler.
CThe ASTContext that provides the allocator.
AlignmentThe alignment of the allocated memory (if the underlying allocator supports it).
Returns
The allocated memory. Could be NULL.

Definition at line 2825 of file ASTContext.h.

◆ operator new[]()

void* operator new[] ( size_t  Bytes,
const clang::ASTContext C,
size_t  Alignment = 8 
)
inline

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):

// Default alignment (8)
char *data = new (Context) char[10];
// Specific alignment
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
BytesThe number of bytes to allocate. Calculated by the compiler.
CThe ASTContext that provides the allocator.
AlignmentThe alignment of the allocated memory (if the underlying allocator supports it).
Returns
The allocated memory. Could be NULL.

Definition at line 2862 of file ASTContext.h.