>> // >> ===------------------------------------------------------------------ >> ----===// >> // APInt Class >> // >> ===------------------------------------------------------------------ >> ----===// >> @@ -40,14 +55,18 @@ >> class APInt { >> /// Friend Functions of APInt declared here. For detailed >> comments, >> /// see bottom of this file. >> - friend bool isIntN(unsigned N, const APInt& APIVal); >> - friend APInt ByteSwap(const APInt& APIVal); >> - friend APInt LogBase2(const APInt& APIVal); >> - friend double APIntToDouble(const APInt& APIVal); >> - friend float APIntToFloat(const APInt& APIVal); >> + friend bool APIntOps::isIntN(unsigned N, const APInt& APIVal); >> + friend APInt APIntOps::ByteSwap(const APInt& APIVal); >> + friend APInt APIntOps::LogBase2(const APInt& APIVal); >> + friend APInt APIntOps::ashr(const APInt& LHS, unsigned shiftAmt); >> + friend APInt APIntOps::lshr(const APInt& LHS, unsigned shiftAmt); >> + friend APInt APIntOps::shl(const APInt& LHS, unsigned shiftAmt); >> + friend APInt APIntOps::sdiv(const APInt& LHS, const APInt& RHS); >> + friend APInt APIntOps::udiv(const APInt& LHS, const APInt& RHS); >> + friend APInt APIntOps::srem(const APInt& LHS, const APInt& RHS); >> + friend APInt APIntOps::urem(const APInt& LHS, const APInt& RHS); > > There's a lot of friend functions here. Perhaps these could go at the > bottom of the class declaration instead of the top.
Actually, please make each of these a public method. This provides the ugly "X = X.udiv(Y)" syntax. Then add the namespace versions as simple inline functions that that just call the method version. -Chris _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits