1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

880 Commits

Author SHA1 Message Date
Reid Kleckner
58c16635f7 Fix a bug where the DWARF emitter in the JIT was not initializing alignment
bytes.  libgcc doesn't seem to mind, but if you pass this DWARF to GDB, it
doesn't like it.  

Also make the JIT memory manager to initialize it's memory to garbage in debug
mode, so that it's easier to find bugs like these in the future.

llvm-svn: 79674
2009-08-21 21:03:57 +00:00
Dan Gohman
1d708297fc Add some comments clarifying what appear to be the intent of various
error handling mechanisms. Please correct these if I've misunderstood
something.

llvm-svn: 79505
2009-08-20 01:46:24 +00:00
Daniel Dunbar
d26934ba4a Switch IRBuilder to using Twine references for names.
llvm-svn: 79482
2009-08-19 22:34:21 +00:00
Dan Gohman
6a85687468 Unbreak GetBufferSize() on uninitialized streams. This fixes a problem
that led to errs() getting made buffered.

llvm-svn: 79458
2009-08-19 20:27:57 +00:00
Daniel Dunbar
115971f6a7 Change raw_svector_ostream to reserve the input buffer if necessary, Ted was
right.
 - This class turns out to be much more convenient to use if we do this; clients
   can make sure the buffer is always big enough if they care (since our current
   idiom tends to be to use a SmallString<256> for the input to this we should
   generally be avoiding an unnecessary malloc).

Also, add a convenience raw_svector_ostream::str method which flushes the buffer
and returns a StringRef for the vector contents.

llvm-svn: 79446
2009-08-19 18:40:58 +00:00
Daniel Dunbar
2e2969f9e1 Switch raw_svector_ostream to use the vector as the ostream buffer.
- This avoids unnecessary malloc/free overhead in the common case, and
   unnecessary copying from the ostream buffer into the output vector.

llvm-svn: 79434
2009-08-19 17:54:29 +00:00
Owen Anderson
9e0bb1bd44 Reapply my less-lock-contention-in-leak-detector patch, now with new files
actually added.

llvm-svn: 79429
2009-08-19 17:07:46 +00:00
Owen Anderson
bd652bf082 Revert my last patch temporarily.
llvm-svn: 79388
2009-08-19 00:52:13 +00:00
Owen Anderson
69a97af0b7 Privatize part of the leak detector mechanism, which turned out to be heavily contended
when trying to run opt in parallel.  This lets parallel opt crunch 403.gcc in about a third
of the time.

llvm-svn: 79387
2009-08-19 00:37:02 +00:00
Daniel Dunbar
6584ac1900 raw_ostream: Remove pointless redefinitions of tell().
- The base class implementation is correct.

llvm-svn: 79385
2009-08-19 00:14:25 +00:00
Daniel Dunbar
2f3cfb4d35 raw_ostream: Add the capability for subclasses to manually install an external
buffer.

llvm-svn: 79382
2009-08-18 23:42:36 +00:00
Daniel Dunbar
85b15d8e71 raw_ostream: Reduce FormattedStream's reliance on raw_ostream's implementation.
- Kill off begin(), end(), and iterator. It isn't clear what these
   mean. Instead provide getBufferStart(), which can be used with
   GetNumBytesInBuffer to the same effect.

 - Update ComputeColumn to take arguments for the buffer to scan, this
   simplifies the implementation of write_impl substantially.

 - This should also fix possible problems with the scanning pointer pointing
   outside of the current raw_ostream buffer.

llvm-svn: 79379
2009-08-18 23:36:04 +00:00
Daniel Dunbar
5aa51a83c7 Revert r78924, disabling buffering defeats all the fast paths in raw_ostream.
llvm-svn: 79361
2009-08-18 20:07:36 +00:00
David Greene
4347d5d424 Make various changes suggested by Chris.
llvm-svn: 79358
2009-08-18 19:22:55 +00:00
Chris Lattner
0ed3ef52af the MinPad argument to PadToColumn only really makes sense to be 1,
just remove the argument and replace it with 1.

