summaryrefslogtreecommitdiffstats
path: root/lib/MC/MCMachOStreamer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Get rid of "passing signed into unsigned parameter" warning on PPC.Bill Wendling2010-09-031-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112995 91177308-0d34-0410-b5e6-96231b3b80d8
* This is the second of three patches to implement support for the .loc directiveKevin Enderby2010-08-311-0/+56
| | | | | | | | | | | and output the dwarf line number tables. This takes the current loc info after an instruction is assembled and saves the needed info into an object that has vector and for each section. These objects will be used for the final patch to build and emit the encoded dwarf line number tables. Again for now this is only in the Mach-O streamer but at some point will move to a more generic place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112668 91177308-0d34-0410-b5e6-96231b3b80d8
* Next bit of support for the dwarf .file directive. This patch takes theKevin Enderby2010-08-091-0/+155
| | | | | | | | | previously collected info from the .file directives and outputs the encoded bytes for it. For now this is only in the Mach-O streamer but at some point will move to a more generic place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110617 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Silently ignore .file directives instead of error'ing out onDaniel Dunbar2010-07-191-2/+8
| | | | | | | them. They aren't important enough to abort the entire assembly, and failing early makes testing more annoying. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108747 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Add WinCOFFStreamer implementation and merge common code from MachOMichael J. Spencer2010-07-191-44/+12
| | | | | | | | into MCObjectStreamer. Origonal Windows COFF implementation by Nathan Jedffords. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108678 91177308-0d34-0410-b5e6-96231b3b80d8
* Added the darwin .weak_def_can_be_hidden directive.Kevin Enderby2010-07-081-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107886 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Rewrite atom association to be a final pass we do in Finish(), ↵Daniel Dunbar2010-06-161-33/+46
| | | | | | | | instead of tracking as part of emission. - This allows sharing more code with the MCObjectStreamer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106143 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Simplify MCAssembler::isSymbolLinkerVisible to only take an MCSymbol.Daniel Dunbar2010-06-161-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106142 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Lift SwitchSection() and Finish() into MCObjectStreamer.Daniel Dunbar2010-06-161-40/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106141 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Factor out an MCObjectStreamer class, which will be shared by the concreteDaniel Dunbar2010-06-161-29/+26
| | | | | | object file format writers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106140 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: When running with -mc-relax-all, we can eagerly relax instructions and ↵Daniel Dunbar2010-05-261-16/+18
| | | | | | avoid creating unnecessary MCInstFragments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104736 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Factor out EmitInstTo{Fragment,Data} for emitting MCInst's as ↵Daniel Dunbar2010-05-261-34/+46
| | | | | | MCInstFragments or appending onto an MCDataFragment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104735 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Eliminate an unnecessary copy.Daniel Dunbar2010-05-261-9/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104709 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Simplify MayNeedRelaxation to not provide the fixups, so we can query itDaniel Dunbar2010-05-261-1/+1
| | | | | | before encoding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104707 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Eliminate MCAsmFixup, replace with MCFixup.Daniel Dunbar2010-05-261-8/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104699 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Use accessors for access to MCAsmFixup.Daniel Dunbar2010-05-261-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104697 91177308-0d34-0410-b5e6-96231b3b80d8
* Expand on comment.Eric Christopher2010-05-211-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104396 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement EmitTBSSSymbol for MachOStreamer.Eric Christopher2010-05-181-5/+7
| | | | | | | Fixes build failure as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104059 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Implement support for setting indirect symbol table offset in ↵Daniel Dunbar2010-05-181-0/+1
| | | | | | | | section header. Also, create symbol data for LHS of assignment, to match 'as' symbol ordering better. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104033 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Fail faster/harder when we see .file, which isn't yet supported.Daniel Dunbar2010-05-181-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104031 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Reverse order of SymbolData scanning when emitting instructions.Daniel Dunbar2010-05-171-1/+1
| | | | | | | - This fixes a string table mismatch with 'as' when two new symbols are defined in a single instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103979 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Fix some differences in symbol flag handling.Daniel Dunbar2010-05-171-2/+15
| | | | | | | | | | | | | - Don't clear weak reference flag, 'as' was only "trying" to do this, it wasn't actually succeeding. - Clear the "lazy bound" bit when we mark something external. This corresponds roughly to the lazy clearing of the bit that 'as' implements in symbol_table_lookup. - The exact meaning of these flags appears pretty loose, since 'as' isn't very consistent. For now we just try to match 'as', we will clean this up one day hopefully. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103964 91177308-0d34-0410-b5e6-96231b3b80d8
* Add AsmParser support for darwin tbss directive.Eric Christopher2010-05-141-0/+7
| | | | | | | Nothing uses this yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103757 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Move MCAlignFragment::EmitNops value out of the constructor.Daniel Dunbar2010-05-121-6/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103665 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Eliminate MCZeroFillFragment, it is no longer needed.Daniel Dunbar2010-05-121-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103664 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Drop support for alignment in ZeroFill fragment, we can just useDaniel Dunbar2010-05-121-1/+6
| | | | | | MCAlignFragments for this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103661 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Explicitly track atoms, as represented by their defining symbol, ↵Daniel Dunbar2010-05-101-8/+36
| | | | | | for each fragment (not yet used). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103438 91177308-0d34-0410-b5e6-96231b3b80d8
* break coff symbol definition stuff out into proper MCStreamer callbacks,Chris Lattner2010-05-081-0/+12
| | | | | | | patch by Nathan Jeffords! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103346 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix i386 relocations to Weak Definitions. The relocation entries should beKevin Enderby2010-05-071-19/+1
| | | | | | | | external and the item to be relocated should not have the address of the symbol added in. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103302 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Mark absolute variable's appropriately, and add Mach-O support forDaniel Dunbar2010-05-051-1/+0
| | | | | | | writing them. - <rdar://problem/7885351> integrated assembler broken for i386 objc code git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103112 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Reject attempts to define a variable symbol.Daniel Dunbar2010-05-051-4/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103111 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Rename MCSymbol::{g,s}etValue -> MCSymbol::{g,s}etVariableValue.Daniel Dunbar2010-05-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103095 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Add a -mc-relax-all option, which relaxes every fixup. We always needDaniel Dunbar2010-03-251-2/+8
| | | | | | | exactly two passes in that case, and don't ever need to recompute any layout, so this is a nice baseline for relaxation performance. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99563 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Switch to using MCInst fragments to do relaxation.Daniel Dunbar2010-03-231-0/+28
| | | | | | Also, both MCMachOStreamer and MCAssembler are now target independent! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99256 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Add TargetAsmBackend::MayNeedRelaxation, for checking whether a ↵Daniel Dunbar2010-03-231-4/+11
| | | | | | particular instruction + fixups might need relaxation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99249 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Add TargetAsmBackend::WriteNopData and use to eliminate some target ↵Daniel Dunbar2010-03-231-2/+1
| | | | | | dependencies in MCMachOStreamer and MCAssembler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99248 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Add MCInstFragment, not used yet.Daniel Dunbar2010-03-221-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99229 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Factor out getOrCreateDataFragment().Daniel Dunbar2010-03-221-16/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99204 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Sink code emitter into MCAssembler.Daniel Dunbar2010-03-191-6/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98953 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Fix a crash on invalid, attempting to evaluate undefined symbols.Daniel Dunbar2010-03-141-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98464 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Add MCAssembler::addFixup, which enforces that fixups are added in order.Daniel Dunbar2010-03-121-6/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98379 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Provide MCAssembler with a TargetAsmBackend.Daniel Dunbar2010-03-111-5/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98222 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Move the backend section and symbol data maps to MCAssembler.Daniel Dunbar2010-03-101-30/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98186 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unneeded includes.Daniel Dunbar2010-03-101-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98167 91177308-0d34-0410-b5e6-96231b3b80d8
* This is the first patch to put the needed bits in place to eventually allow codeKevin Enderby2010-02-231-1/+16
| | | | | | | | | | | | 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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96963 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Remove non-sensical comment, and add a missing AddValueSymbols call.Daniel Dunbar2010-02-221-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96809 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Start emitting fixups/relocations for instructions.Daniel Dunbar2010-02-131-2/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96095 91177308-0d34-0410-b5e6-96231b3b80d8
* MCAssembler: Switch MCAsmFixup to storing MCFixupKind instead of just a size.Daniel Dunbar2010-02-131-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96094 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Implement EmitValue using data fragments + fixups instead of fill ↵Daniel Dunbar2010-02-131-1/+17
| | | | | | fragment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96091 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: First cut at MCFixup, for getting fixup/relocation information out of an ↵Daniel Dunbar2010-02-091-1/+2
| | | | | | MCCodeEmitter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95708 91177308-0d34-0410-b5e6-96231b3b80d8