aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <djg@cray.com>2008-02-11 23:45:14 +0000
committerDan Gohman <djg@cray.com>2008-02-11 23:45:14 +0000
commit3a8f6b9e49c345bab5d16da7d3dfb6cb9f35cd85 (patch)
treecb79a30fbc6b31c33aeeac942d69005926e4b84a
parent8451d1fd819fcdf348ab8cf94c72340c6cbab0a2 (diff)
downloadexternal_llvm-3a8f6b9e49c345bab5d16da7d3dfb6cb9f35cd85.zip
external_llvm-3a8f6b9e49c345bab5d16da7d3dfb6cb9f35cd85.tar.gz
external_llvm-3a8f6b9e49c345bab5d16da7d3dfb6cb9f35cd85.tar.bz2
Correct the order of the arguments in the examples in the comments
for APInt::getBitsSet. And fix an off-by-one bug in "wrapping" mode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46978 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/ADT/APInt.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h
index 7fe79e2..a1ccb85 100644
--- a/include/llvm/ADT/APInt.h
+++ b/include/llvm/ADT/APInt.h
@@ -371,9 +371,9 @@ public:
/// Constructs an APInt value that has a contiguous range of bits set. The
/// bits from loBit to hiBit will be set. All other bits will be zero. For
- /// example, with parameters(32, 15, 0) you would get 0x0000FFFF. If hiBit is
+ /// example, with parameters(32, 0, 15) you would get 0x0000FFFF. If hiBit is
/// less than loBit then the set bits "wrap". For example, with
- /// parameters (32, 3, 28), you would get 0xF000000F.
+ /// parameters (32, 28, 3), you would get 0xF000000F.
/// @param numBits the intended bit width of the result
/// @param loBit the index of the lowest bit set.
/// @param hiBit the index of the highest bit set.
@@ -384,7 +384,7 @@ public:
assert(loBit < numBits && "loBit out of range");
if (hiBit < loBit)
return getLowBitsSet(numBits, hiBit+1) |
- getHighBitsSet(numBits, numBits-loBit+1);
+ getHighBitsSet(numBits, numBits-loBit);
return getLowBitsSet(numBits, hiBit-loBit+1).shl(loBit);
}