1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 04:52:54 +02:00
Commit Graph

669 Commits

Author SHA1 Message Date
Mike Stump
6ee41e64c8 Add DW_AT_APPLE_isa and DW_AT_APPLE_block. Radar 6867696
llvm-svn: 71479
2009-05-11 21:58:01 +00:00
Dan Gohman
3817464c23 Add simplify_type specializations to allow WeakVH, AssertingVH, and
CallbackVH to participate in dyn_cast, isa, etc. without needing
an explicit conversion.

llvm-svn: 71087
2009-05-06 17:12:48 +00:00
Evan Cheng
0d781df8dc Quotes should be printed before private prefix; some code clean up.
llvm-svn: 71032
2009-05-05 22:50:29 +00:00
Dan Gohman
6d1ffab07b Add an explicit keyword.
llvm-svn: 71022
2009-05-05 21:23:20 +00:00
Dan Gohman
dc96a23780 Apply Jeffrey Yasskin's CallbackVH patch, with minor tweaks from me
to make the copy constructor and destructor protected, and corresponding
adjustments to the unittests.

llvm-svn: 70644
2009-05-02 21:10:48 +00:00
Dan Gohman
8b692f87a7 Include <limits.h> to get the definition of CHAR_BIT.
llvm-svn: 70643
2009-05-02 21:03:21 +00:00
Chris Lattner
b7947ae607 Drop the default assumption about alignment down to 2 bits from 3. This apparently
helps some problems on win32 platforms (PR4119)

llvm-svn: 70603
2009-05-01 23:48:33 +00:00
Jeffrey Yasskin
7263dc71e2 Add a mention of TypeBuilder to the programmer's manual, and clean up the class
comment a bit.

llvm-svn: 70515
2009-04-30 22:33:41 +00:00
Torok Edwin
1400b41bf1 Make dataflow iteration possible on Value*, not only on User*: df_ext_iterator<Value*, SmallPtrSet<const Value*, 16> >
llvm-svn: 70496
2009-04-30 17:09:22 +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
Jeffrey Yasskin
114afdef8b Add tests for WeakVH and AssertingVH. These pointed out that the overloads for
the comparison operators were not only unnecessary in the presence of the
implicit conversion; they caused ambiguous overload errors. So I deleted them.

llvm-svn: 70243
2009-04-27 20:32:07 +00:00
Chris Lattner
46c25c1285 Add a new TypeBuilder helper class, which eases making LLVM IR types.
Patch by Jeffrey Yasskin!

llvm-svn: 70084
2009-04-25 22:14:04 +00:00
Owen Anderson
1cf271e1d8 Add caching of predecessor counts as well as predecessors themselves.
llvm-svn: 69791
2009-04-22 08:46:33 +00:00
Douglas Gregor
bdeba00c46 Make all raw_ostreams support the tell() function.
llvm-svn: 69583
2009-04-20 07:34:17 +00:00
Nick Lewycky
3e04213f1f Fix missing text in doxygen documentation.
llvm-svn: 69529
2009-04-19 18:20:21 +00:00
Nick Lewycky
e5b361c13a Cleanup. Remove redundant llvm:: , we don't need them since we're inside
namespace llvm already.

llvm-svn: 68774
2009-04-10 06:54:06 +00:00
Nick Lewycky
0f4dbe06e7 Add utility function to IRBuilder that takes the difference between two
pointers, taking into account the size of the pointed-to object.
Patch by Jeffrey Yasskin!

llvm-svn: 68768
2009-04-10 05:30:48 +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
80402f1dc8 Add segment flag bits to ELF.h.
llvm-svn: 68438
2009-04-05 09:07:08 +00:00
Daniel Dunbar
7c98197368 Add fast path for raw_ostream output of strings.
- Particularly nice for small constant strings, which get optimized
   down nicely. On a synthetic benchmark writing out "hello" in a
   loop, this is about 2x faster with gcc and 3x faster with
   llvm-gcc. llc on insn-attrtab.bc from 403.gcc is about .5% faster.

 - I tried for a fancier solution which wouldn't increase code size as
   much (by trying to match constant arrays), but can't quite make it
   fly.

