diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2007-03-19 20:39:08 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2007-03-19 20:39:08 +0000 |
| commit | 362fb29d80cad879e336e4d0ab37982efac4b089 (patch) | |
| tree | 33ce4cb1604e2aee99a0c420605325b153b683d5 | |
| parent | 6fae35acd3bf02e697e162402a4be22e61b7805e (diff) | |
| download | bcm5719-llvm-362fb29d80cad879e336e4d0ab37982efac4b089.tar.gz bcm5719-llvm-362fb29d80cad879e336e4d0ab37982efac4b089.zip | |
Allow ConstantInt::get(Ty, uint64_t) to interpret the 64-bit values as a
negative number. This is needed to fix test/Assembler/2007-03-19-NegValue.ll
llvm-svn: 35181
| -rw-r--r-- | llvm/include/llvm/Constants.h | 2 | ||||
| -rw-r--r-- | llvm/lib/VMCore/Constants.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/include/llvm/Constants.h b/llvm/include/llvm/Constants.h index 988b53a284c..c307356247c 100644 --- a/llvm/include/llvm/Constants.h +++ b/llvm/include/llvm/Constants.h @@ -94,7 +94,7 @@ public: /// either getSExtValue() or getZExtValue() will yield a correctly sized and /// signed value for the type Ty. /// @brief Get a ConstantInt for a specific value. - static ConstantInt *get(const Type *Ty, uint64_t V); + static ConstantInt *get(const Type *Ty, uint64_t V, bool isSigned = false); /// Return a ConstantInt with the specified value and an implied Type. The /// type is the integer type that corresponds to the bit width of the value. diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp index 1685923e433..e5417f52456 100644 --- a/llvm/lib/VMCore/Constants.cpp +++ b/llvm/lib/VMCore/Constants.cpp @@ -203,9 +203,9 @@ typedef DenseMap<DenseMapAPIntKeyInfo::KeyTy, ConstantInt*, DenseMapAPIntKeyInfo> IntMapTy; static ManagedStatic<IntMapTy> IntConstants; -ConstantInt *ConstantInt::get(const Type *Ty, uint64_t V) { +ConstantInt *ConstantInt::get(const Type *Ty, uint64_t V, bool isSigned) { const IntegerType *ITy = cast<IntegerType>(Ty); - return get(APInt(ITy->getBitWidth(), V)); + return get(APInt(ITy->getBitWidth(), V, isSigned)); } // Get a ConstantInt from an APInt. Note that the value stored in the DenseMap |

