llvm::APInt::getOneBitSet

Return an APInt with exactly one bit set in the result.

Synopsis

Declared in <llvm/ADT/APInt.h>

static
APInt
getOneBitSet(
    unsigned int numBits,
    unsigned int BitNo);

Return Value

An APInt with only bit BitNo set.

Parameters

NameDescription
numBitsBit width of the result
BitNoZero-based index of the bit to set