llvm-svn: 68396
2009-04-03 18:43:17 +00:00
Chris Lattner
108305e9d3 Work around an apparent GCC miscompilation by specializing different,
this fixes a regression on some compilers from r68147.

llvm-svn: 68356
2009-04-03 00:26:01 +00:00
Chris Lattner
67af801e8b add missing *
llvm-svn: 68350
2009-04-02 23:53:03 +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
2dd3b48ac1 add a converting operator
llvm-svn: 68158
2009-03-31 23:09:51 +00:00
Chris Lattner
939313c44a Add two new classes: WeakVH and AssertingVH. These are both "ValueHandles",
which are effectively smart pointers to Value*'s.  They are both very light
weight and simple, and react to values being destroyed or being RAUW'd.

WeakVN does a best effort to follow a value around, including through RAUW 
operations and will get nulled out of the value is destroyed.  This is useful
for the eventual "metadata that references a value" work, because it is a
reference to a value that does not show up on its use_* list.

AssertingVH is a pointer that compiles down to a dumb raw pointer when 
assertions are disabled.  When enabled, it emits an assertion if the 
pointed-to value is destroyed while it is still being referenced.  This
is very useful for Maps and other things, and should have caught the recent
bugs in CallGraph and Reassociate, for example.

llvm-svn: 68149
2009-03-31 22:11:05 +00:00
Chris Lattner
982ca20570 teach PointerLikeTypeTraits that all pointers to pointers may only be 4-byte aligned.
llvm-svn: 68147
2009-03-31 21:28:39 +00:00
Bill Wendling
668e03b2b8 Constify check. This fixes PR3900.
llvm-svn: 68013
2009-03-29 20:08:56 +00:00
Chris Lattner
afd5e460c3 Add a PointerLikeTypeTraits specialization for uintptr_t
llvm-svn: 67985
2009-03-29 06:00:21 +00:00
Chris Lattner
9dc97aa7bf Replace the PointerLikeTypeTraits::getNumLowBitsAvailable
function with a new NumLowBitsAvailable enum, which makes the
value available as an integer constant expression.

Add PointerLikeTypeTraits specializations for Instruction* and
Use** since they are only guaranteed 4-byte aligned.

Enhance PointerIntPair to know about (and enforce) the alignment
specified by PointerLikeTypeTraits.  This should allow things 
like PointerIntPair<PointerIntPair<void*, 1,bool>, 1, bool> 
because the inner one knows that 2 low bits are free.

llvm-svn: 67979
2009-03-29 04:32:37 +00:00
Chris Lattner
a78775615b rename PointerLikeTypeInto to PointerLikeTypeTraits, add trait for
# low bits free, and move to its own header.

llvm-svn: 67973
2009-03-29 00:39:30 +00:00
Chris Lattner
601a4d8c70 move a large method out of line.
llvm-svn: 67892
2009-03-28 02:08:47 +00:00
Mike Stump
f25de0da23 Allow invertable -xno- style optins as well.
llvm-svn: 67862
2009-03-27 20:12:55 +00:00
Chris Lattner
4fe63a51eb add method to access a template argument.
llvm-svn: 67458
2009-03-22 00:18:18 +00:00
Sebastian Redl
e4e5b1c2f2 Fix the Win32 VS2008 build:
- Make type declarations match the struct/class keyword of the definition.
 - Move AddSignalHandler into the namespace where it belongs.
 - Correctly call functions from template base.
 - Some other small changes.
With this patch, LLVM and Clang should build properly and with far less noise under VS2008.

llvm-svn: 67347
2009-03-19 23:26:52 +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
e9d33b08eb raw_ostream: Return '*this' explicitly (instead of implicitly via
write) to expose more alias information.