llvm-svn: 79246
2009-08-17 15:48:08 +00:00
Erick Tryzelaar
532ab606ff Add more casts to the IRBuilder.
llvm-svn: 79158
2009-08-16 02:19:46 +00:00
Dan Gohman
4541bef274 Move FormattedStream's write_impl out of line.
llvm-svn: 79064
2009-08-15 02:01:04 +00:00
Owen Anderson
cc33bb3cdf Add doxygen comments.
llvm-svn: 79027
2009-08-14 19:41:50 +00:00
Argyrios Kyrtzidis
e8ee71bbd8 Revert r78424.
In order for the changes in r78424 to work properly, cast_retty<X,Y> should return an object instead of a reference, and it's not clear that this approach has real advantages.

llvm-svn: 79023
2009-08-14 19:01:37 +00:00
Erick Tryzelaar
7adf1fa7ad A couple IRBuilder functions were still using getGlobalContext().
llvm-svn: 78997
2009-08-14 06:12:30 +00:00
Owen Anderson
c78a800e7e Add helpers for fetching basic types.
llvm-svn: 78969
2009-08-14 00:30:41 +00:00
Dan Gohman
f55822e7cd Make formatted_raw_ostream restore the buffer settings of the
underlying stream when it is finished, so that clients don't
have to do this manually.

llvm-svn: 78952
2009-08-13 23:16:59 +00:00
Owen Anderson
9df206d02d Push LLVMContexts through the IntegerType APIs.
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Dan Gohman
c692477e5e Set raw_os_ostream, raw_string_ostream, and raw_svector_ostream to be
unbuffered. std::ostream does its own buffering, and std::string and
SmallVector both have allocation strategies intended to handle frequent
appending.

llvm-svn: 78924
2009-08-13 17:41:40 +00:00
Dan Gohman
4ac7200d66 Add support to raw_ostream for sizing the buffer according to the
needs of the underlying output mechanism. raw_fd_ostream now uses
st_blksize from fstat to determine a buffer size.

llvm-svn: 78923
2009-08-13 17:27:29 +00:00
Dan Gohman
d5c9d0b2b7 Make raw_ostream non-copyable.
llvm-svn: 78920
2009-08-13 17:07:08 +00:00
Dan Gohman
fb52ff3ba7 Move SetBufferSize and SetUnbuffered out of line.
llvm-svn: 78909
2009-08-13 15:58:55 +00:00
Dan Gohman
3469d2e1a9 Fix the buffer handling logic so that write_impl is always called with
a full buffer, rather than often being called with a
slightly-less-than-full buffer.

llvm-svn: 78907
2009-08-13 15:44:52 +00:00
Jakob Stoklund Olesen
e074d71247 Fix the N>=64 case in the isInt<> and isUint<> templates.
llvm-svn: 78899
2009-08-13 06:24:02 +00:00
Dan Gohman
bc6b14ba00 This void is implicit in C++.
llvm-svn: 78848
2009-08-12 22:10:57 +00:00
Dan Gohman
a255ba7c44 Add a GetBufferSize() member to raw_ostream and use it to
simplify some formatted_raw_ostream code.

llvm-svn: 78836
2009-08-12 20:52:45 +00:00
Dan Gohman
9a6b2f19e5 Remove a bunch more now-unnecessary Context arguments.
llvm-svn: 78809
2009-08-12 16:23:25 +00:00
Jakob Stoklund Olesen
7ec5ee575e Move immediate constant predicate templates from the Blackfin target to MathExtras.h
llvm-svn: 78793
2009-08-12 06:22:07 +00:00
Dan Gohman
b0c54f532c Add convenience functions for creating nsw add operators.
llvm-svn: 78707
2009-08-11 20:20:39 +00:00
Dan Gohman
aed57ee5b0 Add convenience functions for creating inbounds GEPs.
llvm-svn: 78695
2009-08-11 17:57:01 +00:00
Chris Lattner
be69fa08b6 add a trivial line # cache to SourceMgr to make repeated queries to
FindLineNumber much faster when in sequence.

llvm-svn: 78693
2009-08-11 17:49:14 +00:00
Benjamin Kramer
9a590500ea Make LLVMContext and LLVMContextImpl classes instead of structs.
llvm-svn: 78690
2009-08-11 17:45:13 +00:00
Benjamin Kramer
15a20278ff Fix struct/class mismatch.
llvm-svn: 78686
2009-08-11 17:27:20 +00:00
Dan Gohman
cf73a006f0 Use isa instead of dyn_cast when the result is only converted to bool.
llvm-svn: 78685
2009-08-11 17:20:16 +00:00
Dan Gohman
82b3823bb7 Add convenience functions for creating exact sdiv operators, and
use them in CreatePtrDiff.

llvm-svn: 78682
2009-08-11 17:05:24 +00:00
Dan Gohman
0c6e8e18aa Add an explicit keyword.
llvm-svn: 78675
2009-08-11 15:57:42 +00:00
Dan Gohman
8e39bf3fb6 ConstantFolder and NoFolder no longer require their Context members.
llvm-svn: 78673
2009-08-11 15:56:12 +00:00
Dan Gohman
3056a83ca5 Use the default copy-ctor, copy-assignment, and destructor.
llvm-svn: 78670
2009-08-11 15:52:30 +00:00
Erick Tryzelaar
64635cc637 Convert comments to C90-style so llvm-c can import DataTypes.h.
llvm-svn: 78590
2009-08-10 19:44:53 +00:00
David Greene
91e0e06670 Add support for printing loop structure information in asm comments.
This definitely slows down asm output so put it under an -asm-exuberant
flag.

This information is useful when doing static analysis of performance
issues.

llvm-svn: 78567
2009-08-10 16:38:07 +00:00
Daniel Dunbar
86ddd268b4 Add support for a user supplied pointer argument to llvm_install_error_handler.
llvm-svn: 78553
2009-08-10 03:36:26 +00:00
Daniel Dunbar
60887bf820 Add DEBUG_WITH_TYPE as a clean alternative to tweaking DEBUG_TYPE.
This:
--
#undef DEBUG_TYPE
#define DEBUG_TYPE "foo"
DEBUG(...)
#undef DEBUG_TYPE
#define DEBUG_TYPE ""
--
becomes this:
--
DEBUG_WITH_TYPE("foo", ...)
--

llvm-svn: 78435
2009-08-07 23:48:59 +00:00
Argyrios Kyrtzidis
36a6dfff07 Modifications to dyn_cast/cast to make them work for objects too, instead of only pointers.
The use case is if you have a wrapper class:

class Base {
  void *Ptr;
public:
  Base() : Ptr(0) { }
  operator bool() const { return Ptr; }
.....
}

and sub-wrappers that have exactly the same size:

class Sub : public Base {
public:
....
static bool classof(const Base*);
}

and in the code you would do:

void f(Base b) {
  Sub sub = dyn_cast<Sub>(b);
  if (sub) {
    ....
  }
}

llvm-svn: 78424
2009-08-07 22:49:24 +00:00
Jeffrey Yasskin
20848835bf To catch bugs like the one fixed in
http://llvm.org/viewvc/llvm-project?view=rev&revision=78127, I'm changing the
ExecutionEngine's global mappings to hold AssertingVH<const GlobalValue>. That
way, if unregistering a mapping fails to actually unregister it, we'll get an
assert. Running the jit nightly tests didn't uncover any actual instances of
the problem.

This also uncovered the fact that AssertingVH<const X> didn't work, so I fixed
that too.

llvm-svn: 78400
2009-08-07 19:54:29 +00:00
Dan Gohman
ba72f59923 Fix FindExecutable to use sys::Path::GetMainExecutable instead of
just argv[0]. And remove the code for searching the current
working directory and for searching PATH; the point of FindExecutable
is not to find whatever version of the executable can be found by
searching around, but to find an executable that accompanies the
current executable.

Update the tools to use sys::Program::FindProgramByName when they
want PATH searching.

llvm-svn: 78240
2009-08-05 20:21:17 +00:00