LLVM API Documentation

llvm::ConstantFP Class Reference

#include <Constants.h>

Inheritance diagram for llvm::ConstantFP:
[legend]
Collaboration diagram for llvm::ConstantFP:
[legend]

List of all members.

Public Member Functions

const APFloat & getValueAPF () const
virtual bool isNullValue () const
bool isExactlyValue (const APFloat &V) const
bool isExactlyValue (double V) const

Static Public Member Functions

static ConstantFP * get (const APFloat &V)
 get() - Static factory methods - Return objects of the specified value
static ConstantFP * get (const Type *Ty, double V)
static bool isValueValidForType (const Type *Ty, const APFloat &V)
 isValueValidForType - return true if Ty is big enough to represent V.
static ConstantFP * getNegativeZero (const Type *Ty)
static bool classof (const ConstantFP *)
 Methods for support type inquiry through isa, cast, and dyn_cast:.
static bool classof (const Value *V)

Protected Member Functions

 ConstantFP (const Type *Ty, const APFloat &V)
void * operator new (size_t s)


Detailed Description

ConstantFP - Floating Point Values [float, double]

Definition at line 226 of file Constants.h.


Constructor & Destructor Documentation

ConstantFP::ConstantFP ( const Type *  Ty,
const APFloat &  V 
) [protected]

Definition at line 293 of file Constants.cpp.

References llvm::APFloat::getSemantics(), and TypeToFloatSemantics().


Member Function Documentation

void* llvm::ConstantFP::operator new ( size_t  s  )  [inline, protected]

Reimplemented from llvm::User.

Definition at line 234 of file Constants.h.

ConstantFP * ConstantFP::get ( const APFloat &  V  )  [static]

ConstantFP * ConstantFP::get ( const Type *  Ty,
double  V 
) [static]

get() - This returns a constant fp for the specified value in the specified type. This should only be used for simple constant values like 2.0/1.0 etc, that are known-valid both as double and as the target format.

get() - This returns a constant fp for the specified value in the specified type. This should only be used for simple constant values like 2.0/1.0 etc, that are known-valid both as double and as the target format.

Definition at line 374 of file Constants.cpp.

References llvm::APFloat::convert(), llvm::APFloat::rmNearestTiesToEven, and TypeToFloatSemantics().

bool ConstantFP::isValueValidForType ( const Type *  Ty,
const APFloat &  V 
) [static]

const APFloat& llvm::ConstantFP::getValueAPF (  )  const [inline]

bool ConstantFP::isNullValue (  )  const [virtual]

isNullValue - Return true if this is the value that would be returned by getNullValue. Don't depend on == for doubles to tell us it's zero, it considers -0.0 to be null as well as 0.0. :(

Implements llvm::Constant.

Definition at line 299 of file Constants.cpp.

References llvm::APFloat::isNegative(), and llvm::APFloat::isZero().

ConstantFP * ConstantFP::getNegativeZero ( const Type *  Ty  )  [static]

bool ConstantFP::isExactlyValue ( const APFloat &  V  )  const

isExactlyValue - We don't rely on operator== working on double values, as it returns true for things that are clearly not equal, like -0.0 and 0.0. As such, this method can be used to do an exact bit-for-bit comparison of two floating point values. The version with a double operand is retained because it's so convenient to write isExactlyValue(2.0), but please use it only for simple constants.

Definition at line 309 of file Constants.cpp.

References llvm::APFloat::bitwiseIsEqual().

Referenced by isExactlyValue().

bool llvm::ConstantFP::isExactlyValue ( double  V  )  const [inline]

static bool llvm::ConstantFP::classof ( const ConstantFP *   )  [inline, static]

Methods for support type inquiry through isa, cast, and dyn_cast:.

Definition at line 276 of file Constants.h.

static bool llvm::ConstantFP::classof ( const Value *  V  )  [inline, static]

Reimplemented from llvm::Constant.

Definition at line 277 of file Constants.h.

References llvm::Value::ConstantFPVal, and llvm::Value::getValueID().


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