llvm-svn: 67070
2009-03-17 01:53:36 +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
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
Bill Wendling
96e37540a0 Revert r66920. It was causing failures in the self-hosting buildbot (in release
mode).

Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/dg.exp ...
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll
Failed with signal(SIGBUS) at line 1
while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes > /dev/null
0   bugpoint          0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85
1   bugpoint          0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706
2   libSystem.B.dylib 0x92f112bb _sigtramp + 43
3   libSystem.B.dylib 0xffffffff _sigtramp + 1829694831
4   bugpoint          0x00021d1c main + 92
5   bugpoint          0x00002106 start + 54
6   bugpoint          0x00000004 start + 18446744073709543220
Stack dump:
0.    Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes 

FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll
Failed with signal(SIGBUS) at line 1
while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes
0   bugpoint          0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85
1   bugpoint          0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706
2   libSystem.B.dylib 0x92f112bb _sigtramp + 43
3   libSystem.B.dylib 0xffffffff _sigtramp + 1829694831
4   bugpoint          0x00021d1c main + 92
5   bugpoint          0x00002106 start + 54
6   bugpoint          0x00000006 start + 18446744073709543222
Stack dump:
0.    Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes 

FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll
Failed with signal(SIGBUS) at line 1
while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll  -bugpoint-crashcalls -silence-passes
0   bugpoint          0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85
1   bugpoint          0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706
2   libSystem.B.dylib 0x92f112bb _sigtramp + 43
3   libSystem.B.dylib 0xffffffff _sigtramp + 1829694831
4   bugpoint          0x00021d1c main + 92
5   bugpoint          0x00002106 start + 54
Stack dump:
0.    Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll -bugpoint-crashcalls -silence-passes 

--- Reverse-merging (from foreign repository) r66920 into '.':
U    include/llvm/Support/CallSite.h
U    include/llvm/Instructions.h
U    lib/Analysis/IPA/GlobalsModRef.cpp
U    lib/Analysis/IPA/Andersens.cpp
U    lib/Bitcode/Writer/BitcodeWriter.cpp
U    lib/VMCore/Instructions.cpp
U    lib/VMCore/Verifier.cpp
U    lib/VMCore/AsmWriter.cpp
U    lib/Transforms/Utils/LowerInvoke.cpp
U    lib/Transforms/Scalar/SimplifyCFGPass.cpp
U    lib/Transforms/IPO/PruneEH.cpp
U    lib/Transforms/IPO/DeadArgumentElimination.cpp

llvm-svn: 66953
2009-03-13 21:15:59 +00:00
Gabor Greif
6a76677e1b Second installment of "BasicBlock operands to the back"
changes.

For InvokeInst now all arguments begin at op_begin().
The Callee, Cont and Fail are now faster to get by
access relative to op_end().

This patch introduces some temporary uglyness in CallSite.
Next I'll bring CallInst up to a similar scheme and then
the uglyness will magically vanish.

This patch also exposes all the reliance of the libraries
on InvokeInst's operand ordering. I am thinking of taking
care of that too.

llvm-svn: 66920
2009-03-13 18:27:29 +00:00
Daniel Dunbar
0401add555 raw_ostream: unbuffered streams weren't being immediately flushed on
single character writes.

llvm-svn: 66827
2009-03-12 22:02:44 +00:00
Mon P Wang
12fd8e63d9 Changed Allocate to use size_t instead of unsigned.
llvm-svn: 66602
2009-03-10 23:48:49 +00:00
Dan Gohman
6eec7905d5 Add an explicit keyword.
llvm-svn: 66595
2009-03-10 23:10:46 +00:00
Mon P Wang
5645b8cdc5 Fixed rounding up EltSize
llvm-svn: 66594
2009-03-10 23:04:40 +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
Daniel Dunbar
0ff8bd900a Add C++ marker.
llvm-svn: 66543
2009-03-10 15:56:48 +00:00
Daniel Dunbar
4050346c70 Add IRBuilder::CreateConstGEP{1, 2}_{32, 64}.
- Names are lame, but it seems better to be explicit.

llvm-svn: 66295
2009-03-06 22:26:07 +00:00