1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

841 Commits

Author SHA1 Message Date
Jay Foad
9768cabf4a Move helper functions for optimizing division by constant into the APInt
class.

llvm-svn: 70488
2009-04-30 10:15:35 +00:00
Bill Wendling
3f4c6171d1 Add support for a character after a command line option. Like '-Os'.
llvm-svn: 70437
2009-04-29 23:26:16 +00:00
Chris Lattner
d68b203337 Fix PR4040: APInt's string constructor is too strict
patch by Jeff Yasskin!

llvm-svn: 70058
2009-04-25 18:34:04 +00:00
Douglas Gregor
bdeba00c46 Make all raw_ostreams support the tell() function.
llvm-svn: 69583
2009-04-20 07:34:17 +00:00
Chris Lattner
b46ad5bbba teach EscapeString and UnescapeString to handle ".
llvm-svn: 69211
2009-04-15 20:12:52 +00:00
Chris Lattner
fc47fb0629 Remove AllowInverse: it leaks memory and is not the right
abstraction for CommandLine.

llvm-svn: 68588
2009-04-08 03:43:51 +00:00
Mikhail Glushenkov
87b0df5b28 Fix build on Linux.
llvm-svn: 68269
2009-04-02 01:11:37 +00:00
Daniel Dunbar
588d3d1fd6 Add llvm::Triple class for abstracting access to target triples.
- The code is silly, I'm just amusing myself. Rewrite to be efficient
   if you like. :)

Also, if you wish to debate the proper names of the triple components
I'm all ears.

llvm-svn: 68252
2009-04-01 21:53:23 +00:00
Dan Gohman
770f4158e5 Use CHAR_BIT instead of hard-coding 8 in several places where it
is appropriate. This helps visually differentiate host-oriented
calculations from target-oriented calculations.

