Commit Graph

214 Commits

Author SHA1 Message Date
Chris Lattner a3eee3cb69 Convert some more random-comment-printing stuff to use
AddComment and GetCommentOS.  Add a blank line between globals
(even in non-verbose mode) to make the assembly more readable.

llvm-svn: 94202
2010-01-22 19:52:01 +00:00
Chris Lattner 8fa0e35f97 add a new MCAsmStreamer::GetCommentOS method to simplify stuff
that doesn't want to use twines.

llvm-svn: 94199
2010-01-22 19:17:48 +00:00
Chris Lattner e1d8a319a1 rename addComment -> AddComment for consistency.
llvm-svn: 94190
2010-01-22 18:21:35 +00:00
Benjamin Kramer 94b993ed8a Simplify some uses of str(n)cmp with StringRef.
llvm-svn: 94189
2010-01-22 18:21:23 +00:00
Chris Lattner cfa5ebc336 add comment support to the rest of the directives.
llvm-svn: 94168
2010-01-22 07:36:39 +00:00
Chris Lattner e649401824 stop using strtoll, it gives windows heartburn.
llvm-svn: 94167
2010-01-22 07:34:12 +00:00
Chris Lattner 38e9219f71 Add the ability for MCStreamer to emit comments on the same line as directives.
Switch over the asm-verbose comment for double values to use it.  We now get:

_x:
	.long	343597384                                   ## double 1.231200e+02
	.long	1079953326

For example, note that the comment is on the same line as the .long.  Woo.

llvm-svn: 94166
2010-01-22 07:29:22 +00:00
Chris Lattner 0522eb2160 pass "-fasm-verbose" into createAsmStreamer.
llvm-svn: 94165
2010-01-22 07:06:15 +00:00
Chris Lattner 7ba0661f27 Stop building RTTI information for *most* llvm libraries. Notable
missing ones are libsupport, libsystem and libvmcore.  libvmcore is
currently blocked on bugpoint, which uses EH.  Once it stops using
EH, we can switch it off.

This #if 0's out 3 unit tests, because gtest requires RTTI information.
Suggestions welcome on how to fix this.

llvm-svn: 94164
2010-01-22 06:49:46 +00:00
Chris Lattner 5b0e01c54e move some files out of the llvm-mc tool into the MCParser library so
other tools can link it.

llvm-svn: 94131
2010-01-22 01:58:08 +00:00
Chris Lattner 9a184b368b forgot to svn add these, doh.
llvm-svn: 94130
2010-01-22 01:55:10 +00:00
Chris Lattner 00646cfbd4 create a new MCParser library and move some stuff into it.
llvm-svn: 94129
2010-01-22 01:44:57 +00:00
Chris Lattner 1edfeb2c46 don't forget to initialize an instance variable!
llvm-svn: 94021
2010-01-20 20:48:59 +00:00
Chris Lattner 9fc980403e use getGlobalDirective(), don't hardcode .globl. PR6093
llvm-svn: 94006
2010-01-20 17:50:30 +00:00
Chris Lattner 45eeffcc2a make mcasmstreamer handle expanding 8 byte integer constants to
4-byte constants if .quad isn't supported.  Switch a bunch of
methods used by the dwarf writer to use OutStreamer.EmitIntValue.

llvm-svn: 93987
2010-01-20 06:45:39 +00:00
Chris Lattner 38caaf14c1 give createAsmStreamer an 'isLittleEndian' argument.
llvm-svn: 93986
2010-01-20 06:39:07 +00:00
Chris Lattner 2b4364fe03 revert 93934, removing the MCAsmInfo endianness bit. I can't
stomache MCAsmInfo having this, and I found a better solution to
this layering issue.

llvm-svn: 93985
2010-01-20 06:34:14 +00:00
Chris Lattner 003b5c8472 give MCAsmInfo a 'has little endian' bit. This is unfortunate, but
I really want clients of the streamer to be able to say "emit this
64-bit integer" and have it get broken down right by the streamer.

I may change this in the future, we'll see how it works out.

llvm-svn: 93934
2010-01-19 22:42:28 +00:00
Chris Lattner dc50e5d128 add a new EmitIntValue method that MCStreamer impls can optionally define
and that clients can use.

llvm-svn: 93923
2010-01-19 22:03:38 +00:00
Sean Callanan 936b0d3144 Promoted the getTok() method to MCAsmParser so that
the two token accessor functions are declared consistently.
Modified the clients of MCAsmParser to reflect this change.

llvm-svn: 93916
2010-01-19 21:44:56 +00:00
Chris Lattner c35681b298 Generalize mcasmstreamer data emission APIs to take an address space
identifier.  There is no way to work around it.

llvm-svn: 93896
2010-01-19 19:46:13 +00:00
Chris Lattner ed89f60f5e mcstreamerize AsmPrinter::EmitZeros, at least when emitting to the
default address space.

llvm-svn: 93890
2010-01-19 18:58:52 +00:00
Chris Lattner 4340cb3246 add an MCAsmStreamer::EmitFill specialization of EmitFill that
emits one directive instead of N.  Not doing this would be a
significant regression on the # bytes generated by .fill.

llvm-svn: 93889
2010-01-19 18:52:28 +00:00
Chris Lattner 0c65fd4902 add a "MCStreamer::EmitFill" method, and move the default implementation
(which just iteratively emits bytes) to MCStreamer.

