[APInt] Add the truncOrSelf resizing operator to APInt
authorKerry McLaughlin <kerry.mclaughlin@arm.com>
Mon, 23 Nov 2020 11:05:50 +0000 (11:05 +0000)
committerKerry McLaughlin <kerry.mclaughlin@arm.com>
Mon, 23 Nov 2020 11:27:30 +0000 (11:27 +0000)
commitd3a0f9b9ec88ce0737470652330262f8ed46daa7
treed2a9e0861b1ab36605cf40544c096ad966fb4ece
parent1319c6624ed6b0a6fb48d975bbf278263a85fcef
[APInt] Add the truncOrSelf resizing operator to APInt

Truncates the APInt if the bit width is greater than the width specified,
otherwise do nothing

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D91445
llvm/include/llvm/ADT/APInt.h
llvm/lib/Support/APInt.cpp
llvm/unittests/ADT/APIntTest.cpp