aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
* refactor .if handling code a bit.Chris Lattner2010-04-171-52/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101659 91177308-0d34-0410-b5e6-96231b3b80d8
* implement mc asmparser support for '.', which gets theChris Lattner2010-04-142-0/+17
| | | | | | | | | | | | | | | | | | | | | current PC. rdar://7834775 We now produce an identical .o file compared to the cctools assembler for something like this: _f0: L0: jmp L1 .long . - L0 L1: jmp A .long . - L1 .zerofill __DATA,_bss,A,0 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101227 91177308-0d34-0410-b5e6-96231b3b80d8
* move elf section uniquing to MCContext. Along the wayChris Lattner2010-04-083-67/+99
| | | | | | | merge XCore's section into MCSectionELF git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100812 91177308-0d34-0410-b5e6-96231b3b80d8
* move macho section uniquing from MCParser and TLOF to MCContext whereChris Lattner2010-04-082-58/+63
| | | | | | | | | the compiler and asmparser now unique to the same sections. This fixes rdar://7835021. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100807 91177308-0d34-0410-b5e6-96231b3b80d8
* Various MSVC warning fixes about truncated 64 bit shifts and const pointers ↵Benjamin Kramer2010-04-081-2/+2
| | | | | | passed to free. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100767 91177308-0d34-0410-b5e6-96231b3b80d8
* rename llvm::llvm_report_error -> llvm::report_fatal_errorChris Lattner2010-04-072-16/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100709 91177308-0d34-0410-b5e6-96231b3b80d8
* Give AsmParser an option to control whether it finalizesChris Lattner2010-04-051-2/+4
| | | | | | | | | | | | | | | | | | | | | | the stream. New demo: $ clang asm.c -S -o - -emit-llvm | llc -filetype=obj -o t.o $ otool -tv t.o t.o: (__TEXT,__text) section _foo: 0000000000000000 subq $0x08,%rsp 0000000000000004 movl %edi,(%rsp) 0000000000000007 movl %edi,%eax 0000000000000009 incl %eax 000000000000000b movl %eax,(%rsp) 000000000000000e movl %eax,0x04(%rsp) 0000000000000012 addq $0x08,%rsp 0000000000000016 ret git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100492 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate the magic AbsoluteDebugSectionOffsets MAI hook,Chris Lattner2010-04-042-2/+0
| | | | | | | | | | | which is really a property of the section being referenced. Add a predicate to MCSection to replace it. Yay for reduction in magic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100367 91177308-0d34-0410-b5e6-96231b3b80d8
* isAbsoluteEHSectionOffsets always returns false, eliminate it Chris Lattner2010-04-042-2/+0
| | | | | | | and substitute false at the one call site. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100354 91177308-0d34-0410-b5e6-96231b3b80d8
* fix an ugly wart in the MCInstPrinter api where theChris Lattner2010-04-041-1/+1
| | | | | | | | | raw_ostream to print an instruction to had to be specified at MCInstPrinter construction time instead of being able to pick at each call to printInstruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100307 91177308-0d34-0410-b5e6-96231b3b80d8
* add a twine form of MCStreamer::EmitRawText, and mc'izeChris Lattner2010-04-031-0/+8
| | | | | | | a few more things in AsmPrinter.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100294 91177308-0d34-0410-b5e6-96231b3b80d8
* allow attaching comments to raw text.Chris Lattner2010-04-031-6/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100292 91177308-0d34-0410-b5e6-96231b3b80d8
* add <cstdlib> header for abort() on linux builders.Chris Lattner2010-04-031-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100290 91177308-0d34-0410-b5e6-96231b3b80d8
* add a new EmitInlineAsm function to asmprinter to handle inline asm.Chris Lattner2010-04-032-1/+30
| | | | | | | | If we have an MCAsmStreamer, we continue to emit asm textually, otherwise we (currently) emit an error to errs and ignore it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100289 91177308-0d34-0410-b5e6-96231b3b80d8
* Rip out the 'is temporary' nonsense from the MCContext interface toChris Lattner2010-03-303-21/+9
| | | | | | | | | | create symbols. It is extremely error prone and a source of a lot of the remaining integrated assembler bugs on x86-64. This fixes rdar://7807601. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99902 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O/x86_64: Support @GOTPCREL on symbols, even for non-PCrel relocations!Daniel Dunbar2010-03-291-2/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99853 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Add a -mc-relax-all option, which relaxes every fixup. We always needDaniel Dunbar2010-03-252-8/+26
| | | | | | | 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: Stop restarting layout on every relaxation.Daniel Dunbar2010-03-251-6/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Still O(N^2), just a faster form, and now its the MCAsmLayout's fault. On the .s I am tuning against (combine.s from 403.gcc): -- ddunbar@lordcrumb:MC$ diff stats-before.txt stats-after.txt 5,10c5,10 < 1728 assembler - Number of assembler layout and relaxation steps < 7707 assembler - Number of emitted assembler fragments < 120588 assembler - Number of emitted object file bytes < 2233448 assembler - Number of evaluated fixups < 1727 assembler - Number of relaxed instructions < 6723845 mcexpr - Number of MCExpr evaluations --- > 3 assembler - Number of assembler layout and relaxation steps > 7707 assembler - Number of emitted assembler fragments > 120588 assembler - Number of emitted object file bytes > 14796 assembler - Number of evaluated fixups > 1727 assembler - Number of relaxed instructions > 67889 mcexpr - Number of MCExpr evaluations -- Feel free to LOL at the -before numbers, if you like. I am a little surprised we make more than 2 relaxation passes. It's pretty trivial for us to do relaxation out-of-order if that would give a speedup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99543 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Simplify main section layout process by moving alignment into LayoutSection.Daniel Dunbar2010-03-251-30/+31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99529 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Sink Section address assignment into LayoutSection.Daniel Dunbar2010-03-251-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99528 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Switch to MCSectionData::getOrdinal.Daniel Dunbar2010-03-251-18/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99504 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Explicity track section and fragment ordinals.Daniel Dunbar2010-03-251-0/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99500 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix -Asserts warning.Daniel Dunbar2010-03-251-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99499 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Route access to SectionData offset and file size through MCAsmLayout.Daniel Dunbar2010-03-252-17/+42
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99474 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Route access to Fragment offset and effective size through MCAsmLayout.Daniel Dunbar2010-03-252-34/+58
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99473 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Eliminate MC{Fragment,{Section,Symbol}Data}::getAddress.Daniel Dunbar2010-03-251-9/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99467 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Fix refacto in MCExpr evaluation, I mistakenly replaced a fragment ↵Daniel Dunbar2010-03-251-2/+2
| | | | | | | | address with a symbol address. - This fixes the integrated-as nightly test regressions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99466 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Direct all {fragment,section,symbol} address access through the ↵Daniel Dunbar2010-03-243-59/+91
| | | | | | MCAsmLayout object. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99380 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Sprinkle in some more interesting statistics.Daniel Dunbar2010-03-232-1/+28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99350 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Fast path EvaluateAbsolute of constants.Daniel Dunbar2010-03-231-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99348 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Switch to using MCInst fragments to do relaxation.Daniel Dunbar2010-03-232-78/+78
| | | | | | 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-232-5/+12
| | | | | | 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-232-64/+10
| | | | | | dependencies in MCMachOStreamer and MCAssembler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99248 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Tweak MCInstFragment to include the encoded data and fixups, so that we ↵Daniel Dunbar2010-03-231-13/+5
| | | | | | don't need to recompute them during relaxation. I will revisit this once all the other pieces of fast relaxation are in place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99244 91177308-0d34-0410-b5e6-96231b3b80d8
* Put MCSectionCOFF::Name into the MCContext instead of leaking it.Jeffrey Yasskin2010-03-221-1/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99231 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Add MCInstFragment, not used yet.Daniel Dunbar2010-03-222-4/+83
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99229 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a FIXME.Daniel Dunbar2010-03-221-0/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99228 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Fix a few more cases we were passing an MCDataFragment when a MCFragment ↵Daniel Dunbar2010-03-221-3/+4
| | | | | | would do, and sprinkle in some const. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99218 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify.Daniel Dunbar2010-03-221-4/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99217 91177308-0d34-0410-b5e6-96231b3b80d8
* MCInst: Add ::dump_pretty.Daniel Dunbar2010-03-222-17/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99216 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Change MCObjectWriter::RecordRelocation to take an MCFragment (instead ↵Daniel Dunbar2010-03-222-13/+13
| | | | | | of a MCDataFragment). Object files should only need the generic MCFragment features. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99205 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: Eliminate MCFragment::getMaxFileSize.Daniel Dunbar2010-03-221-2/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99203 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Share the MCAsmLayout object, although its still not used for anything ↵Daniel Dunbar2010-03-221-15/+10
| | | | | | important. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99202 91177308-0d34-0410-b5e6-96231b3b80d8
* Better fix for r98994, MachObjectWriterImpl wasn't intended to be virtual.Daniel Dunbar2010-03-201-8/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99031 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix -Wnon-virtual-dtor warning.Rafael Espindola2010-03-191-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98994 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O/x86_64: Add relocation support.Daniel Dunbar2010-03-191-0/+213
| | | | | | | | - This is "extraordinarily" Darwin 'as' compatible. See the litany of FIXMEs littered about for more information. - There are a few cases which seem to clearly be 'as' bugs which I have left unsupported, and there is one cases where we diverge but should fix if it blocks diffing .o files (Darwin 'as' ends up widening a jump unnecessarily). - 403.gcc build, runs, and diffs equivalently to the 'as' built version now (using llvm-mc). However, it builds so slowly that I wouldn't recommend trying it quite yet. :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98974 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Add TargetAsmBackend::createObjectWriter.Daniel Dunbar2010-03-191-7/+7
| | | | | | - MCAssembler is now object-file independent, although we will surely need more work to fully support ELF/COFF. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98955 91177308-0d34-0410-b5e6-96231b3b80d8
* MCCodeEmitter: Add target independent fixup flag for is-pc-relative.Daniel Dunbar2010-03-192-16/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98954 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Sink code emitter into MCAssembler.Daniel Dunbar2010-03-192-8/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98953 91177308-0d34-0410-b5e6-96231b3b80d8