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

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

#include "clang/AST/APNumericStorage.h"

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

Protected Member Functions

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

Detailed Description

Used by IntegerLiteral/FloatingLiteral/EnumConstantDecl 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 26 of file APNumericStorage.h.

Constructor & Destructor Documentation

◆ APNumericStorage()

clang::APNumericStorage::APNumericStorage ( )
inlineprotected

Definition at line 39 of file APNumericStorage.h.

Member Function Documentation

◆ getIntValue()

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

Definition at line 41 of file APNumericStorage.h.

References pVal, and VAL.

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

◆ setIntValue()

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

Definition at line 949 of file Expr.cpp.

References clang::C, pVal, and VAL.

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

Member Data Documentation

◆ pVal

uint64_t* clang::APNumericStorage::pVal

Used to store the >64 bits integer value.

Definition at line 29 of file APNumericStorage.h.

Referenced by getIntValue(), and setIntValue().

◆ VAL

uint64_t clang::APNumericStorage::VAL

Used to store the <= 64 bits integer value.

Definition at line 28 of file APNumericStorage.h.

Referenced by getIntValue(), and setIntValue().


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