clang  12.0.0git
Protected Member Functions | List of all members
clang::APNumericStorage Class Reference

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

#include "clang/AST/Expr.h"

Inheritance diagram for clang::APNumericStorage:
Inheritance graph
Collaboration diagram for clang::APNumericStorage:
Collaboration graph

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 1418 of file Expr.h.

Constructor & Destructor Documentation

◆ APNumericStorage()

clang::APNumericStorage::APNumericStorage ( )

Definition at line 1431 of file Expr.h.

Member Function Documentation

◆ getIntValue()

llvm::APInt clang::APNumericStorage::getIntValue ( ) const

Definition at line 1433 of file Expr.h.

References clang::C.

◆ setIntValue()

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

Definition at line 860 of file Expr.cpp.

References clang::C, and clang::ASTContext::Deallocate().

Member Data Documentation

◆ pVal

uint64_t* clang::APNumericStorage::pVal

Used to store the >64 bits integer value.

Definition at line 1421 of file Expr.h.


uint64_t clang::APNumericStorage::VAL

Used to store the <= 64 bits integer value.

Definition at line 1420 of file Expr.h.

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