aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
* Fixed a crash in llvm-mc for Mach-O when a symbol difference expression uses aKevin Enderby2012-01-311-0/+2
| | | | | | | | | | symbol from an assignment. In this case the symbol did not have a fragment so MCObjectWriter::IsSymbolRefDifferenceFullyResolved() should not have been calling IsSymbolRefDifferenceFullyResolvedImpl() with a NULL fragment and should just have returned false in that case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149442 91177308-0d34-0410-b5e6-96231b3b80d8
* Add assembler dialect attribute in asm parser which lets target specific asm ↵Devang Patel2012-01-311-2/+14
| | | | | | parser change dialect on the fly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149396 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence GCC's -Wreturn-type warning.Benjamin Kramer2012-01-281-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149179 91177308-0d34-0410-b5e6-96231b3b80d8
* Small improvement to the recursion detection logic from the previous commit.Rafael Espindola2012-01-281-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149175 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle recursive variable definitions directly. This gives us better errorRafael Espindola2012-01-281-11/+15
| | | | | | messages and allows us to fix PR11865. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149174 91177308-0d34-0410-b5e6-96231b3b80d8
* Source information in 'expected relocatable expression' diagnostic.Jim Grosbach2012-01-271-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149105 91177308-0d34-0410-b5e6-96231b3b80d8
* Better diagnostic for malformed .org assembly directive.Jim Grosbach2012-01-275-12/+18
| | | | | | Provide source line number information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149101 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up.Jim Grosbach2012-01-261-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149096 91177308-0d34-0410-b5e6-96231b3b80d8
* Add simple support for keeping MCFixup source information.Jim Grosbach2012-01-261-0/+19
| | | | | | | Can be used to issue more user friendly diagnostics for faulty relocation constructs and such. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149092 91177308-0d34-0410-b5e6-96231b3b80d8
* Add SourceMgr to MCContext for backend diagnostics.Jim Grosbach2012-01-261-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149090 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for the R_ARM_TARGET1 relocation, which should be given to ↵James Molloy2012-01-261-1/+3
| | | | | | | | | | relocations applied to all C++ constructors and destructors. This enables the linker to match concrete relocation types (absolute or relative) with whatever library or C++ support code is being linked against. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149057 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly emit ctors / dtors with priorities into desired sectionsAnton Korobeynikov2012-01-251-7/+1
| | | | | | | | | | and let linker handle the rest. This finally fixes PR5329 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148990 91177308-0d34-0410-b5e6-96231b3b80d8
* ARM Darwin symbol ref differences w/o subsection-via-symbols.Jim Grosbach2012-01-241-1/+2
| | | | | | | | When not using subsections via symbols, the assembler can resolve symbol differences (including pcrel references) to non-local labels at assembly time, not just those in the same atom. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148865 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for .cfi_signal_frame. Fixes pr11762.Rafael Espindola2012-01-234-7/+48
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148733 91177308-0d34-0410-b5e6-96231b3b80d8
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-205-8/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148578 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing breaks to switch.Benjamin Kramer2012-01-201-13/+25
| | | | | | Found by the clang static analyzer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148543 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a bunch of unused variable assignments.Benjamin Kramer2012-01-201-9/+2
| | | | | | Found by the clang static analyzer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148541 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a dump() implementation for sub-instruction MCOperands.Owen Anderson2012-01-191-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148493 91177308-0d34-0410-b5e6-96231b3b80d8
* MCAssembler tweak for determining when a symbol difference is resolved.Jim Grosbach2012-01-181-1/+2
| | | | | | | | | | | | If the two fragments are in the same Atom, then the difference expression is resolvable at compile time. Previously we were checking that they were in the same fragment, but that breaks down in the presence of instruction relaxation which has multiple fragments in the same atom. rdar://10711829 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148423 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up. MCAsmBackend naming conventions.Jim Grosbach2012-01-183-10/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148400 91177308-0d34-0410-b5e6-96231b3b80d8
* Move some ARM specific MCAssmebler bits into the ARMAsmBackend.Jim Grosbach2012-01-181-9/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148364 91177308-0d34-0410-b5e6-96231b3b80d8
* MC tweak symbol difference resolution for non-local symbols.Jim Grosbach2012-01-171-2/+2
| | | | | | | | | | | | | | | | When the non-local symbol in the expression is in the same fragment as the second symbol, the assembler can still evaluate the expression without needing a relocation. For example, on ARM: _foo: ldr lr, (_foo - 4) rdar://10348687 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148341 91177308-0d34-0410-b5e6-96231b3b80d8
* The error check for using -g with a .s file already containing dwarf .fileKevin Enderby2012-01-111-4/+4
| | | | | | | | directives was in the wrong place and getting triggered incorectly with a cpp .file directive. This change fixes that and adds a test case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147951 91177308-0d34-0410-b5e6-96231b3b80d8
* Let asm parser query asm syntax dialect.Devang Patel2012-01-101-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147880 91177308-0d34-0410-b5e6-96231b3b80d8
* This is the matching change for the data structure name changes for theKevin Enderby2012-01-102-21/+21
| | | | | | | | functional change in r147860 to use DW_TAG_label's instead TAG_subprogram's. This only changes names and updates comments. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147877 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some leftover control reaches end of non-void function warnings.Benjamin Kramer2012-01-101-6/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147874 91177308-0d34-0410-b5e6-96231b3b80d8
* Add 'llvm_unreachable' to passify GCC's understanding of the constraintsChandler Carruth2012-01-101-0/+2
| | | | | | | | of several newly un-defaulted switches. This also helps optimizers (including LLVM's) recognize that every case is covered, and we should assume as much. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147861 91177308-0d34-0410-b5e6-96231b3b80d8
* Various crash reporting tools have a problem with the dwarf generated forKevin Enderby2012-01-101-17/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | assembly source when it generates the TAG_subprogram dwarf debug info for the labels that have nothing between them as in this bit of assembly source: % cat ZeroLength.s _func1: _func2: nop One solution would be to not emit the subsequent labels with the same address and use the next label with a different address or the end of the section for the AT_high_pc value of the TAG_subprogram. Turns out in llvm-mc it is not possible in all cases to determine of two symbols have the same value at the point we put out the TAG_subprogram dwarf debug info. So we will have llvm-mc instead of putting out TAG_subprogram's put out DW_TAG_label's. And the DW_TAG_label does not have a AT_high_pc value which avoids the problem. This commit is only the functional change to make the diffs clear as to what is really being changed. The next commit will be to clean up the names of such things like MCGenDwarfSubprogramEntry to something like MCGenDwarfLabelEntry. rdar://10666925 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147860 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary default cases in switches that cover all enum values.David Blaikie2012-01-104-8/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147855 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the logging streamer.Rafael Espindola2012-01-102-258/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147820 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't print an unused label before .cfi_endproc.Rafael Espindola2012-01-093-7/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147763 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove MCELFStreamer.h.Rafael Espindola2012-01-072-143/+121
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147745 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't print a label before .cfi_startproc when we don't need to. This makesRafael Espindola2012-01-073-9/+19
| | | | | | the produce assembly when using CFI just a bit more readable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147743 91177308-0d34-0410-b5e6-96231b3b80d8
* Split Finish into Finish and FinishImpl to have a common place to do end ofRafael Espindola2012-01-0710-19/+26
| | | | | | | | file error checking. Use that to error on an unfinished cfi_startproc. The error is not nice, but is already better than a segmentation fault. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147717 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement cfi_restore. Patch by Brian Anderson!Rafael Espindola2011-12-293-0/+34
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147356 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename Remember and Restore to RememberState and RestoreState for consistency.Rafael Espindola2011-12-292-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147354 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement .cfi_escape. Patch by Brian Anderson!Rafael Espindola2011-12-293-0/+40
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147352 91177308-0d34-0410-b5e6-96231b3b80d8
* Section relative fixups are a coff concept, not a x86 one. Replace theRafael Espindola2011-12-242-4/+6
| | | | | | x86 specific reloc_coff_secrel32 with a generic FK_SecRel_4. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147252 91177308-0d34-0410-b5e6-96231b3b80d8
* Move x86 specific bits of the COFF writer to lib/Target/X86.Rafael Espindola2011-12-241-39/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147231 91177308-0d34-0410-b5e6-96231b3b80d8
* Define trivial destructor inline.Rafael Espindola2011-12-241-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147230 91177308-0d34-0410-b5e6-96231b3b80d8
* Make GetRelocType pure virtual.Rafael Espindola2011-12-241-8/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147229 91177308-0d34-0410-b5e6-96231b3b80d8
* Move all the dependencies on X86FixupKinds.h to a single method in preparationRafael Espindola2011-12-221-27/+34
| | | | | | to moving it to lib/Target/X86. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147190 91177308-0d34-0410-b5e6-96231b3b80d8
* Kill the monstrosity that was ELFObjectWriter.h.Rafael Espindola2011-12-222-361/+331
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147136 91177308-0d34-0410-b5e6-96231b3b80d8
* Misc cleanups.Rafael Espindola2011-12-222-76/+58
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147135 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the Mips only bits of the ELF writer to lib/Target/Mips.Rafael Espindola2011-12-222-124/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147133 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the MBlaze ELF writer bits to lib/Target/MBlaze.Rafael Espindola2011-12-222-62/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147129 91177308-0d34-0410-b5e6-96231b3b80d8
* Move PPC bits to lib/Target/PowerPC.Rafael Espindola2011-12-223-93/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147124 91177308-0d34-0410-b5e6-96231b3b80d8
* Local dynamic TLS model for direct object output. Create the correct TLS MIPSAkira Hatanaka2011-12-222-0/+27
| | | | | | | | | | ELF relocations. Patch by Jack Carter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147118 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the ARM specific parts of the ELF writer to Target/ARM.Rafael Espindola2011-12-223-273/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147115 91177308-0d34-0410-b5e6-96231b3b80d8
* getEFlags is const.Rafael Espindola2011-12-222-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147114 91177308-0d34-0410-b5e6-96231b3b80d8