Commit Graph

133 Commits

Author SHA1 Message Date
Chris Lattner 1800dff44e inline insertion operators.
llvm-svn: 80888
2009-09-03 05:33:01 +00:00
Chris Lattner f16a122213 output alignment value in hex so that we get:
.align 3, 0x90
instead of,
  .align 3, 144

suggested by eric.

llvm-svn: 80875
2009-09-03 04:01:10 +00:00
Daniel Dunbar 4fa0595b94 llvm-mc: Store MCSymbolData value as a pointer (to make MSVC happy).
llvm-svn: 80652
2009-09-01 04:09:03 +00:00
Daniel Dunbar 897ffadd2d llvm-mc: Pass values to MCStreamer as MCExprs, not MCValues.
llvm-svn: 80578
2009-08-31 08:09:28 +00:00
Daniel Dunbar b7b2097aac llvm-mc: Simplify EmitAssignment ('.set' is identical to '=').
llvm-svn: 80577
2009-08-31 08:09:09 +00:00
Daniel Dunbar 73da11ebda llvm-mc: Switch MCInst to storing an MCExpr* instead of an MCValue.
Also, use MCInst::print instead of custom code in MCAsmPrinter.

llvm-svn: 80575
2009-08-31 08:08:38 +00:00
Daniel Dunbar 945e257e99 llvm-mc: Make MCSymbolData symbol member const.
llvm-svn: 80573
2009-08-31 08:08:06 +00:00
Daniel Dunbar 02c7254f6d llvm-mc: Add MCContext to MCAssembler.
llvm-svn: 80572
2009-08-31 08:07:55 +00:00
Daniel Dunbar b34a2b9da1 llvm-mc: Add MCExpr::{dump,print}.
llvm-svn: 80570
2009-08-31 08:07:33 +00:00
Daniel Dunbar f363645da2 llvm-mc: Switch MCExpr construction to using static member functions, and taking the MCContext (which now owns all MCExprs).
llvm-svn: 80569
2009-08-31 08:07:22 +00:00
Daniel Dunbar 115e4d6d7b llvm-mc: Move AsmExpr into MC lib (as MCExpr).
llvm-svn: 80567
2009-08-31 08:06:59 +00:00
Daniel Dunbar 6a715dccdf llvm-mc: MCStreamer cleanups. - Remove EmitLocalSymbol, this is unsupported for now.
- Switch Emit{CommonSymbol,Zerofill} to take alignment in bytes (for consistency).

llvm-svn: 80484
2009-08-30 06:17:16 +00:00
Daniel Dunbar 2a2459a291 llvm-mc: .lsym is more unsupported than unimplemented, pending a use case appearing.
Also, all one of the file level flags are implemented.

llvm-svn: 80352
2009-08-28 07:08:47 +00:00
Daniel Dunbar 2701eee0ad llvm-mc: Support .comm emission.
llvm-svn: 80351
2009-08-28 07:08:35 +00:00
Daniel Dunbar 42a39d038a llvm-mc: Support .zerofill emission.
- I'm still trying to figure out the cleanest way to implement this and match the assembler, currently there are some substantial differences.

llvm-svn: 80347
2009-08-28 05:49:21 +00:00
Daniel Dunbar a468a12dfa llvm-mc: Tweak section alignment and size computation to match 'as' closer.
llvm-svn: 80345
2009-08-28 05:49:04 +00:00
Daniel Dunbar d82ef0e923 llvm-mc: Factor getSectionData out of SwitchSection.
llvm-svn: 80344
2009-08-28 05:48:54 +00:00
Daniel Dunbar 96abad185d llvm-mc: Emit .lcomm as .zerofill.
llvm-svn: 80343
2009-08-28 05:48:46 +00:00
Daniel Dunbar cf72e1c03e llvm-mc: Add const to EmitZeroFill section argument.
llvm-svn: 80341
2009-08-28 05:48:22 +00:00
Daniel Dunbar 93665faad0 llvm-mc: Fix thinko in emitting values.
llvm-svn: 80340
2009-08-28 05:48:10 +00:00
Daniel Dunbar c7c5f9fa86 llvm-mc/Mach-O: Add MCCodeEmitter support, for encoding instructions.
- No relocations yet, of course.

llvm-svn: 80235
2009-08-27 08:17:51 +00:00
Daniel Dunbar c4f0e7e28d llvm-mc: Print encodings after the instruction, and only when we have an asm
printer.

llvm-svn: 80233
2009-08-27 07:58:57 +00:00
Daniel Dunbar 212b6d8a57 Add {MCInst,MCOperand}::{print,dump}
llvm-svn: 80231
2009-08-27 07:57:12 +00:00
Daniel Dunbar 9cefb135a5 Update CMake
llvm-svn: 80195
2009-08-27 02:08:37 +00:00
Daniel Dunbar 81cb753298 llvm-mc: Tweak MCCodeEmitter skeleton.
llvm-svn: 80193
2009-08-27 01:34:22 +00:00
Daniel Dunbar 65105174a6 Sketch TargetRegistry support for MCCodeEmitter abstract interface.
- Of course, nothing actually can provide this interface yet.

llvm-svn: 80188
2009-08-27 00:51:57 +00:00
Daniel Dunbar 47f11ac5b5 Try to make MSVC just a little happier.
llvm-svn: 80187
2009-08-27 00:38:04 +00:00
Daniel Dunbar e73b267301 llvm-mc/Mach-O: Don't put assembler temporary labels in the symbol table.
- I moved section creation back into AsmParser. I think policy decisions like
   this should be pushed higher, not lower, when possible (in addition the
   assembler has flags which change this behavior, for example).

llvm-svn: 80162
2009-08-26 22:13:22 +00:00
Daniel Dunbar e2697738a4 llvm-mc/Mach-O: Set .subsections_via_symbols flag properly.
llvm-svn: 80144
2009-08-26 21:22:22 +00:00
Daniel Dunbar c4581eaca8 llvm-mc/Mach-O: Add support for relocations.
- I haven't really tried to find the "right" way to store the fixups or apply
   them, yet. This works, but isn't particularly elegant or fast.

 - Still no evaluation support, so we don't actually ever not turn a fixup into
   a relocation entry.

llvm-svn: 80089
2009-08-26 13:58:10 +00:00
Daniel Dunbar a9eeb78ed5 llvm-mc/Mach-O: Move symbol indices into the MCSymbolData structure.
llvm-svn: 80088
2009-08-26 13:57:54 +00:00
Daniel Dunbar c1710a04ba llvm-mc: Add symbol entries for undefined symbols used in .fill and .org.
llvm-svn: 80086
2009-08-26 13:57:37 +00:00
Daniel Dunbar ffda9eb31a llvm-mc: Change MCContext value table to take const MCSymbol*s.
llvm-svn: 80079
2009-08-26 09:16:57 +00:00
Daniel Dunbar 066d0f93bf llvm-mc/Mach-O: Add section padding where needed (to align the next section).
Also, simplify some of Mach-O writer code which can now use section addresses.

llvm-svn: 80067
2009-08-26 04:13:32 +00:00
Daniel Dunbar aef5317edd llvm-mc/Mach-O: Set addresses for symbols.
llvm-svn: 80065
2009-08-26 02:48:04 +00:00
Daniel Dunbar c2c0bf961f llvm-mc: Improve indirect symbol support (add the indirect index table).
llvm-svn: 80059
2009-08-26 00:18:21 +00:00
Bill Wendling a9f56a686c Revert last patch. We need to put this into TargetLowering. There will be a lot
of EH stuff going into there, so we can wait to add them all then.

llvm-svn: 80036
2009-08-25 21:31:39 +00:00
Daniel Dunbar 5a07d6a9c6 llvm-mc: Add statistic for number of fragments emitted by the assembler.
llvm-svn: 80033
2009-08-25 21:10:45 +00:00
Bill Wendling dd14b4a77a Add the #include here.
llvm-svn: 80032
2009-08-25 21:09:50 +00:00
Bill Wendling 485591273c Add a target asm info hook to specify that particular bits of data in the FDE
should be forced to 32-bits (.long) even on 64-bit architectures. Darwin wants
these bits to be 64-bits (.quad). However, other platforms may disagree.

This is just the info right now and is part of a work-in-progress which needs
this. We'll add the actual *use* of this soon.

llvm-svn: 80024
2009-08-25 20:21:17 +00:00
Daniel Dunbar 582d61026d llvm-mc/Mach-O: Preliminary support for indirect symbols.
- The indirect table itself isn't being filled in yet.

 - This isn't factored properly and is rather FIXMEd, but at the moment I'm more
   focused on figuring out what it needs to do.

llvm-svn: 79910
2009-08-24 11:56:58 +00:00
Daniel Dunbar 04a1158d13 llvm-mc/Mach-O: Support symbol attributes.
- This is mostly complete, the main thing missing is .indirect_symbol support
   (which would be straight-forward, except that the way it is implemented in
   'as' makes getting an exact .o match interesting).

llvm-svn: 79899
2009-08-24 08:40:12 +00:00
Daniel Dunbar d341e781da llvm-mc: Tweak undefined symbol handling.
llvm-svn: 79898
2009-08-24 08:39:57 +00:00
Chris Lattner 06fa176862 prune the #includes in raw_ostream.h by moving a
member out of line. ftostr is not particularly speedy,
so that method is presumably not perf sensitive.

llvm-svn: 79885
2009-08-24 03:52:50 +00:00
Benjamin Kramer 4db6267a2c Update CMake build, unbreak linux build.
llvm-svn: 79779
2009-08-22 22:07:08 +00:00
Chris Lattner e9a75a6654 rename TAI -> MAI, being careful not to make MAILJMP instructions :)
llvm-svn: 79777
2009-08-22 21:43:10 +00:00
Chris Lattner 054574666a rename COFFMCAsmInfo -> MCAsmInfoCOFF, likewise for darwin.
llvm-svn: 79773
2009-08-22 21:03:30 +00:00
Chris Lattner 2b9f0d100b move the MCAsmInfo .cpp/.h files into the right
directories and rename them.

llvm-svn: 79768
2009-08-22 20:58:17 +00:00
Chris Lattner 7b26fce23e Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.
llvm-svn: 79763
2009-08-22 20:48:53 +00:00
Chris Lattner ca098517a3 prune some redundant #includes.
llvm-svn: 79746
2009-08-22 19:35:08 +00:00