diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-02-25 19:26:01 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-02-25 19:26:01 +0000 |
commit | a7bd1d0b04004df926bfaeccc291a727ca5ce693 (patch) | |
tree | f02eb2ce33f441dff9fae49b7ee7ecf7bf332651 /llvm/lib/Support/APInt.cpp | |
parent | 84ab9a556c6c720bfa9fd5881454a272de6c3d65 (diff) | |
download | bcm5719-llvm-a7bd1d0b04004df926bfaeccc291a727ca5ce693.tar.gz bcm5719-llvm-a7bd1d0b04004df926bfaeccc291a727ca5ce693.zip |
Fix clearUnusedBits to not depend on "undefined behavior" of >> operator
when the bit size is equal to the word size. This happens to work out okay
on x86, but might not on other platforms. The change just detects when
there are no bits to clear (because BitWidth is a multiple of the word size)
and returns early.
Also, move some comments from .cpp file into header.
llvm-svn: 34602
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
0 files changed, 0 insertions, 0 deletions