This was mostly used for integers which was fixed in D147492.
The only FP usage was removed in D147497.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D147501
public:
ConstantFP(const ConstantFP &) = delete;
- /// Floating point negation must be implemented with f(x) = -0.0 - x. This
- /// method returns the negative zero constant for floating point or vector
- /// floating point types; for all other types, it returns the null value.
- static Constant *getZeroValueForNegation(Type *Ty);
-
/// This returns a ConstantFP, or a vector containing a splat of a ConstantFP,
/// 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
return C;
}
-Constant *ConstantFP::getZeroValueForNegation(Type *Ty) {
- if (Ty->isFPOrFPVectorTy())
- return getNegativeZero(Ty);
-
- return Constant::getNullValue(Ty);
-}
-
// ConstantFP accessors.
ConstantFP* ConstantFP::get(LLVMContext &Context, const APFloat& V) {