diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-12-19 01:34:39 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-12-19 01:34:39 +0000 |
commit | 6d0483a7a365338e17537366c6c934edef2ef726 (patch) | |
tree | c1e67c22fc04d5acd68a9d82ec656428fcfbd8f4 | |
parent | 9b11d518aef8e191e5e94f3503dfddbe1c0a387a (diff) | |
download | external_llvm-6d0483a7a365338e17537366c6c934edef2ef726.zip external_llvm-6d0483a7a365338e17537366c6c934edef2ef726.tar.gz external_llvm-6d0483a7a365338e17537366c6c934edef2ef726.tar.bz2 |
Correct the description of ConstantInt::isValueValidForType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32664 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Constants.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index 5e46344..2a0c624 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -181,9 +181,11 @@ public: /// This static method returns true if the type Ty is big enough to /// represent the value V. This can be used to avoid having the get method - /// assert when V is larger than Ty can represent. Note that values are - /// always treated as unsigned so if the intention is to represent a signed - /// type, you must do the conversion first. + /// assert when V is larger than Ty can represent. Note that there are two + /// versions of this method, one for unsigned and one for signed integers. + /// Although ConstantInt canonicalizes everything to an unsigned integer, + /// the signed version avoids callers having to convert a signed quantity + /// to the appropriate unsigned type before calling the method. /// @returns true if V is a valid value for type Ty /// @brief Determine if the value is in range for the given type. static bool isValueValidForType(const Type *Ty, uint64_t V); |