summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Module.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-03-07 02:58:36 +0000
committerCraig Topper <craig.topper@gmail.com>2017-03-07 02:58:36 +0000
commitbf1c9abdea9f2820ac664d45d32a2883bab5f0ad (patch)
tree3a5327ab30ae601b430e157f0dde196987697806 /lldb/source/Core/Module.cpp
parentcb7b8f1094794a920e5bbea24764b0541a607711 (diff)
downloadbcm5719-llvm-bf1c9abdea9f2820ac664d45d32a2883bab5f0ad.tar.gz
bcm5719-llvm-bf1c9abdea9f2820ac664d45d32a2883bab5f0ad.zip
[APInt] Add getBitsSetFrom and setBitsFrom to set upper bits starting at a bit
We currently have methods to set a specified number of low bits, a specified number of high bits, or a range of bits. But looking at some existing code it seems sometimes we want to set the high bits starting from a certain bit. Currently we do this with something like getHighBits(BitWidth, BitWidth - StartBit). Or once we start switching to setHighBits, setHighBits(BitWidth - StartBit) or setHighBits(getBitWidth() - StartBit). Particularly for the latter case it would be better to have a convenience method like setBitsFrom(StartBit) so we don't need to mention the bit width that's already known to the APInt object. I considered just making setBits have a default value of UINT_MAX for the hiBit argument and we would internally MIN it with the bit width. So if it wasn't specified it would be treated as bit width. This would require removing the assertion we currently have on the value of hiBit and may not be as readable. Differential Revision: https://reviews.llvm.org/D30602 llvm-svn: 297114
Diffstat (limited to 'lldb/source/Core/Module.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud