6464826597 
								
							 
						 
						
							
							
								
								[Modules] Fix potential ODR violations by sinking the DEBUG_TYPE  
							
							... 
							
							
							
							definition below all of the header #include lines, lib/Support edition.
llvm-svn: 206847 
							
						 
						
							2014-04-22 03:07:47 +00:00  
				
					
						
							
							
								 
						
							
								c10719f55d 
								
							 
						 
						
							
							
								
								[C++11] Make use of 'nullptr' in the Support library.  
							
							... 
							
							
							
							llvm-svn: 205697 
							
						 
						
							2014-04-07 04:17:22 +00:00  
				
					
						
							
							
								 
						
							
								cb40291100 
								
							 
						 
						
							
							
								
								Fix known typos  
							
							... 
							
							
							
							Sweep the codebase for common typos. Includes some changes to visible function
names that were misspelt.
llvm-svn: 200018 
							
						 
						
							2014-01-24 17:20:08 +00:00  
				
					
						
							
							
								 
						
							
								e1fad2b560 
								
							 
						 
						
							
							
								
								Remove APInt::extractBit since it is already implemented via operator[]. Change tests for extractBit to test operator[].  
							
							... 
							
							
							
							llvm-svn: 197277 
							
						 
						
							2013-12-13 22:00:19 +00:00  
				
					
						
							
							
								 
						
							
								4497d963fb 
								
							 
						 
						
							
							
								
								[block-freq] Add the APInt method extractBit.  
							
							... 
							
							
							
							llvm-svn: 197271 
							
						 
						
							2013-12-13 20:47:34 +00:00  
				
					
						
							
							
								 
						
							
								b565f89929 
								
							 
						 
						
							
							
								
								APInt: Simplify code. No functionality change.  
							
							... 
							
							
							
							llvm-svn: 183073 
							
						 
						
							2013-06-01 11:26:39 +00:00  
				
					
						
							
							
								 
						
							
								9d406f4ec7 
								
							 
						 
						
							
							
								
								[APInt] Implement tcDecrement as a counterpart to tcIncrement. This is for use in APFloat IEEE-754R 2008 nextUp/nextDown function.  
							
							... 
							
							
							
							rdar://13852078
llvm-svn: 182801 
							
						 
						
							2013-05-28 19:50:20 +00:00  
				
					
						
							
							
								 
						
							
								df1ecbd734 
								
							 
						 
						
							
							
								
								Replace Count{Leading,Trailing}Zeros_{32,64} with count{Leading,Trailing}Zeros.  
							
							... 
							
							
							
							llvm-svn: 182680 
							
						 
						
							2013-05-24 22:23:49 +00:00  
				
					
						
							
							
								 
						
							
								773be0ce1f 
								
							 
						 
						
							
							
								
								Use pre-inc, pre-dec when possible.  
							
							... 
							
							
							
							They are generally faster (at least not slower) than post-inc, post-dec.
llvm-svn: 177608 
							
						 
						
							2013-03-20 23:56:19 +00:00  
				
					
						
							
							
								 
						
							
								6605c604b9 
								
							 
						 
						
							
							
								
								Move part of APInt implementation from header to cpp file. These methods  
							
							... 
							
							
							
							require call cpp file anyway, so we wouldn't gain anything by keeping them
inline.
llvm-svn: 175579 
							
						 
						
							2013-02-20 00:17:42 +00:00  
				
					
						
							
							
								 
						
							
								ed0881b2a6 
								
							 
						 
						
							
							
								
								Use the new script to sort the includes of every file under lib.  
							
							... 
							
							
							
							Sooooo many of these had incorrect or strange main module includes.
I have manually inspected all of these, and fixed the main module
include to be the nearest plausible thing I could find. If you own or
care about any of these source files, I encourage you to take some time
and check that these edits were sensible. I can't have broken anything
(I strictly added headers, and reordered them, never removed), but they
may not be the headers you'd really like to identify as containing the
API being implemented.
Many forward declarations and missing includes were added to a header
files to allow them to parse cleanly when included first. The main
module rule does in fact have its merits. =]
llvm-svn: 169131 
							
						 
						
							2012-12-03 16:50:05 +00:00  
				
					
						
							
							
								 
						
							
								91ce36c986 
								
							 
						 
						
							
							
								
								Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See:  http://en.wikipedia.org/wiki/If_and_only_if  Commit 164767  
							
							... 
							
							
							
							llvm-svn: 164768 
							
						 
						
							2012-09-27 10:14:43 +00:00  
				
					
						
							
							
								 
						
							
								721cffd53a 
								
							 
						 
						
							
							
								
								Fix a typo 'iff' => 'if'  
							
							... 
							
							
							
							llvm-svn: 164767 
							
						 
						
							2012-09-27 09:59:43 +00:00  
				
					
						
							
							
								 
						
							
								3aab6a86a2 
								
							 
						 
						
							
							
								
								PR13326: Fix a subtle edge case in the udiv -> magic multiply generator.  
							
							... 
							
							
							
							This caused 6 of 65k possible 8 bit udivs to be wrong.
llvm-svn: 160058 
							
						 
						
							2012-07-11 18:31:59 +00:00  
				
					
						
							
							
								 
						
							
								3d464d8068 
								
							 
						 
						
							
							
								
								Fix a crash in APInt::lshr when shiftAmt > BitWidth.  
							
							... 
							
							
							
							Patch by James Benton <jbenton@vmware.com>.
llvm-svn: 158213 
							
						 
						
							2012-06-08 18:04:52 +00:00  
				
					
						
							
							
								 
						
							
								78b505b065 
								
							 
						 
						
							
							
								
								Move APInt::operator[] inline.  
							
							... 
							
							
							
							llvm-svn: 152692 
							
						 
						
							2012-03-14 00:38:15 +00:00  
				
					
						
							
							
								 
						
							
								4c6a918cda 
								
							 
						 
						
							
							
								
								Move APInt::operator! inline, it's small and fuses well with surrounding code when inlined.  
							
							... 
							
							
							
							llvm-svn: 152688 
							
						 
						
							2012-03-14 00:01:35 +00:00  
				
					
						
							
							
								 
						
							
								3870bc4805 
								
							 
						 
						
							
							
								
								Inline a trivial helper function.  
							
							... 
							
							
							
							llvm-svn: 152577 
							
						 
						
							2012-03-12 21:18:53 +00:00  
				
					
						
							
							
								 
						
							
								0f90695e31 
								
							 
						 
						
							
							
								
								Replace a hand-coded leading one counting loop with the magic from MathExtras.h.  
							
							... 
							
							
							
							llvm-svn: 152545 
							
						 
						
							2012-03-11 19:32:35 +00:00  
				
					
						
							
							
								 
						
							
								71bd7d1e54 
								
							 
						 
						
							
							
								
								Replace the hashing functions on APInt and APFloat with overloads of the  
							
							... 
							
							
							
							new hash_value infrastructure, and replace their implementations using
hash_combine. This removes a complete copy of Jenkin's lookup3 hash
function (which is both significantly slower and lower quality than the
one implemented in hash_combine) along with a somewhat scary xor-only
hash function.
Now that APInt and APFloat can be passed directly to hash_combine,
simplify the rest of the LLVMContextImpl hashing to use the new
infrastructure.
llvm-svn: 152004 
							
						 
						
							2012-03-04 12:02:57 +00:00  
				
					
						
							
							
								 
						
							
								0dca5d8f8c 
								
							 
						 
						
							
							
								
								Fix undefined behavior.  
							
							... 
							
							
							
							llvm-svn: 151385 
							
						 
						
							2012-02-24 19:06:15 +00:00  
				
					
						
							
							
								 
						
							
								bb893fea6b 
								
							 
						 
						
							
							
								
								Add r149110 back with a fix for when the vector and the int have the same  
							
							... 
							
							
							
							width.
llvm-svn: 149151 
							
						 
						
							2012-01-27 23:33:07 +00:00  
				
					
						
							
							
								 
						
							
								2aae94fa70 
								
							 
						 
						
							
							
								
								Fix APInt::rotl and APInt::rotr so that they work correctly.  Found while writing some code that tried to use them.  
							
							... 
							
							
							
							llvm-svn: 147134 
							
						 
						
							2011-12-22 03:15:35 +00:00  
				
					
						
							
							
								 
						
							
								1c419ff50d 
								
							 
						 
						
							
							
								
								APInt: update asserts for base-36  
							
							... 
							
							
							
							Hexatridecimal was added in r139695.
And fix the unittest that now triggers the assert.
llvm-svn: 146754 
							
						 
						
							2011-12-16 20:36:31 +00:00  
				
					
						
							
							
								 
						
							
								54c9462c77 
								
							 
						 
						
							
							
								
								Fix unreachable return & simplify some branches.  
							
							... 
							
							
							
							llvm-svn: 145627 
							
						 
						
							2011-12-01 20:58:30 +00:00  
				
					
						
							
							
								 
						
							
								4f9a8081c3 
								
							 
						 
						
							
							
								
								Correctly byte-swap APInts with bit-widths greater than 64.  
							
							... 
							
							
							
							llvm-svn: 145111 
							
						 
						
							2011-11-23 21:33:37 +00:00  
				
					
						
							
							
								 
						
							
								195464184e 
								
							 
						 
						
							
							
								
								Fix APInt::operator*= so that it computes the correct result for large integers where there is unsigned overflow.  Fix APFloat::toString so that it doesn't depend on the incorrect behavior in common cases (and computes the correct result in some rare cases).  Fixes PR11086.  
							
							... 
							
							
							
							llvm-svn: 141441 
							
						 
						
							2011-10-07 23:40:49 +00:00  
				
					
						
							
							
								 
						
							
								c98ac850eb 
								
							 
						 
						
							
							
								
								U is good enough  
							
							... 
							
							
							
							llvm-svn: 140166 
							
						 
						
							2011-09-20 18:33:29 +00:00  
				
					
						
							
							
								 
						
							
								e4e20f43e4 
								
							 
						 
						
							
							
								
								Eliminate sign-comparison warnings in APInt  
							
							... 
							
							
							
							llvm-svn: 140158 
							
						 
						
							2011-09-20 18:11:52 +00:00  
				
					
						
							
							
								 
						
							
								c20a3ebba0 
								
							 
						 
						
							
							
								
								Silence -Wsign-compare warnings from GCC.  
							
							... 
							
							
							
							llvm-svn: 140043 
							
						 
						
							2011-09-19 20:08:54 +00:00  
				
					
						
							
							
								 
						
							
								663c068d46 
								
							 
						 
						
							
							
								
								Add APInt support for converting to/from hexatridecimal strings  
							
							... 
							
							
							
							llvm-svn: 139695 
							
						 
						
							2011-09-14 15:54:46 +00:00  
				
					
						
							
							
								 
						
							
								7a16288157 
								
							 
						 
						
							
							
								
								Add APInt(numBits, ArrayRef<uint64_t> bigVal) constructor to prevent future ambiguity  
							
							... 
							
							
							
							errors like the one corrected by r135261.  Migrate all LLVM callers of the old
constructor to the new one.
llvm-svn: 135431 
							
						 
						
							2011-07-18 21:45:40 +00:00  
				
					
						
							
							
								 
						
							
								b05f02e956 
								
							 
						 
						
							
							
								
								add option for literal formatting to APInt::toString()  
							
							... 
							
							
							
							toString() now takes an optional bool argument that,
depending on the radix, adds the appropriate prefix
to the integer's string representation that makes it into a
meaningful C literal, e.g.:
hexademical: '-f' becomes '-0xf'
octal: '77' becomes '077'
binary: '110' becomes '0b110'
Patch by nobled@dreamwidth.org !
llvm-svn: 133032 
							
						 
						
							2011-06-15 00:51:55 +00:00  
				
					
						
							
							
								 
						
							
								9f1d2ded13 
								
							 
						 
						
							
							
								
								fix a bug for hosts without round, PR8893.  
							
							... 
							
							
							
							llvm-svn: 131842 
							
						 
						
							2011-05-22 06:03:53 +00:00  
				
					
						
							
							
								 
						
							
								0ab5e2cded 
								
							 
						 
						
							
							
								
								Fix a ton of comment typos found by codespell.  Patch by  
							
							... 
							
							
							
							Luis Felipe Strano Moraes!
llvm-svn: 129558 
							
						 
						
							2011-04-15 05:18:47 +00:00  
				
					
						
							
							
								 
						
							
								0bb2ad2cf7 
								
							 
						 
						
							
							
								
								Constant folding support for calls to umul.with.overflow(), basically identical to the smul.with.overflow() code.  
							
							... 
							
							
							
							llvm-svn: 128379 
							
						 
						
							2011-03-27 14:26:13 +00:00  
				
					
						
							
							
								 
						
							
								09a51bab5d 
								
							 
						 
						
							
							
								
								Add an argument to APInt's magic udiv calculation to specify the number of bits that are known zero in the divided number.  
							
							... 
							
							
							
							This will come in handy soon.
llvm-svn: 127828 
							
						 
						
							2011-03-17 20:39:06 +00:00  
				
					
						
							
							
								 
						
							
								8731d0cc83 
								
							 
						 
						
							
							
								
								The signed version of our "magic number" computation for the integer approximation  
							
							... 
							
							
							
							of a constant had a minor typo introduced when copying it from the book, which
caused it to favor negative approximations over positive approximations in many
cases. Positive approximations require fewer operations beyond the multiplication.
In the case of division by 3, we still generate code that is a single instruction
larger than GCC's code.
llvm-svn: 126097 
							
						 
						
							2011-02-21 00:22:02 +00:00  
				
					
						
							
							
								 
						
							
								583abbc4df 
								
							 
						 
						
							
							
								
								PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and  
							
							... 
							
							
							
							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.
llvm-svn: 121120 
							
						 
						
							2010-12-07 08:25:19 +00:00  
				
					
						
							
							
								 
						
							
								f1a04edb42 
								
							 
						 
						
							
							
								
								APInt: microoptimize a few methods.  
							
							... 
							
							
							
							llvm-svn: 120912 
							
						 
						
							2010-12-04 18:05:36 +00:00  
				
					
						
							
							
								 
						
							
								25a5e4ca1f 
								
							 
						 
						
							
							
								
								PR5207: Rename overloaded APInt methods set(), clear(), flip() to  
							
							... 
							
							
							
							setAllBits(), setBit(unsigned), etc.
llvm-svn: 120564 
							
						 
						
							2010-12-01 08:53:58 +00:00  
				
					
						
							
							
								 
						
							
								15084f085d 
								
							 
						 
						
							
							
								
								PR5207: Make APInt::set(), APInt::clear() and APInt::flip() return void.  
							
							... 
							
							
							
							llvm-svn: 120413 
							
						 
						
							2010-11-30 09:02:01 +00:00  
				
					
						
							
							
								 
						
							
								5ed61fe6a1 
								
							 
						 
						
							
							
								
								Bounds-check APInt's operator[].  
							
							... 
							
							
							
							llvm-svn: 119708 
							
						 
						
							2010-11-18 17:14:56 +00:00  
				
					
						
							
							
								 
						
							
								b9681ad442 
								
							 
						 
						
							
							
								
								fix a bug I introduced, no idea how this didn't repro right.  
							
							... 
							
							
							
							llvm-svn: 116462 
							
						 
						
							2010-10-14 00:30:00 +00:00  
				
					
						
							
							
								 
						
							
								698661c741 
								
							 
						 
						
							
							
								
								add uadd_ov/usub_ov to apint, consolidate constant folding  
							
							... 
							
							
							
							logic to use the new APInt methods.  Among other things this
implements rdar://8501501 - llvm.smul.with.overflow.i32 should constant fold
which comes from "clang -ftrapv", originally brought to my attention from PR8221.
llvm-svn: 116457 
							
						 
						
							2010-10-14 00:05:07 +00:00  
				
					
						
							
							
								 
						
							
								2c819b0358 
								
							 
						 
						
							
							
								
								constify these methods.  
							
							... 
							
							
							
							llvm-svn: 116455 
							
						 
						
							2010-10-13 23:54:10 +00:00  
				
					
						
							
							
								 
						
							
								79bdd88fa4 
								
							 
						 
						
							
							
								
								add a few operations for signed operations that also  
							
							... 
							
							
							
							return an overflow flag.
llvm-svn: 116452 
							
						 
						
							2010-10-13 23:46:33 +00:00  
				
					
						
							
							
								 
						
							
								b91c903f46 
								
							 
						 
						
							
							
								
								stomp some more undefined behavior, PR7775.  
							
							... 
							
							
							
							llvm-svn: 111337 
							
						 
						
							2010-08-18 00:33:47 +00:00  
				
					
						
							
							
								 
						
							
								92d8998348 
								
							 
						 
						
							
							
								
								Don't pass StringRef by reference.  
							
							... 
							
							
							
							llvm-svn: 108366 
							
						 
						
							2010-07-14 22:38:02 +00:00  
				
					
						
							
							
								 
						
							
								9e01b615a4 
								
							 
						 
						
							
							
								
								improve portability to systems that don't have round, patch by  
							
							... 
							
							
							
							Evzen Muller!
llvm-svn: 103877 
							
						 
						
							2010-05-15 17:11:55 +00:00