diff options
-rw-r--r-- | include/klee/Expr.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/klee/Expr.h b/include/klee/Expr.h index 5888d4d6..9d170dc5 100644 --- a/include/klee/Expr.h +++ b/include/klee/Expr.h @@ -326,10 +326,15 @@ public: /// native ConstantExpr APIs. const llvm::APInt &getAPValue() const { return value; } - /// getZExtValue - Return the constant value for a limited number of bits. + /// getZExtValue - Returns the constant value zero extended to the + /// return type of this method. /// - /// This routine should be used in situations where the width of the constant - /// is known to be limited to a certain number of bits. + ///\param bits - optional parameter that can be used to check that the + ///number of bits used by this constant is <= to the parameter + ///value. This is useful for checking that type casts won't truncate + ///useful bits. + /// + /// Example: unit8_t byte= (unit8_t) constant->getZExtValue(8); uint64_t getZExtValue(unsigned bits = 64) const { assert(getWidth() <= bits && "Value may be out of range!"); return value.getZExtValue(); |