summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/APSInt.h
Commit message (Collapse)AuthorAge
* Annotate APInt methods where it's not clear whether they are in place with ↵Benjamin Kramer2013-11-16
| | | | | | | | warn_unused_result. Fix ScalarEvolution bugs uncovered by this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194928 91177308-0d34-0410-b5e6-96231b3b80d8
* Use pre-inc, pre-dec when possible.Jakub Staszak2013-03-20
| | | | | | | They are generally faster (at least not slower) than post-inc, post-dec. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177608 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix include guards so they exactly match file names.Jakub Staszak2013-01-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172025 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't leave IsUnsigned uninitialized in a default-constructed APSInt. CopyingRichard Smith2012-12-20
| | | | | | | such a structure has undefined behavior. Caught by -fsanitize=bool. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170652 91177308-0d34-0410-b5e6-96231b3b80d8
* Add operator== to APSInt. This will compare the signed bit before doingRichard Trieu2012-07-23
| | | | | | | | the comparison. This prevents large unsigned integers from being equal to signed negative integers of the same bit width. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160642 91177308-0d34-0410-b5e6-96231b3b80d8
* Move IsSameValue from clang's ASTImporter to be methods on theEric Christopher2012-07-15
| | | | | | | | APInt/APSInt classes. Part of rdar://11875995 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160223 91177308-0d34-0410-b5e6-96231b3b80d8
* PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() andJay Foad2010-12-07
| | | | | | | | zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method trunc(), to be const and to return a new value instead of modifying the object in place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121120 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug where APSInt::operator-- incremented instead of decremented.Ted Kremenek2009-02-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64687 91177308-0d34-0410-b5e6-96231b3b80d8
* These function return 'void'. Don't have 'return' return anything.Bill Wendling2009-02-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64136 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in getMaxValue/getMinValue to pass the right signedness theChris Lattner2009-01-30
| | | | | | | the constructed APSInt, patch suggested by Ben Laurie! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63362 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed trailing whitespace.Misha Brukman2009-01-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62000 91177308-0d34-0410-b5e6-96231b3b80d8
* Added static methods to APSInt: getMinValue and getMaxValue.Ted Kremenek2008-09-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56355 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch the asmprinter (.ll) and all the stuff it requires over toChris Lattner2008-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | | use raw_ostream instead of std::ostream. Among other goodness, this speeds up llvm-dis of kc++ with a release build from 0.85s to 0.49s (88% faster). Other interesting changes: 1) This makes Value::print be non-virtual. 2) AP[S]Int and ConstantRange can no longer print to ostream directly, use raw_ostream instead. 3) This fixes a bug in raw_os_ostream where it didn't flush itself when destroyed. 4) This adds a new SDNode::print method, instead of only allowing "dump". A lot of APIs have both std::ostream and raw_ostream versions, it would be useful to go through and systematically anihilate the std::ostream versions. This passes dejagnu, but there may be minor fallout, plz let me know if so and I'll fix it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55263 91177308-0d34-0410-b5e6-96231b3b80d8
* Rework the routines that convert AP[S]Int into a string. Now, instead ofChris Lattner2008-08-17
| | | | | | | | | | | | | | | | | | | returning an std::string by value, it fills in a SmallString/SmallVector passed in. This significantly reduces string thrashing in some cases. More specifically, this: - Adds an operator<< and a print method for APInt that allows you to directly send them to an ostream. - Reimplements APInt::toString to be much simpler and more efficient algorithmically in addition to not thrashing strings quite as much. This speeds up llvm-dis on kc++ by 7%, and may also slightly speed up the asmprinter. This also fixes a bug I introduced into the asmwriter in a previous patch w.r.t. alias printing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54873 91177308-0d34-0410-b5e6-96231b3b80d8
* Add default constructor to APSIntDaniel Dunbar2008-08-13
| | | | | | | | | - Creates uninitialized APInt. - Prevents need for embedding arbitrary constants when used as an out parameter, for example. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54757 91177308-0d34-0410-b5e6-96231b3b80d8
* Constified operator<< in APSInt.Ted Kremenek2008-02-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46882 91177308-0d34-0410-b5e6-96231b3b80d8
* constified operator~().Ted Kremenek2008-02-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46707 91177308-0d34-0410-b5e6-96231b3b80d8
* Altered ctor for APSInt to accept an optional "isUnsigned" flag. DefaultTed Kremenek2008-01-29
| | | | | | | behavior is unchanged. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46521 91177308-0d34-0410-b5e6-96231b3b80d8
* Added additional overloaded operators for APSInt to match the operators ofTed Kremenek2008-01-24
| | | | | | | | | | | | | | | | APInt. While some operators were already specifically overloaded for APSInt, others resulted in using the overloaded operator methods in APInt, which would result in the signedness bit being lost. Modified the APSInt(APInt&) constructor to be "explicit" and to take an extra (optional) flag to indicate the signedness. Making the ctor explicit will catch any implicit conversations between APSInt -> APInt -> APSInt that results in the signedness flag being lost. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46316 91177308-0d34-0410-b5e6-96231b3b80d8
* Added FoldingSet style 'profiling' support for APSInt.Ted Kremenek2008-01-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46189 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't attribute in file headers anymore. See llvmdev for theChris Lattner2007-12-29
| | | | | | | | discussion of this change. Boy are my fingers tired. ;-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45411 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed incorrect "path name" in preamble (comment) of header file.Ted Kremenek2007-10-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43402 91177308-0d34-0410-b5e6-96231b3b80d8
* Updated VC++ build system.Hartmut Kaiser2007-10-17
| | | | | | | | | | | | | | | | Silenced some VC warnings. I'm getting linker errors, though: unresolved externals: llvm::Split<class llvm::BasicBlock *,struct llvm::GraphTraits<class llvm::BasicBlock *> >(class llvm::DominatorTreeBase<class llvm::BasicBlock> &,class llvm::BasicBlock *) and llvm::Split<struct llvm::Inverse<class llvm::BasicBlock *>,struct llvm::GraphTraits<struct llvm::Inverse<class llvm::BasicBlock *> > >(class llvm::DominatorTreeBase<class llvm::BasicBlock> &,class llvm::BasicBlock *) Where are these defined? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43073 91177308-0d34-0410-b5e6-96231b3b80d8
* default this to radix 10 like the toString(Un)Signed methods.Chris Lattner2007-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41311 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid hiding issues.Chris Lattner2007-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41310 91177308-0d34-0410-b5e6-96231b3b80d8
* rename APInt::toString -> toStringUnsigned for symmetry with toStringSigned()Chris Lattner2007-08-23
| | | | | | | | Add an APSInt::toString() method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41309 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug spotted by Chris.Anders Carlsson2007-08-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40725 91177308-0d34-0410-b5e6-96231b3b80d8
* Add extend and extOrTrunc methods that do sign or zero extension depending ↵Anders Carlsson2007-08-02
| | | | | | on whether the integer is signed or not git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40724 91177308-0d34-0410-b5e6-96231b3b80d8
* add a helper method.Chris Lattner2007-07-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39885 91177308-0d34-0410-b5e6-96231b3b80d8
* add missing methods, mark stuff constChris Lattner2007-04-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35862 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a helper class (APSInt) which can represent an APInt along with signChris Lattner2007-04-05
information. This is useful when a value does have a sign associated with it. This shouldn't be used generally in LLVM for mid-level optimizer stuff. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35681 91177308-0d34-0410-b5e6-96231b3b80d8