The recently added code: static Constant *Div(const ConstantClass *V1, const ConstantClass *V2) { if (V2->isExactlyValue(0.0)) return ConstantClass::get(*Ty, INFINITY); if (V2->isExactlyValue(-0.0)) return ConstantClass::get(*Ty, -INFINITY); if (V2->isNullValue()) return 0; BuiltinType R = (BuiltinType)V1->getValue() / (BuiltinType)V2->getValue(); return ConstantClass::get(*Ty, R); } does not compile with VC++. The symbol INFINITY is undefined, nor is there an equivalent I can find.
On Mon, 2 May 2005, Jeff Cohen wrote:> The recently added code: > static Constant *Div(const ConstantClass *V1, const ConstantClass *V2) { > if (V2->isExactlyValue(0.0)) return ConstantClass::get(*Ty, INFINITY); > if (V2->isExactlyValue(-0.0)) return ConstantClass::get(*Ty, -INFINITY); > if (V2->isNullValue()) return 0; > BuiltinType R = (BuiltinType)V1->getValue() / (BuiltinType)V2->getValue(); > return ConstantClass::get(*Ty, R); > } > > does not compile with VC++. The symbol INFINITY is undefined, nor is there > an equivalent I can find.Can std::numeric_limits be used? -Chris -- http://nondot.org/sabre/ http://llvm.cs.uiuc.edu/
Yes, that will work. I'll make the change. Chris Lattner wrote:> On Mon, 2 May 2005, Jeff Cohen wrote: > >> The recently added code: >> static Constant *Div(const ConstantClass *V1, const ConstantClass *V2) { >> if (V2->isExactlyValue(0.0)) return ConstantClass::get(*Ty, INFINITY); >> if (V2->isExactlyValue(-0.0)) return ConstantClass::get(*Ty, >> -INFINITY); >> if (V2->isNullValue()) return 0; >> BuiltinType R = (BuiltinType)V1->getValue() / >> (BuiltinType)V2->getValue(); >> return ConstantClass::get(*Ty, R); >> } >> >> does not compile with VC++. The symbol INFINITY is undefined, nor is >> there an equivalent I can find. > > > Can std::numeric_limits be used? > > -Chris >