clang API Documentation

Protected Member Functions
clang::APNumericStorage Class Reference

Used by IntegerLiteral/FloatingLiteral to store the numeric without leaking memory. More...

#include <Expr.h>

Inheritance diagram for clang::APNumericStorage:
Inheritance graph
[legend]
Collaboration diagram for clang::APNumericStorage:
Collaboration graph
[legend]

List of all members.

Protected Member Functions

 APNumericStorage ()
llvm::APInt getIntValue () const
void setIntValue (const ASTContext &C, const llvm::APInt &Val)

Detailed Description

Used by IntegerLiteral/FloatingLiteral to store the numeric without leaking memory.

For large floats/integers, APFloat/APInt will allocate memory from the heap to represent these numbers. Unfortunately, when we use a BumpPtrAllocator to allocate IntegerLiteral/FloatingLiteral nodes the memory associated with the APFloat/APInt values will never get freed. APNumericStorage uses ASTContext's allocator for memory allocation.

Definition at line 1226 of file Expr.h.


Constructor & Destructor Documentation

clang::APNumericStorage::APNumericStorage ( ) [inline, protected]

Definition at line 1239 of file Expr.h.


Member Function Documentation

llvm::APInt clang::APNumericStorage::getIntValue ( ) const [inline, protected]

Definition at line 1241 of file Expr.h.

References pVal, and VAL.

Referenced by clang::APIntStorage::getValue(), and clang::APFloatStorage::getValue().

void APNumericStorage::setIntValue ( const ASTContext C,
const llvm::APInt &  Val 
) [protected]

Member Data Documentation

Used to store the >64 bits integer value.

Definition at line 1229 of file Expr.h.

Referenced by getIntValue(), and setIntValue().

Used to store the <= 64 bits integer value.

Definition at line 1228 of file Expr.h.

Referenced by getIntValue(), and setIntValue().


The documentation for this class was generated from the following files: