class APSIntType

Declaration

class APSIntType { /* full declaration omitted */ };

Description

A record of the "type" of an APSInt, used for conversions.

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h:19

Member Variables

private uint32_t BitWidth
private bool IsUnsigned

Method Overview

  • public constexpr APSIntType(uint32_t Width, bool Unsigned)
  • public APSIntType(const llvm::APSInt & Value)
  • public void apply(llvm::APSInt & Value) const
  • public llvm::APSInt convert(const llvm::APSInt & Value) const
  • public uint32_t getBitWidth() const
  • public llvm::APSInt getMaxValue() const
  • public llvm::APSInt getMinValue() const
  • public llvm::APSInt getValue(uint64_t RawValue) const
  • public llvm::APSInt getZeroValue() const
  • public bool isUnsigned() const
  • public clang::ento::APSIntType::RangeTestResultKind testInRange(const llvm::APSInt & Val, bool AllowMixedSign) const

Methods

constexpr APSIntType(uint32_t Width,
                     bool Unsigned)

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h:24

Parameters

uint32_t Width
bool Unsigned

APSIntType(const llvm::APSInt& Value)

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h:27

Parameters

const llvm::APSInt& Value

void apply(llvm::APSInt& Value) const

Description

Convert a given APSInt, in place, to match this type. This behaves like a C cast: converting 255u8 (0xFF) to s16 gives 255 (0x00FF), and converting -1s8 (0xFF) to u16 gives 65535 (0xFFFF).

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h:37

Parameters

llvm::APSInt& Value

llvm::APSInt convert(
    const llvm::APSInt& Value) const

Description

Convert and return a new APSInt with the given value, but this type's bit width and signedness.

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h:48

Parameters

const llvm::APSInt& Value

uint32_t getBitWidth() const

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h:30

llvm::APSInt getMaxValue() const

Description

Returns the maximum value for this type.

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h:65

llvm::APSInt getMinValue() const

Description

Returns the minimum value for this type.

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h:60

llvm::APSInt getValue(uint64_t RawValue) const

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h:69

Parameters

uint64_t RawValue

llvm::APSInt getZeroValue() const

Description

Returns an all-zero value for this type.

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h:55

bool isUnsigned() const

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h:31

clang::ento::APSIntType::RangeTestResultKind
testInRange(const llvm::APSInt& Val,
            bool AllowMixedSign) const

Description

Tests whether a given value is losslessly representable using this type.

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h:88

Parameters

const llvm::APSInt& Val
The value to test.
bool AllowMixedSign
Whether or not to allow signedness conversions. This determines whether -1s8 is considered in range for 'unsigned char' (u8).