mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Add zextOrCopy() into APInt for convenience.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35079 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
771dbf7677
commit
b991dfeae7
@ -450,6 +450,15 @@ public:
|
||||
/// @brief Zero extend or truncate to width
|
||||
APInt &zextOrTrunc(uint32_t width);
|
||||
|
||||
/// This is a help function for convenience. If the given \p width equals to
|
||||
/// this APInt's BitWidth, just return this APInt, otherwise, just zero
|
||||
/// extend it.
|
||||
inline APInt &zextOrCopy(uint32_t width) {
|
||||
if (width == BitWidth)
|
||||
return *this;
|
||||
return zext(width);
|
||||
}
|
||||
|
||||
/// @brief Set every bit to 1.
|
||||
APInt& set();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user