clang  6.0.0svn
Classes | Namespaces | Typedefs | Functions
AttrIterator.h File Reference
#include "clang/Basic/LLVM.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/Casting.h"
#include <cassert>
#include <cstddef>
#include <iterator>
Include dependency graph for AttrIterator.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  clang::specific_attr_iterator< SpecificAttr, Container >
 specific_attr_iterator - Iterates over a subrange of an AttrVec, only providing attributes that are of a specific type. More...
 

Namespaces

 clang
 Dataflow Directional Tag Classes.
 

Typedefs

using clang::AttrVec = SmallVector< Attr *, 4 >
 AttrVec - A vector of Attr, which is how they are stored on the AST. More...
 

Functions

void * operator new (size_t Bytes, const clang::ASTContext &C, size_t Alignment=8)
 Placement new for using the ASTContext's allocator. More...
 
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. More...
 
void operator delete (void *Ptr, const clang::ASTContext &C, size_t)
 Placement delete companion to the new above. More...
 
void operator delete[] (void *Ptr, const clang::ASTContext &C, size_t)
 Placement delete[] companion to the new[] above. More...
 
template<typename SpecificAttr , typename Container >
specific_attr_iterator< SpecificAttr, Container > clang::specific_attr_begin (const Container &container)
 
template<typename SpecificAttr , typename Container >
specific_attr_iterator< SpecificAttr, Container > clang::specific_attr_end (const Container &container)
 
template<typename SpecificAttr , typename Container >
bool clang::hasSpecificAttr (const Container &container)
 
template<typename SpecificAttr , typename Container >
SpecificAttr * clang::getSpecificAttr (const Container &container)
 

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 2899 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 2937 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 nullptr.

Definition at line 2888 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 nullptr.

Definition at line 2926 of file ASTContext.h.