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

479 Commits

Author SHA1 Message Date
Devang Patel
d10159397a Do not use SmallVector to store MDNode elements.
llvm-svn: 84784
2009-10-21 21:25:09 +00:00
Dale Johannesen
7db511a23e Add an "msasm" flag to inline asm as suggested in PR 5125.
A little ugliness is accepted to keep the binary file format
compatible.  No functional change yet.

llvm-svn: 84020
2009-10-13 20:46:56 +00:00
Devang Patel
c411175393 Do not assume that the module is set.
llvm-svn: 83462
2009-10-07 16:37:55 +00:00
Devang Patel
43ce9e3e75 Check for null MDNode element while printing comment.
llvm-svn: 83172
2009-09-30 21:26:51 +00:00
Devang Patel
24270e88cc Print tag name for MDNodes that are used to encode debug info.
llvm-svn: 83160
2009-09-30 20:16:54 +00:00
Devang Patel
629ad89954 Parse custom metadata attached with an instruction.
llvm-svn: 83033
2009-09-29 00:01:14 +00:00
Devang Patel
1070b7a713 s/class Metadata/class MetadataContext/g
llvm-svn: 83019
2009-09-28 21:41:20 +00:00
Devang Patel
9e2af6ed0b Do not hardcode metadata names.
llvm-svn: 83010
2009-09-28 20:56:00 +00:00
Devang Patel
5a52b71500 Remove dead code.
llvm-svn: 82999
2009-09-28 18:31:56 +00:00
Dan Gohman
8b2d3ef326 Give MachineMemOperand an operator<<, factoring out code from
two different places for printing MachineMemOperands.

Drop the virtual from Value::dump and instead give Value a
protected virtual hook that can be overridden by subclasses
to implement custom printing. This lets printing be more
consistent, and simplifies printing of PseudoSourceValue
values.

