llvm.org GIT mirror llvm / 9f17eb0
remove a dead APInt ctor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54869 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 11 years ago
3 changed file(s) with 2 addition(s) and 21 deletion(s). Raw diff Collapse all Expand all
1717 #include "llvm/Support/DataTypes.h"
1818 #include
1919 #include
20
21 #define COMPILE_TIME_ASSERT(cond) extern int CTAssert[(cond) ? 1 : -1]
2220
2321 namespace llvm {
2422 class Serializer;
179177 /// @brief Construct an APInt of numBits width, initialized as bigVal[].
180178 APInt(uint32_t numBits, uint32_t numWords, const uint64_t bigVal[]);
181179
182 /// This constructor interprets Val as a string in the given radix. The
183 /// interpretation stops when the first charater that is not suitable for the
184 /// radix is encountered. Acceptable radix values are 2, 8, 10 and 16. It is
185 /// an error for the value implied by the string to require more bits than
186 /// numBits.
187 /// @param numBits the bit width of the constructed APInt
188 /// @param val the string to be interpreted
189 /// @param radix the radix of Val to use for the intepretation
190 /// @brief Construct an APInt from a string representation.
191 APInt(uint32_t numBits, const std::string& val, uint8_t radix);
192
193180 /// This constructor interprets the slen characters starting at StrStart as
194181 /// a string in the given radix. The interpretation stops when the first
195182 /// character that is not suitable for the radix is encountered. Acceptable
2323
2424 /* Assumed in hexadecimal significand parsing, and conversion to
2525 hexadecimal strings. */
26 #define COMPILE_TIME_ASSERT(cond) extern int CTAssert[(cond) ? 1 : -1]
2627 COMPILE_TIME_ASSERT(integerPartWidth % 4 == 0);
2728
2829 namespace llvm {
9191 assert(BitWidth >= MIN_INT_BITS && "bitwidth too small");
9292 assert(BitWidth <= MAX_INT_BITS && "bitwidth too large");
9393 fromString(numbits, StrStart, slen, radix);
94 }
95
96 APInt::APInt(uint32_t numbits, const std::string& Val, uint8_t radix)
97 : BitWidth(numbits), VAL(0) {
98 assert(BitWidth >= MIN_INT_BITS && "bitwidth too small");
99 assert(BitWidth <= MAX_INT_BITS && "bitwidth too large");
100 assert(!Val.empty() && "String empty?");
101 fromString(numbits, Val.c_str(), (uint32_t)Val.size(), radix);
10294 }
10395
10496 APInt::APInt(const APInt& that)
21212113
21222114 /* Assumed by lowHalf, highHalf, partMSB and partLSB. A fairly safe
21232115 and unrestricting assumption. */
2116 #define COMPILE_TIME_ASSERT(cond) extern int CTAssert[(cond) ? 1 : -1]
21242117 COMPILE_TIME_ASSERT(integerPartWidth % 2 == 0);
21252118
21262119 /* Some handy functions local to this file. */