LLVM API Documentation

MCContext.h File Reference

#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/Allocator.h"

Include dependency graph for MCContext.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  llvm

Classes

class  llvm::MCContext

Functions

void * operator new (size_t Bytes, llvm::MCContext &C, size_t Alignment=16) throw ()
 Placement new for using the MCContext's allocator.
void operator delete (void *Ptr, llvm::MCContext &C, size_t) throw ()
 Placement delete companion to the new above.
void * operator new[] (size_t Bytes, llvm::MCContext &C, size_t Alignment=16) throw ()
void operator delete[] (void *Ptr, llvm::MCContext &C) throw ()
 Placement delete[] companion to the new[] above.


Function Documentation

void operator delete ( void *  Ptr,
llvm::MCContext &  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 MCContext throws in the object constructor.

Definition at line 128 of file MCContext.h.

References llvm::MCContext::Deallocate().

Referenced by llvm::DenseMap< const llvm::BasicBlock *, llvm::MachineBasicBlock * >::~DenseMap(), llvm::SmallVectorImpl< const const const std::pair< char *, std::pair< U::entry *, char * > > >::~SmallVectorImpl(), and llvm::TypeMapBase::~TypeMapBase().

void operator delete[] ( void *  Ptr,
llvm::MCContext &  C 
) 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 MCContext throws in the object constructor.

Definition at line 163 of file MCContext.h.

References llvm::CallingConv::C.

void* operator new ( size_t  Bytes,
llvm::MCContext &  C,
size_t  Alignment = 16 
) throw () [inline]

Placement new for using the MCContext's allocator.

This placement form of operator new uses the MCContext'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 MCContext 'Context' in scope):

 // Default alignment (16)
 IntegerLiteral *Ex = new (Context) IntegerLiteral(arguments);
 // Specific alignment
 IntegerLiteral *Ex2 = new (Context, 8) 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).

Parameters:
Bytes The number of bytes to allocate. Calculated by the compiler.
C The MCContext that provides the allocator.
Alignment The alignment of the allocated memory (if the underlying allocator supports it).
Returns:
The allocated memory. Could be NULL.

Definition at line 118 of file MCContext.h.

References Alignment, and llvm::MCContext::Allocate().

Referenced by llvm::NamedMDNode::operator new(), llvm::MDNode::operator new(), llvm::MDString::operator new(), llvm::UnreachableInst::operator new(), llvm::UnwindInst::operator new(), llvm::InsertValueInst::operator new(), llvm::ShuffleVectorInst::operator new(), llvm::StoreInst::operator new(), llvm::BinaryOperator::operator new(), llvm::UnaryInstruction::operator new(), llvm::GlobalVariable::operator new(), llvm::GlobalAlias::operator new(), llvm::CompareConstantExpr::operator new(), llvm::InsertValueConstantExpr::operator new(), llvm::ExtractValueConstantExpr::operator new(), llvm::ShuffleVectorConstantExpr::operator new(), llvm::InsertElementConstantExpr::operator new(), llvm::ExtractElementConstantExpr::operator new(), llvm::SelectConstantExpr::operator new(), llvm::BinaryConstantExpr::operator new(), llvm::UnaryConstantExpr::operator new(), llvm::UndefValue::operator new(), llvm::ConstantPointerNull::operator new(), llvm::ConstantAggregateZero::operator new(), llvm::ConstantFP::operator new(), and llvm::ConstantInt::operator new().

void* operator new[] ( size_t  Bytes,
llvm::MCContext &  C,
size_t  Alignment = 16 
) throw () [inline]

This placement form of operator new[] uses the MCContext'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 MCContext 'Context' in scope):

 // Default alignment (16)
 char *data = new (Context) char[10];
 // Specific alignment
 char *data = new (Context, 8) 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).

Parameters:
Bytes The number of bytes to allocate. Calculated by the compiler.
C The MCContext that provides the allocator.
Alignment The alignment of the allocated memory (if the underlying allocator supports it).
Returns:
The allocated memory. Could be NULL.

Definition at line 152 of file MCContext.h.

References Alignment, and llvm::MCContext::Allocate().