llvm-svn: 82599
2009-09-23 01:33:16 +00:00
Daniel Dunbar
378331a13d Tabs -> spaces, and remove trailing whitespace.
llvm-svn: 82355
2009-09-20 02:20:51 +00:00
Devang Patel
f15eea3399 Print debug info attached with an instruction.
llvm-svn: 82075
2009-09-16 20:21:17 +00:00
Duncan Sands
10c1356bad Remove some unused variables and methods warned about by
icc (#177, partial).  Patch by Erick Tryzelaar.

llvm-svn: 81106
2009-09-06 08:33:48 +00:00
Gabor Greif
4604e0739b back out my recent commit (r80858), it seems to break self-hosting buildbot's stage 2 configure
llvm-svn: 80871
2009-09-03 02:02:59 +00:00
Gabor Greif
68c4f27e59 re-commit r66920 (which has been backed out in r66953) I may have more luck this time. I'll back out if needed...
llvm-svn: 80858
2009-09-03 00:18:58 +00:00
Chris Lattner
ea2bfd7a9f eliminate the std::ostream form of WriteAsOperand and update clients.
This also updates dominator related stuff.

llvm-svn: 79825
2009-08-23 05:17:37 +00:00
Chris Lattner
8500c36f86 remove the std::ostream version of module and type printing.
llvm-svn: 79823
2009-08-23 04:52:46 +00:00
Chris Lattner
01dae858b6 eliminate the "Value" printing methods that print to a std::ostream.
This required converting a bunch of stuff off DOUT and other cleanups.

llvm-svn: 79819
2009-08-23 04:37:46 +00:00
Dan Gohman
6ec8176e22 Rename hasNoUnsignedOverflow and hasNoSignedOverflow to hasNoUnsignedWrap
and hasNoSignedWrap, for consistency with the nuw and nsw properties.

llvm-svn: 79539
2009-08-20 17:11:38 +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
Dan Gohman
1749b4bb8a Fix printing of instructions with null operands.
llvm-svn: 79243
2009-08-17 15:28:08 +00:00
Dan Gohman
6c4c30550e Always print at least one space before adding a comment.
llvm-svn: 79242
2009-08-17 15:27:30 +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
Dan Gohman
4d57894a63 Take the fast path for any named value and any GlobalValue, which doesn't
need TypePrinting despite being a subclass of Constant. This fixes
compile-time problems especially visible on 403.gcc when -asm-verbose is
enabled.

llvm-svn: 78951
2009-08-13 23:07:11 +00:00
Owen Anderson
9df206d02d Push LLVMContexts through the IntegerType APIs.
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Dan Gohman
d559e66749 Fix a 4x slowdown in llc -asm-verbose caused by the use of
WriteAsOperand in more places.

Now that more things are using WriteAsOperand, its behavior of
constructing a TypePrinting object and populating it with strings for all
the numbered types in the Module on each call is a significant bottleneck.
Fancier solutions could be pursued here, but for now, just bypass the
TypePrinting overhead in obvious cases.

llvm-svn: 78906
2009-08-13 15:27:57 +00:00
Dan Gohman
ea15a77701 Change the indentation for LLVM Assembly files from 1 tab to 2 spaces.
This is vaguely consistent with LLVM's own source code, but more
importantly it lets more lines stay within 80 columns.

llvm-svn: 78879
2009-08-13 01:41:52 +00:00
Dan Gohman
9c9c3f30bd Now that numbered types have their number printed, it's no longer
interesting to print the number in a comment. Numbered instructions
don't need their number in a comment either.

Also, tidy up newline printing.

llvm-svn: 78865
2009-08-12 23:54:22 +00:00
Dan Gohman
4ee8471442 Extend the AsmWriter to print unnamed numbered types as "%0 = type ..."
and unnamed numbered global variables as "@0 = global ...". Extend the
AsmParser to recognize these forms.

llvm-svn: 78859
2009-08-12 23:32:33 +00:00
Dan Gohman
9b4700f3ce Make AsmWriter more careful with formatted_raw_ostream so that
it doesn't leave the underlying stream in unbuffered mode when
the stream was originally buffered.

Also, change WriteAsOperand back to plain raw_ostream. This
lets it work for either formatted_raw_ostream or plain
raw_ostream, so that it doesn't have to force a buffer flush
on a plain raw_ostream.

llvm-svn: 78837
2009-08-12 20:56:03 +00:00
Dan Gohman
9f80d2be6b Make LLVM Assembly dramatically easier to read by aligning the comments,
using formatted_raw_ostream's PadToColumn.

Before:

bb1:            ; preds = %bb
  %2 = sext i32 %i.01 to i64            ; <i64> [#uses=1]
  %3 = getelementptr double* %p, i64 %2         ; <double*> [#uses=1]
  %4 = load double* %3, align 8         ; <double> [#uses=1]
  %5 = fmul double %4, 1.100000e+00             ; <double> [#uses=1]
  %6 = sext i32 %i.01 to i64            ; <i64> [#uses=1]
  %7 = getelementptr double* %p, i64 %6         ; <double*> [#uses=1]

After:

bb1:                                        ; preds = %bb
  %2 = sext i32 %i.01 to i64                ; <i64> [#uses=1]
  %3 = getelementptr double* %p, i64 %2     ; <double*> [#uses=1]
  %4 = load double* %3, align 8             ; <double> [#uses=1]
  %5 = fmul double %4, 1.100000e+00         ; <double> [#uses=1]
  %6 = sext i32 %i.01 to i64                ; <i64> [#uses=1]
  %7 = getelementptr double* %p, i64 %6     ; <double*> [#uses=1]

Several tests required whitespace adjustments.

llvm-svn: 78816
2009-08-12 17:23:50 +00:00
Dan Gohman
6bec53e39d Fix printing of Alloca instructions with null operands.
llvm-svn: 77697
2009-07-31 18:23:24 +00:00
Devang Patel
efd06c46c7 Check null NameMDNode elements.
llvm-svn: 77559
2009-07-30 01:02:04 +00:00
Devang Patel
ee25ed96f5 print single NamedMDNode.
llvm-svn: 77549
2009-07-30 00:02:57 +00:00
Devang Patel
d788af24ac Print named metadata.
llvm-svn: 77513
2009-07-29 22:04:47 +00:00
Devang Patel
cb23671431 Rename MDNode.h header. It defines MDnode and other metadata classes.
New name is Metadata.h.

llvm-svn: 77370
2009-07-28 21:49:47 +00:00
Dan Gohman
490eb36e1d Add a new keyword 'inbounds' for use with getelementptr. See the
LangRef.html changes for details.

llvm-svn: 77259
2009-07-27 21:53:46 +00:00
Devang Patel
579ccbe163 Initialize mdnNext.
llvm-svn: 77229
2009-07-27 18:42:56 +00:00
Dan Gohman
39c0d3b10a Change the assembly syntax for nsw, nuw, and exact, putting them
after their associated opcodes rather than before. This makes them
a little easier to read.

llvm-svn: 77194
2009-07-27 16:11:46 +00:00
Daniel Dunbar
038a7f0d35 Remove Value::{isName, getNameRef}.
Also, change MDString to use a StringRef.

llvm-svn: 77098
2009-07-25 23:55:21 +00:00
Dan Gohman
9a7deba67e Convert a few more things to use raw_ostream.
llvm-svn: 77039
2009-07-25 01:43:01 +00:00
Devang Patel
45ce5c2ac1 MDString
- Rename member function size(). New name is length().
- Store string beginning and length. Earlier it used to store string end.

llvm-svn: 76841
2009-07-23 02:00:51 +00:00
Devang Patel
6b2162686a Derive MDNode from MetadataBase instead of Constant. Emit MDNodes into METADATA_BLOCK in bitcode file.
llvm-svn: 76834
2009-07-23 01:07:34 +00:00
Dan Gohman
001d777207 Rename the new unsigned and signed keywords to nuw and nsw,
which stand for no-unsigned-wrap and no-signed-wrap.

llvm-svn: 76810
2009-07-22 22:44:56 +00:00
Devang Patel
5456f0ba29 Do not print "metadata" twice while printing MDString.
This fixes unittest failure.

llvm-svn: 76764
2009-07-22 18:10:23 +00:00
Devang Patel
5794cb80ad Introduce MetadataBase, a base class for MDString and MDNode.
Derive MDString directly from MetadataBase. 
Introduce new bitcode block to hold metadata.

llvm-svn: 76759
2009-07-22 17:43:22 +00:00
Dan Gohman
d2ad3e183b Assembly and Bitcode support for unsigned/signed overflow flags and
exact sdiv flags.

llvm-svn: 76475
2009-07-20 21:19:07 +00:00
Bill Wendling
1a10a060cb Add plumbing for the `linker_private' linkage type. This type is meant for
"private" symbols which the assember shouldn't strip, but which the linker may
remove after evaluation. This is mostly useful for Objective-C metadata.

This is plumbing, so we don't have a use of it yet. More to come, etc.

llvm-svn: 76385
2009-07-20 01:03:30 +00:00
Torok Edwin
f955a6ef49 llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").

llvm-svn: 75640
2009-07-14 16:55:14 +00:00
Dan Gohman
21f79b4239 Change printInstruction to not print a trailing newline. Value::dump
always adds a newline, so this fixes Value::dump printing an
extra blank line.

llvm-svn: 75481
2009-07-13 18:27:59 +00:00