clang API Documentation
#include "clang/Basic/LLVM.h"#include "clang/Basic/AttrKinds.h"#include "clang/AST/Type.h"#include "clang/Basic/SourceLocation.h"#include "clang/Basic/VersionTuple.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/StringRef.h"#include "llvm/ADT/StringSwitch.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/raw_ostream.h"#include <cassert>#include <cstring>#include <algorithm>#include "clang/AST/Attrs.inc"

Go to the source code of this file.
Classes | |
| class | clang::Attr |
| Attr - This represents one attribute. More... | |
| class | clang::InheritableAttr |
| class | clang::InheritableParamAttr |
| class | clang::specific_attr_iterator< SpecificAttr > |
Namespaces | |
| namespace | clang |
Typedefs | |
| typedef SmallVector< Attr *, 2 > | clang::AttrVec |
| AttrVec - A vector of Attr, which is how they are stored on the AST. | |
| typedef SmallVector< const Attr *, 2 > | clang::ConstAttrVec |
Functions | |
| void * | operator new (size_t Bytes, const clang::ASTContext &C, size_t Alignment=16) throw () |
| Placement new for using the ASTContext's allocator. | |
| void * | operator new[] (size_t Bytes, const clang::ASTContext &C, size_t Alignment) throw () |
| void | operator delete (void *Ptr, const clang::ASTContext &C, size_t) throw () |
| Placement delete companion to the new above. | |
| void | operator delete[] (void *Ptr, const clang::ASTContext &C, size_t) throw () |
| Placement delete[] companion to the new[] above. | |
| void | clang::DestroyAttrs (AttrVec &V, ASTContext &C) |
| DestroyAttrs - Destroy the contents of an AttrVec. | |
| template<typename T > | |
| specific_attr_iterator< T > | clang::specific_attr_begin (const AttrVec &vec) |
| template<typename T > | |
| specific_attr_iterator< T > | clang::specific_attr_end (const AttrVec &vec) |
| template<typename T > | |
| bool | clang::hasSpecificAttr (const AttrVec &vec) |
| template<typename T > | |
| T * | clang::getSpecificAttr (const AttrVec &vec) |
| unsigned | clang::getMaxAttrAlignment (const AttrVec &V, ASTContext &Ctx) |
| void operator delete | ( | void * | Ptr, |
| const clang::ASTContext & | C, | ||
| size_t | |||
| ) | throw () [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 1919 of file ASTContext.h.
References clang::ASTContext::Deallocate().
Referenced by clang::Attr::operator delete(), and clang::PreprocessedEntity::operator delete().
| void operator delete[] | ( | void * | Ptr, |
| const clang::ASTContext & | C, | ||
| size_t | |||
| ) | throw () [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 1954 of file ASTContext.h.
References clang::ASTContext::Deallocate().
| void* operator new | ( | size_t | Bytes, |
| const clang::ASTContext & | C, | ||
| size_t | Alignment | ||
| ) | throw () [inline] |
Placement new for using the ASTContext's allocator.
This placement form of operator new uses the ASTContext's allocator for obtaining memory. It is a non-throwing new, which means that it returns null on error. (If that is what the allocator does. The current does, so if this ever changes, this operator will have to be changed, too.) 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);
Please note that you cannot use delete on the pointer; it must be deallocated using an explicit destructor call followed by Context.Deallocate(Ptr).
| 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). |
Definition at line 1909 of file ASTContext.h.
Referenced by clang::Attr::operator new(), and clang::PreprocessedEntity::operator new().
| void* operator new[] | ( | size_t | Bytes, |
| const clang::ASTContext & | C, | ||
| size_t | Alignment = 8 |
||
| ) | throw () [inline] |
This placement form of operator new[] uses the ASTContext's allocator for obtaining memory. It is a non-throwing new[], which means that it returns null on error. 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];
Please note that you cannot use delete on the pointer; it must be deallocated using an explicit destructor call followed by Context.Deallocate(Ptr).
| 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). |
Definition at line 1943 of file ASTContext.h.
References clang::ASTContext::Allocate().