aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-04-10 06:44:12 +0000
committerChris Lattner <sabre@nondot.org>2007-04-10 06:44:12 +0000
commit99b1b38818e3a1628e39af40500bad47d5207d0d (patch)
tree5f8c4e817255bf4bb3650bccd2413785f0a0b3e4 /include
parent4bda52d6b5ffa13314fe32baa1784566f70483f9 (diff)
downloadexternal_llvm-99b1b38818e3a1628e39af40500bad47d5207d0d.zip
external_llvm-99b1b38818e3a1628e39af40500bad47d5207d0d.tar.gz
external_llvm-99b1b38818e3a1628e39af40500bad47d5207d0d.tar.bz2
getLimitedValue now just forward to APInt's getLimitedValue. Mark it const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35861 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Constants.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h
index e09fc84..0659f3b 100644
--- a/include/llvm/Constants.h
+++ b/include/llvm/Constants.h
@@ -189,9 +189,8 @@ public:
/// @returns the 64-bit value of this constant if its active bits number is
/// not greater than 64, otherwise, just return the given uint64_t number.
/// @brief Get the constant's value if possible.
- uint64_t getLimitedValue(uint64_t Limit) {
- return (Val.getActiveBits() > 64 || Val.getZExtValue() > Limit) ?
- Limit : Val.getZExtValue();
+ uint64_t getLimitedValue(uint64_t Limit = ~0ULL) const {
+ return Val.getLimitedValue(Limit);
}
/// @returns the value for an integer constant of the given type that has all