diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-10-20 07:07:24 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-10-20 07:07:24 +0000 |
commit | e0fc4dfc2275a2c36583e5800854e64d5f5e3255 (patch) | |
tree | 6a3d057b6742055ed3a3592e58421a7b41b42f1e /llvm/docs | |
parent | 5d417e35bc36094f2e6519866fd25f4d0db6c551 (diff) | |
download | bcm5719-llvm-e0fc4dfc2275a2c36583e5800854e64d5f5e3255.tar.gz bcm5719-llvm-e0fc4dfc2275a2c36583e5800854e64d5f5e3255.zip |
For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.
llvm-svn: 31063
Diffstat (limited to 'llvm/docs')
-rw-r--r-- | llvm/docs/ProgrammersManual.html | 19 | ||||
-rw-r--r-- | llvm/docs/Stacker.html | 10 |
2 files changed, 12 insertions, 17 deletions
diff --git a/llvm/docs/ProgrammersManual.html b/llvm/docs/ProgrammersManual.html index bd797476266..950c937824a 100644 --- a/llvm/docs/ProgrammersManual.html +++ b/llvm/docs/ProgrammersManual.html @@ -2390,8 +2390,8 @@ provide a name for it (probably based on the name of the translation unit).</p> <div class="doc_text"> <p>Constant represents a base class for different types of constants. It -is subclassed by ConstantBool, ConstantInt, ConstantSInt, ConstantUInt, -ConstantArray etc for representing the various types of Constants.</p> +is subclassed by ConstantBool, ConstantInt, ConstantArray etc for representing +the various types of Constants.</p> </div> @@ -2406,17 +2406,12 @@ ConstantArray etc for representing the various types of Constants.</p> <div class="doc_subsubsection">Important Subclasses of Constant </div> <div class="doc_text"> <ul> - <li>ConstantSInt : This subclass of Constant represents a signed integer - constant. + <li>ConstantInt : This subclass of Constant represents an integer constant. <ul> - <li><tt>int64_t getValue() const</tt>: Returns the underlying value of - this constant. </li> - </ul> - </li> - <li>ConstantUInt : This class represents an unsigned integer. - <ul> - <li><tt>uint64_t getValue() const</tt>: Returns the underlying value of - this constant. </li> + <li><tt>int64_t getSExtValue() const</tt>: Returns the underlying value of + this constant as a sign extended signed integer value.</li> + <li><tt>uint64_t getZExtValue() const</tt>: Returns the underlying value + of this constant as a zero extended unsigned integer value.</li> </ul> </li> <li>ConstantFP : This class represents a floating point constant. diff --git a/llvm/docs/Stacker.html b/llvm/docs/Stacker.html index 7656dc10c08..a49b56de863 100644 --- a/llvm/docs/Stacker.html +++ b/llvm/docs/Stacker.html @@ -139,7 +139,7 @@ this: </p> Value* expression(BasicBlock* bb, Value* a, Value* b, Value* x, Value* y ) { - ConstantSInt* one = ConstantSInt::get(Type::IntTy, 1); + ConstantInt* one = ConstantInt::get(Type::IntTy, 1); BinaryOperator* or1 = BinaryOperator::createOr(a, b, "", bb); BinaryOperator* add1 = BinaryOperator::createAdd(x, one, "", bb); BinaryOperator* add2 = BinaryOperator::createAdd(y, one, "", bb); @@ -308,7 +308,7 @@ things, this leads to the idiom: </p> <pre> std::vector<Value*> index_vector; -index_vector.push_back( ConstantSInt::get( Type::LongTy, 0 ); +index_vector.push_back( ConstantInt::get( Type::LongTy, 0 ); // ... push other indices ... GetElementPtrInst* gep = new GetElementPtrInst( ptr, index_vector ); </pre> @@ -367,9 +367,9 @@ functions in the LLVM IR that make things easier. Here's what I learned: </p> <ul> <li>Constants are Values like anything else and can be operands of instructions</li> <li>Integer constants, frequently needed, can be created using the static "get" - methods of the ConstantInt, ConstantSInt, and ConstantUInt classes. The nice thing - about these is that you can "get" any kind of integer quickly.</li> - <li>There's a special method on Constant class which allows you to get the null + methods of the ConstantInt class. The nice thing about these is that you can + "get" any kind of integer quickly.</li> + <li>There's a special method on Constant class which allows you to get the null constant for <em>any</em> type. This is really handy for initializing large arrays or structures, etc.</li> </ul> |