Commit Graph

59 Commits

Author SHA1 Message Date
Daniel Dunbar d821f4ac60 llvm-mc: Add a -mc-relax-all option, which relaxes every fixup. We always need
exactly two passes in that case, and don't ever need to recompute any layout,
so this is a nice baseline for relaxation performance.

llvm-svn: 99563
2010-03-25 22:49:09 +00:00
Daniel Dunbar de04b3f62c MC: Switch to using MCInst fragments to do relaxation.
Also, both MCMachOStreamer and MCAssembler are now target independent!

llvm-svn: 99256
2010-03-23 05:09:03 +00:00
Daniel Dunbar 86face8333 MC: Add TargetAsmBackend::MayNeedRelaxation, for checking whether a particular instruction + fixups might need relaxation.
llvm-svn: 99249
2010-03-23 03:13:05 +00:00
Daniel Dunbar a9ae3ae698 MC: Add TargetAsmBackend::WriteNopData and use to eliminate some target dependencies in MCMachOStreamer and MCAssembler.
llvm-svn: 99248
2010-03-23 02:36:58 +00:00
Daniel Dunbar b31c49a70d MC: Add MCInstFragment, not used yet.
llvm-svn: 99229
2010-03-22 23:16:48 +00:00
Daniel Dunbar f1f1827bfa MC/Mach-O: Factor out getOrCreateDataFragment().
llvm-svn: 99204
2010-03-22 20:35:46 +00:00
Daniel Dunbar 1bd7171c95 MC: Sink code emitter into MCAssembler.
llvm-svn: 98953
2010-03-19 10:43:18 +00:00
Daniel Dunbar aa8f95eb56 MC: Fix a crash on invalid, attempting to evaluate undefined symbols.
llvm-svn: 98464
2010-03-14 03:10:40 +00:00
Daniel Dunbar 921e79f5eb MC: Add MCAssembler::addFixup, which enforces that fixups are added in order.
llvm-svn: 98379
2010-03-12 21:00:38 +00:00
Daniel Dunbar c5ddbad237 MC: Provide MCAssembler with a TargetAsmBackend.
llvm-svn: 98222
2010-03-11 01:34:27 +00:00
Daniel Dunbar 6eab721011 MC: Move the backend section and symbol data maps to MCAssembler.
llvm-svn: 98186
2010-03-10 20:58:29 +00:00
Daniel Dunbar 7e3283c055 Remove unneeded includes.
llvm-svn: 98167
2010-03-10 17:56:05 +00:00
Kevin Enderby e83d74f626 This is the first patch to put the needed bits in place to eventually allow code
to be aligned with optimal nops.  This patch does not change any functionality
and when the compiler is changed to use EmitCodeAlignment() it should also not
change the resulting output.  Once the compiler change is made and everything
looks good the next patch with the table of optimal X86 nops will be added to
WriteNopData() changing the output.  There are many FIXMEs in this patch which
will be removed when we have better target hooks (coming soon I hear).

llvm-svn: 96963
2010-02-23 18:26:34 +00:00
Daniel Dunbar 5fe3129a5d MC/Mach-O: Remove non-sensical comment, and add a missing AddValueSymbols call.
llvm-svn: 96809
2010-02-22 22:08:57 +00:00
Daniel Dunbar 1e2fad3de8 MC/Mach-O: Start emitting fixups/relocations for instructions.
llvm-svn: 96095
2010-02-13 09:29:02 +00:00
Daniel Dunbar 3374835b46 MCAssembler: Switch MCAsmFixup to storing MCFixupKind instead of just a size.
llvm-svn: 96094
2010-02-13 09:28:54 +00:00
Daniel Dunbar 1a1fbb50fc MC/Mach-O: Implement EmitValue using data fragments + fixups instead of fill fragment.
llvm-svn: 96091
2010-02-13 09:28:22 +00:00
Daniel Dunbar b311a6b3ae MC: First cut at MCFixup, for getting fixup/relocation information out of an MCCodeEmitter.
llvm-svn: 95708
2010-02-09 22:59:55 +00:00
Chris Lattner 38d022efe9 add scaffolding for target-specific MCExprs.
llvm-svn: 95559
2010-02-08 19:41:07 +00:00
Daniel Dunbar 255a8c8b13 MC/Mach-O: Set SOME_INSTRUCTIONS bit for sections.
llvm-svn: 95135
2010-02-02 21:44:01 +00:00
Chris Lattner 3cde760023 mcstreamerize gprel32 emission.
llvm-svn: 94452
2010-01-25 21:28:50 +00:00
Chris Lattner 601ef33c77 mcstreamerize .file and .file. This also fixes an issue where the
normal form of .file would fail if the filename had a weird character
in it.

llvm-svn: 94437
2010-01-25 18:58:59 +00:00
Chris Lattner bc8f638531 add symbol attribute support for the ELF .type directive.
llvm-svn: 94435
2010-01-25 18:30:45 +00:00
Chris Lattner 91dac6d570 emit the .size directive for global variables on ELF through
mcstreamer.

llvm-svn: 94416
2010-01-25 07:52:13 +00:00
Chris Lattner b1301f7bce mcize lcomm, simplify .comm, extend both to support 64-bit sizes.
llvm-svn: 94299
2010-01-23 07:47:02 +00:00
Chris Lattner 685508cf49 move the various directive enums out of the MCStreamer class
into a new MCDirectives.h file.

llvm-svn: 94294
2010-01-23 06:39:22 +00:00
Chris Lattner 1deb09c28d mcstreamerize .no_dead_strip and .reference for static ctors/dtors.
llvm-svn: 94290
2010-01-23 05:51:36 +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
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
Daniel Dunbar ad36e8aceb Pass StringRef by value.
llvm-svn: 86251
2009-11-06 10:58:06 +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 8e6d889d4c MC: Switch assembler API to using MCExpr instead of MCValue.
llvm-svn: 84234
2009-10-16 01:58:03 +00:00
Daniel Dunbar c3bd60e393 MC: Remove unneeded context argument to MCExpr::Evaluate*.
llvm-svn: 84233
2009-10-16 01:57:52 +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 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 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 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 e2697738a4 llvm-mc/Mach-O: Set .subsections_via_symbols flag properly.
llvm-svn: 80144
2009-08-26 21:22:22 +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 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