Put the functionality for printing a value to a raw_ostream as an
operand into the Value interface just like the core print method is.
That gives a more conistent organization to the IR printing interfaces
-- they are all attached to the IR objects themselves. Also, update all
the users.

This removes the 'Writer.h' header which contained only a single function
declaration.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198836 91177308-0d34-0410-b5e6-96231b3b80d8
[PM] Rename this source file to something a bit more generic before
I add support for the new pass manager to it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198838 91177308-0d34-0410-b5e6-96231b3b80d8
Revert "DwarfUnit: Move the DICompileUnit Node to the DwarfCompileUnit only"

This reverts commit r198830.

Decided to go a different way with this...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198841 91177308-0d34-0410-b5e6-96231b3b80d8
DwarfUnit: Rename "Node" to "CUNode" and propagate it through DwarfTypeUnit as well.

Since we'll now also need the split dwarf file name along with the
language in DwarfTypeUnits, just use the whole DICompileUnit rather than
explicitly handling each field needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198842 91177308-0d34-0410-b5e6-96231b3b80d8
Reformatting for r198842

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198843 91177308-0d34-0410-b5e6-96231b3b80d8
Extend llvm::AlignedCharArrayUnion to support up to 10 arguments, as required by Clang's APValue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198844 91177308-0d34-0410-b5e6-96231b3b80d8
DwarfDebug: Refactor out common skeleton construction code to be reused for type unit skeletons.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198846 91177308-0d34-0410-b5e6-96231b3b80d8
llvm-readobj: fix endianness

Explicitly handle endianness to ensure that bytes are read properly on
big-endian systems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198847 91177308-0d34-0410-b5e6-96231b3b80d8
llvm-readobj: address review comments for ARM EHABI printing

Rename bytecode to opcodes to make it more clear.  Change an impossible case to
llvm_unreachable instead.  Avoid allocation of a buffer by modifying the
PrintOpcodes iteration.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198848 91177308-0d34-0410-b5e6-96231b3b80d8
llvm-dwarfdump: type unit dwo support

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198850 91177308-0d34-0410-b5e6-96231b3b80d8
Prototype of skeleton type units for fission

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198851 91177308-0d34-0410-b5e6-96231b3b80d8
Add an "-object-cache-dir=<string>" option to LLI. This option specifies the
root path to which object files managed by the LLIObjectCache instance should be
written. This option defaults to "", in which case objects are cached in the
same directory as the bitcode they are derived from.

The load-object-a.ll test has been rewritten to use this option to support
testing in environments where the test directory is not writable.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198852 91177308-0d34-0410-b5e6-96231b3b80d8
Fix accidental use of the exotic "std::string::back()" method. Turns out it's
new in C++11.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198853 91177308-0d34-0410-b5e6-96231b3b80d8
Revert r198819 - "Remove dead code."



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198854 91177308-0d34-0410-b5e6-96231b3b80d8
Disable LeakSanitizer in TableGen binaries, see PR18325

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198858 91177308-0d34-0410-b5e6-96231b3b80d8
Match the InstCombine form of rotates by X+C

InstCombine converts (sub 32, (add X, C)) into (sub 32-C, X),
so a rotate left of a 32-bit Y by X+C could appear as either:

   (or (shl Y, (add X, C)), (shr Y, (sub 32, (add X, C))))

without InstCombine or:

   (or (shl Y, (add X, C)), (shr Y, (sub 32-C, X)))

with it.

We already matched the first form.  This patch handles the second too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198860 91177308-0d34-0410-b5e6-96231b3b80d8
Handle masked rotate amounts

At the moment we expect rotates to have the form:

   (or (shl X, Y), (shr X, Z))

where Y == bitsize(X) - Z or Z == bitsize(X) - Y.  This form means that
the (or ...) is undefined for Y == 0 or Z == 0.  This undefinedness can
be avoided by using Y == (C * bitsize(X) - Z) & (bitsize(X) - 1) or
Z == (C * bitsize(X) - Y) & (bitsize(X) - 1) for any integer C
(including 0, the most natural choice).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198861 91177308-0d34-0410-b5e6-96231b3b80d8
[SystemZ] Fix RNSBG bug introduced by r197802

The zext handling added in r197802 wasn't right for RNSBG.  This patch
restricts it to ROSBG, RXSBG and RISBG.  (The tests for RISBG were added
in r197802 since RISBG was the motivating example.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198862 91177308-0d34-0410-b5e6-96231b3b80d8
Fixed old typo in ScalarEvolution, that caused wrong SCEVs zext operation.
Detailed description is here:
http://llvm.org/bugs/show_bug.cgi?id=18000#c16

For participation in bugfix process special thanks to David Wiberg.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198863 91177308-0d34-0410-b5e6-96231b3b80d8
Revert r198851, "Prototype of skeleton type units for fission"

It caused undefined behavior. DwarfTypeUnit::Ty might not be initialized properly, I guess.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198865 91177308-0d34-0410-b5e6-96231b3b80d8