diff options
author | Cristian Cadar <cristic@cs.stanford.edu> | 2012-10-24 15:22:59 +0000 |
---|---|---|
committer | Cristian Cadar <cristic@cs.stanford.edu> | 2012-10-24 15:22:59 +0000 |
commit | 648f3ed8e838976b14cf7452870bef4a56c9a6fe (patch) | |
tree | 3790633103284c8413f4d4d82d841db10b18d25f /include | |
parent | a45a0b93894bcc7a3c164934c33595a98693f54c (diff) | |
download | klee-648f3ed8e838976b14cf7452870bef4a56c9a6fe.tar.gz |
Patch by Dan Liew improving the description of getZExtValue (see discussion at http://keeda.stanford.edu/pipermail/klee-dev/2012-September/000928.html)
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@166573 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-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(); |