llvm-svn: 93888
2010-01-19 18:45:47 +00:00
Chris Lattner 9c31b0c695 remove MAI::ZeroDirectiveSuffix, which is only used by MASM,
which we don't support anymore.

llvm-svn: 93886
2010-01-19 18:37:01 +00:00
Chris Lattner cd2915e467 stop using the .lcomm pseudoop on darwin, instead, directly use the
.zerofill directive.  Streamerize its generation.

llvm-svn: 93868
2010-01-19 06:25:51 +00:00
Chris Lattner 95b98959b0 mc'ize some stuff, don't comment out .lcomm directive in -fverbose-asm mode.
llvm-svn: 93860
2010-01-19 06:01:04 +00:00
Chris Lattner b1f2934fc7 hookize the cygwin ".linkonce" directive.
llvm-svn: 93855
2010-01-19 05:08:13 +00:00
Chris Lattner dccbb28bca add a bool for whether .lcomm takes an alignment instead of basing this on "isdarwin".
llvm-svn: 93852
2010-01-19 04:48:20 +00:00
Chris Lattner e9d28b19cf move production of .reference directives for static ctor/dtor list on
darwin into common code.

llvm-svn: 93849
2010-01-19 04:34:02 +00:00
Chris Lattner 1d371882b6 Cleanup handling of .zerofill on darwin:
1. TargetLoweringObjectFileMachO should decide if something
   goes in zerofill instead of having every target do it.
2. TargetLoweringObjectFileMachO should assign said symbols to
   the right MCSection, the asmprinters should just emit to the
   right section.
3. Since all zerofill stuff goes through mcstreamer anymore,
   MAI can have a bool "haszerofill" instead of having the textual
   directive to emit.

llvm-svn: 93838
2010-01-19 02:09:44 +00:00
Nate Begeman e945172ba4 Remove this fixme, looking at the linker source, all targets pad to 4 bytes.
llvm-svn: 93835
2010-01-19 01:32:44 +00:00
Chris Lattner c8f7717808 remove the MAI argument to MCExpr::print and switch overthing to use << when printing them.
llvm-svn: 93699
2010-01-18 00:37:40 +00:00
Chris Lattner 8b5d55ed06 now that MCSymbol::print doesn't use it's MAI argument, we can
remove it and change all the code that prints MCSymbols to use 
<< instead, which is much simpler and cleaner.

llvm-svn: 93695
2010-01-17 21:43:43 +00:00
Chris Lattner 043e656797 rename NameNeedsEscaping -> NameNeedsQuoting, eliminate the check
for first character which is a digit, mangler would have taken care
of this already.

llvm-svn: 93694
2010-01-17 20:11:03 +00:00
Chris Lattner 83e872e1c4 Get MCSymbol out of the mangling business, and move all the logic
to Mangler.  Now MCSymbol just decides whether to slap quotes around
a symbol when printing it.

This also fixes some weirdness where two MCSymbols could be created
for the same symbol, if one needed to be mangled and got mangled to
the other one.

llvm-svn: 93690
2010-01-17 19:23:46 +00:00
Nate Begeman 660d979ad9 Add a note for the macho streamer and remove a used of the mangler from the soon to be defunct machowriter pass.
llvm-svn: 93670
2010-01-17 03:49:01 +00:00
Chris Lattner 18bcf30497 unbreak the build, grr symlinks.
llvm-svn: 93539
2010-01-15 19:51:05 +00:00
Chris Lattner 528d00b913 extend MCAsmParser::ParseExpression and ParseParenExpression
to return range information for subexpressions.  Use this to
provide range info for several new X86Operands.

llvm-svn: 93534
2010-01-15 19:28:38 +00:00
Chris Lattner b9d1f5a006 tidy
llvm-svn: 93352
2010-01-13 21:21:29 +00:00
Chris Lattner 8361006264 expose a static function as a static method on the MCSymbol class.
llvm-svn: 93350
2010-01-13 21:09:59 +00:00
David Greene 7b42d7067e Change errs() to dbgs().
llvm-svn: 92635
2010-01-05 01:28:22 +00:00
David Greene ac7f537d57 Change errs() to dbgs().
llvm-svn: 92634
2010-01-05 01:28:17 +00:00
David Greene cdf0452ed2 Change errs() to dbgs().
llvm-svn: 92632
2010-01-05 01:28:10 +00:00
David Greene a8cbfb8acc Change errs() to dbgs().
llvm-svn: 92630
2010-01-05 01:28:07 +00:00
Daniel Dunbar ad36e8aceb Pass StringRef by value.
llvm-svn: 86251
2009-11-06 10:58:06 +00:00
Chandler Carruth 56869f22c4 Move DataTypes.h to include/llvm/System, update all users. This breaks the last
direct inclusion edge from System to Support.

llvm-svn: 85086
2009-10-26 01:35:46 +00:00
Chris Lattner 86dfd73c38 add a twine version of MCContext::GetOrCreateSymbol.
llvm-svn: 84561
2009-10-19 22:49:00 +00:00
Daniel Dunbar 5d9134747b MC: Set symbol values in MachO MCStreamer.
llvm-svn: 84236
2009-10-16 01:58:23 +00:00
Daniel Dunbar e024def785 Minor formatting tweaks.
llvm-svn: 84235
2009-10-16 01:58:15 +00:00