llvm-svn: 68227
2009-04-01 18:45:54 +00:00
Misha Brukman
ea884c9e5e * Fixed spelling of `invertible'
* Simplified if statement

llvm-svn: 68163
2009-04-01 00:15:46 +00:00
Chris Lattner
601a4d8c70 move a large method out of line.
llvm-svn: 67892
2009-03-28 02:08:47 +00:00
Dale Johannesen
34123aba43 Fix internal representation of fp80 to be the
same as a normal i80 {low64, high16} rather
than its own {high64, low16}.  A depressing number
of places know about this; I think I got them all.
Bitcode readers and writers convert back to the old
form to avoid breaking compatibility.

llvm-svn: 67562
2009-03-23 21:16:53 +00:00
Dan Gohman
18daca0895 Now that errs() is properly non-buffered, there's no need to
explicitly flush it.

llvm-svn: 67526
2009-03-23 15:57:19 +00:00
Duncan Sands
45d4adde66 Fix comment typo.
llvm-svn: 67302
2009-03-19 11:37:15 +00:00
Daniel Dunbar
7c9dba0950 Add BUILTIN_EXPECT Support/Compiler macro.
- Use for exceptional buffer conditions in raw_ostream:write to shave
   off a cycle or two.

 - Please rename if you have a better one.

llvm-svn: 67103
2009-03-17 21:15:18 +00:00
Daniel Dunbar
2cc1ec75e1 raw_ostream: Put all exceptional conditions in raw_ostream::write
under a single branch.

Also, add a FIXME for formatted output.

llvm-svn: 67069
2009-03-17 01:36:56 +00:00
Daniel Dunbar
b04be1838d raw_ostream: Rework implementation of unbuffered streams so outputting
a single character requires only one branch to follow slow path.
 - Never use a buffer when writing on an unbuffered stream.

 - Move default buffer size to header.

llvm-svn: 67066
2009-03-17 01:13:35 +00:00
Daniel Dunbar
2062a58347 raw_ostream: Replace flush_impl with write_impl, which takes data to
write as arguments.
 - Add raw_ostream::GetNumBytesInBuffer.
 - Privatize buffer pointers.
 - Get rid of slow and unnecessary code for writing out large strings.

llvm-svn: 67060
2009-03-16 23:29:31 +00:00
Daniel Dunbar
c2d554fe0b raw_ostream: Lift out flush_nonempty.
- Flush a known non-empty buffers; enforces the interface to
   flush_impl and kills off HandleFlush (which I saw no reason to be
   an inline method, Chris?).

 - Clarify invariant that flush_impl is only called with OutBufCur >
   OutBufStart.

 - This also cleary collects all places where we have to deal with the
   buffer possibly not existing.

 - A few more comments and fixing the unbuffered behavior remain in
   this commit sequence.

llvm-svn: 67057
2009-03-16 22:55:06 +00:00
Daniel Dunbar
5ef319c7d7 Make raw_ostream::operator<<(const void *) fast; it doesn't matter but
it is easy.

llvm-svn: 67054
2009-03-16 22:08:44 +00:00
Daniel Dunbar
c64fdabf4f Add slow path for single character write, and use exclusively for
single characters writes outside of the fast path in raw_ostream.h

llvm-svn: 67053
2009-03-16 22:00:17 +00:00
Stuart Hastings
4ee393a21a Fix a hashing bug in APInt. A certain pathological testcase (too
large for the testsuite) took over six minutes to compile on my Mac.
The patched LLVM-GCC compiles that testcase in three seconds (GCC
takes less than one second).  This hash function is more complex
(about 35 instructions on x86) than what Chris wanted, but I expect it
will be well-behaved with arbitrary inputs.

Thank you to everyone who responded to my previous request for advice.

llvm-svn: 66962
2009-03-13 21:51:13 +00:00
Chris Lattner
6f7628bd8e just initialize the first element, we don't need to set the rest to zeros.
llvm-svn: 66850
2009-03-13 00:24:01 +00:00
Chris Lattner
99b48e57ba Eliminate a 9640 byte static mutable initialized data item by moving it
to the stack.  This shrinks all llvm tools by 9k, and improves reentrancy.

llvm-svn: 66847
2009-03-13 00:03:51 +00:00
Chris Lattner
f835ec9a9d static functions don't need an anonymous namespace.
llvm-svn: 66845
2009-03-12 23:59:55 +00:00
Daniel Dunbar
b60a074565 PR3478: raw_ostream should not buffer stderr
- Add unbuffered flag to raw_ostream, forwarded by raw_fd_ostream and
   used by raw_stderr_ostream.

llvm-svn: 66545
2009-03-10 16:21:55 +00:00
Dan Gohman
23d7aa62d4 Use c_str() to force the string to be nul-terminated.
llvm-svn: 66279
2009-03-06 18:13:15 +00:00
Chris Lattner
bf3dee4ec7 on apple systems, integrate nicely with crash reporter.
llvm-svn: 66264
2009-03-06 07:19:54 +00:00
Duncan Sands
e53256c66c Add missing file.
llvm-svn: 66160
2009-03-05 09:19:13 +00:00
Chris Lattner
c4f40d1f53 Daniel wanted the stack printed upside down. Perhaps he
feels a kinship to machine stacks that grow down.  Now we get
stuff like this:

Stack dump:
0.	Program arguments: clang clang_crash_Iw2Osj.mi 
1.	/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1/include/xmmintrin.h:624:1: parsing function body '_mm_cvtpi16_ps'
2.	/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1/include/xmmintrin.h:624:1: in compound statement ('{}')
Abort

llvm-svn: 66145
2009-03-05 07:03:49 +00:00
Chris Lattner
982c3491ff indicate what the program args line is.
llvm-svn: 66144
2009-03-05 06:51:42 +00:00
Chris Lattner
84424b02bb add some helper classes for building light-weight symbolic stack traces
that get printed when a program crashes.  This is the first step of many.

llvm-svn: 66076
2009-03-04 21:40:23 +00:00
Devang Patel
25f2741ae9 The debugger sometimes lookup dynamically in the runtime to find ivar info of any Objective-C classes. It would be very helpful to debugger if the compiler encodes runtime version number in DWARF.
Add support for two additional DWARF attributes to encode Objective-C runtime version number.

llvm-svn: 64834
2009-02-17 22:43:44 +00:00
Cedric Venet
48be6b5e15 Unbreak the build on win32.
Cleanup some warning.

Remark: when struct/class are declared differently than they are defined, this make problem for VC++ since it seems to mangle class differently that struct. These error are very hard to understand and find. So please, try to keep your definition/declaration in sync.

Only tested with VS2008. hope it does not break anything. feel free to revert.

llvm-svn: 64554
2009-02-14 16:06:42 +00:00
Evan Cheng
ec9d3c889f Switch from new[] + delete[] to malloc + free since llvm does not catch C++ exceptions.
llvm-svn: 64448
2009-02-13 08:24:55 +00:00
Evan Cheng
643730a194 If new[] fails, return 0 rather then trying to dereference a null pointer.
llvm-svn: 64444
2009-02-13 07:54:34 +00:00
Nick Lewycky
f273659759 Add an API for strings with possible NULLs in the middle. Refactor the other
two AddString methods to use it.

llvm-svn: 64005
2009-02-07 04:57:08 +00:00
Mike Stump
4c8ca99bb1 Improve -fno-opt style option processing to not require an extra
option to make the -fno- form on the option.  We also document the new
form in the CommandLine documentation.

llvm-svn: 63559
2009-02-02 22:48:49 +00:00
Mike Stump
a0b25f92ce Add opposite_of and inverse_opt to support -fno- style options. This
is necessary for eventual gcc commmand line compatibility.

llvm-svn: 63384
2009-01-30 08:19:46 +00:00
Mikhail Glushenkov
2b0004bd39 Clarify comment.
llvm-svn: 63171
2009-01-28 03:46:22 +00:00
Torok Edwin
47c303034d APInt's countLeadingOnes() was broken for negative i128 values,
causing assertion failures in getSExtValue().
Fix it by making highWordBits actually contain what its name says,
and add some more unit-tests for APInt.
This fixes PR3419.

llvm-svn: 63107
2009-01-27 18:06:03 +00:00
Ted Kremenek
d8045c9154 Add method raw_fd_ostream::seek() for random access within a file.
llvm-svn: 63044
2009-01-26 21:42:04 +00:00
Devang Patel
d980abaae2 Introduce two DWARF attribute extentions DW_AT_APPLE_optimized, DW_AT_APPLE_flags.
DW_AT_APPLE_optimized flag is set when a compile_unit is optimized. The debugger takes advantage of this information some way.

DW_AT_APPLE_flags encodes command line options when certain env. variable is set. This is used by build engineers to track various gcc command lines used by by  a project, irrespective of whether the project used makefile, Xcode or something else.

llvm-gcc patch is next.

llvm-svn: 62888
2009-01-23 22:33:47 +00:00
Dale Johannesen
a5699a1e8b Do not use host floating point types when emitting
ASCII IR; loading and storing these can change the
bits of NaNs on some hosts.  Remove or add warnings
at a few other places using host floating point;
this is a bad thing to do in general.

llvm-svn: 62712
2009-01-21 20:32:55 +00:00
Chris Lattner
ca83aa289a Remove uses of uint32_t in favor of 'unsigned' for better
compatibility with cygwin.  Patch by Jay Foad!

llvm-svn: 62695
2009-01-21 18:09:24 +00:00
Mikhail Glushenkov
898af4fdfa Mimic gcc behaviour with regard to response files.
llvm-svn: 62688
2009-01-21 13:14:02 +00:00
Dale Johannesen
6854f86296 Make special cases (0 inf nan) work for frem.
Besides APFloat, this involved removing code
from two places that thought they knew the
result of frem(0., x) but were wrong.

llvm-svn: 62645
2009-01-21 00:35:19 +00:00
Dale Johannesen
c9e6e85a38 Add an IEEE remainder function, which is not
fully implemented yet and not used.  This is
mainly to clarify that APFloat::mod implements
C fmod, not remainder.

llvm-svn: 62593
2009-01-20 18:35:05 +00:00
Chris Lattner
8ab719c566 improve compatibility with various versions of graphviz, patch by
Patrick Boettcher!

llvm-svn: 62592
2009-01-20 18:25:03 +00:00
Dale Johannesen
31f3cac06b compile-time fmod was done incorrectly. PR 3316.
llvm-svn: 62528
2009-01-19 21:17:05 +00:00