summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove support for not using .loc directives.Rafael Espindola2014-02-051-28/+17
| | | | | | Clang itself was not using this. The only way to access it was via llc. llvm-svn: 200862
* Every target uses .align. Simplify.Rafael Espindola2014-02-042-7/+13
| | | | llvm-svn: 200782
* Use the default values.Rafael Espindola2014-02-043-7/+7
| | | | llvm-svn: 200781
* Fix PR18345: ldr= pseudo instruction produces incorrect code when using in ↵David Peixotto2014-02-041-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | inline assembly This patch fixes the ldr-pseudo implementation to work when used in inline assembly. The fix is to move arm assembler constant pools from the ARMAsmParser class to the ARMTargetStreamer class. Previously we kept the assembler generated constant pools in the ARMAsmParser object. This does not work for inline assembly because a new parser object is created for each blob of inline assembly. This patch moves the constant pools to the ARMTargetStreamer class so that the constant pool will remain alive for the entire code generation process. An ARMTargetStreamer class is now required for the arm backend. There was no existing implementation for MachO, only Asm and ELF. Instead of creating an empty MachO subclass, we decided to make the ARMTargetStreamer a non-abstract class and provide default (llvm_unreachable) implementations for the non constant-pool related methods. Differential Revision: http://llvm-reviews.chandlerc.com/D2638 llvm-svn: 200777
* MC: Fix .octa output for APInts with BitWidth > 128David Woodhouse2014-02-011-1/+2
| | | | llvm-svn: 200615
* MC: Add support for .octaDavid Woodhouse2014-02-011-2/+55
| | | | | | | | | | This is a minimal implementation which accepts only constants rather than full expressions, but that should be perfectly sufficient for all known users for now. Patch from PaX Team <pageexec@freemail.hu> llvm-svn: 200614
* MC: Add AsmLexer::BigNum token for integers greater than 64 bitsDavid Woodhouse2014-02-012-17/+19
| | | | | | | | | | | | | | | | | | | | This will be needed for .octa support, but we don't want to just use the existing AsmLexer::Integer for it and then have to litter all its users with explicit checks for the size, and make them use the new get APIntVal() method. So let the lexer produce an AsmLexer::Integer as before for numbers which are small enough — which appears to cover what was previously a nasty special case handling of numbers which don't fit in int64_t but *do* fit in uint64_t. Where the number is too large even for that, produce an AsmLexer::BigNum instead. We do nothing with these except complain about them for now, but that will be changed shortly... Based on a patch from PaX Team <pageexec@freemail.hu> llvm-svn: 200613
* MC: Improve the .fill directive's compatibility with GASDavid Majnemer2014-02-012-14/+57
| | | | | | | | | Per the GAS documentation, .fill should permit pattern widths that aren't a power of two. While I was in the neighborhood, I added some sanity checking. This change was motivated by a use of this construct in the Linux Kernel. llvm-svn: 200606
* Remove another hasRawTextSupport.Rafael Espindola2014-01-311-0/+6
| | | | | | | | | To remove this one simply move the end of file logic from the asm printer to the target mc streamer. This removes the last call to hasRawTextSupport from lib/Target. llvm-svn: 200590
* Fix PR18381 - print a minimal diagnostic rather than assert on unresolved ↵Timur Iskhodzhanov2014-01-301-0/+5
| | | | | | .secidx target llvm-svn: 200490
* ARM: suuport .tlsdescseq directiveSaleem Abdulrasool2014-01-301-0/+1
| | | | | | | | | | | This enhances the ARMAsmParser to handle .tlsdescseq directives. This is a slightly special relocation. We must be able to generate them, but not consume them in assembly. The relocation is meant to assist the linker in generating a TLS descriptor sequence. The ELF target streamer is enhanced to append additional fixups into the current segment and that is used to emit the new R_ARM_TLS_DESCSEQ relocations. llvm-svn: 200448
* ARM: support TLS descriptor relocationsSaleem Abdulrasool2014-01-301-0/+3
| | | | | | | | Add support for tlsdesc relocations which are part of the ABI, marked as experimental. These relocations permit the linker to perform TLS reference optimizations. llvm-svn: 200447
* ARM: support tlscall relocationsSaleem Abdulrasool2014-01-301-0/+3
| | | | | | | | | | | | | | This adds support for TLS CALL relocations. TLS CALL relocations are used to indicate to the linker to generate appropriate entries to resolve TLS references via an appropriate function invocation (e.g. __tls_get_addr(PLT)). In order to accomodate the linker relaxation of the TLS access model for the references (GD/LD -> IE, IE -> LE), the relocation addend must be incomplete. This requires that the partial inplace value is also incomplete (i.e. 0). We simply avoid the offset value calculation at the time of the fixup adjustment in the ARM assembler backend. llvm-svn: 200446
* Simplify the handling of iterators in ObjectFile.Rafael Espindola2014-01-302-40/+12
| | | | | | | | | | | | None of the object file formats reported error on iterator increment. In retrospect, that is not too surprising: no object format stores symbols or sections in a linked list or other structure that requires chasing pointers. As a consequence, all error checking can be done on begin() and end(). This reduces the text segment of bin/llvm-readobj in my machine from 521233 to 518526 bytes. llvm-svn: 200442
* Reland r200340 - 'Add line table debug info to COFF files when using a win32 ↵Timur Iskhodzhanov2014-01-301-0/+4
| | | | | | | | triple' This incorporates a couple of fixes reviewed at http://llvm-reviews.chandlerc.com/D2651 llvm-svn: 200440
* MC: Better management of macro argumentsDavid Majnemer2014-01-291-55/+22
| | | | | | | | | | | | The linux kernel makes uses of a GAS `feature' which substitutes nothing for macro arguments which aren't specified. Proper support for these kind of macro arguments necessitated a cleanup of differences between `GAS' and `Darwin' dialect macro processing. Differential Revision: http://llvm-reviews.chandlerc.com/D2634 llvm-svn: 200409
* MC: Clean up error paths in AsmParser::parseMacroArgumentDavid Majnemer2014-01-291-10/+20
| | | | | | | | | Use an RAII object Instead of inserting a call to AsmLexer::setSkipSpace(true) in all error paths. No functional change. llvm-svn: 200358
* Explictly pass MCSubtargetInfo to MCCodeEmitter::EncodeInstruction()David Woodhouse2014-01-287-11/+13
| | | | llvm-svn: 200348
* Keep the MCSubtargetInfo in the MCRelxableFragment class.David Woodhouse2014-01-282-2/+2
| | | | | | | | | | | Needed to fix PR18303 to correctly re-encode the instruction if it is relaxed. We keep a copy of the MCSubtargetInfo to make sure that we are not effected by future changes to the subtarget info coming from the assembler (e.g. when parsing .code 16 directived). llvm-svn: 200347
* Modify MCObjectStreamer EmitInstTo* interfaceDavid Woodhouse2014-01-285-14/+21
| | | | | | | | Add MCSubtargetInfo parameter virtual void EmitInstToFragment(const MCInst &Inst, const MCSubtargetInfo &); virtual void EmitInstToData(const MCInst &Inst, const MCSubtargetInfo &); llvm-svn: 200346
* Change MCStreamer EmitInstruction interface to take subtarget infoDavid Woodhouse2014-01-283-4/+4
| | | | llvm-svn: 200345
* MC: Add a .debug section that we'll soon use to emit debug info into COFF filesTimur Iskhodzhanov2014-01-281-0/+7
| | | | llvm-svn: 200285
* Fix the DWARF EH encodings for Sparc PIC code.Jakob Stoklund Olesen2014-01-281-0/+27
| | | | | | | Also emit the stubs that were generated for references to typeinfo symbols. llvm-svn: 200282
* MC: Add support for .cfi_startproc simpleDavid Majnemer2014-01-274-16/+33
| | | | | | | | | | | | | This commit allows LLVM MC to process .cfi_startproc directives when they are followed by an additional `simple' identifier. This signals to elide the emission of target specific CFI instructions that would normally occur initially. This fixes PR16587. Differential Revision: http://llvm-reviews.chandlerc.com/D2624 llvm-svn: 200227
* AsmParser: improve diagnostics for invalid variantsSaleem Abdulrasool2014-01-261-1/+2
| | | | | | | | | An emitted diagnostic for an invalid relocation variant would place the caret on the token following the relocation variant indicator or at the end of the line if there was no following token. This change corrects the placement of the caret to point to the token. llvm-svn: 200159
* Construct the MCStreamer before constructing the MCTargetStreamer.Rafael Espindola2014-01-268-32/+27
| | | | | | | | | | This has a few advantages: * Only targets that use a MCTargetStreamer have to worry about it. * There is never a MCTargetStreamer without a MCStreamer, so we can use a reference. * A MCTargetStreamer can talk to the MCStreamer in its constructor. llvm-svn: 200129
* Reverting r199886 (Prevent repetitive warnings for unrecognized processors ↵Artyom Skrobov2014-01-252-38/+27
| | | | | | and features) llvm-svn: 200083
* Fix known typosAlp Toker2014-01-241-4/+4
| | | | | | | Sweep the codebase for common typos. Includes some changes to visible function names that were misspelt. llvm-svn: 200018
* Simplify the logic for deciding when to initialize the sections.Rafael Espindola2014-01-244-6/+10
| | | | llvm-svn: 199971
* Most streamers' InitSections just create a text section. Make that the defaultRafael Espindola2014-01-245-17/+5
| | | | llvm-svn: 199969
* Inline trivial functions called only once or twice.Rafael Espindola2014-01-241-32/+14
| | | | llvm-svn: 199967
* Inline functions that are only called once.Rafael Espindola2014-01-241-17/+8
| | | | llvm-svn: 199965
* InitToTextSection is redundant with InitSections. Remove it.Rafael Espindola2014-01-237-27/+1
| | | | llvm-svn: 199955
* Remove duplicated info on what .text, .data and .bss look like.Rafael Espindola2014-01-233-41/+15
| | | | llvm-svn: 199951
* Prevent repetitive warnings for unrecognized processors and featuresArtyom Skrobov2014-01-232-27/+38
| | | | llvm-svn: 199886
* Fix inline assembly that switches between ARM and Thumb modesGreg Fitzgerald2014-01-221-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch restores the ARM mode if the user's inline assembly does not. In the object streamer, it ensures that instructions following the inline assembly are encoded correctly and that correct mapping symbols are emitted. For the asm streamer, it emits a .arm or .thumb directive. This patch does not ensure that the inline assembly contains the ADR instruction to switch modes at runtime. The problem we need to solve is code like this: int foo(int a, int b) { int r = a + b; asm volatile( ".align 2 \n" ".arm \n" "add r0,r0,r0 \n" : : "r"(r)); return r+1; } If we compile this function in thumb mode then the inline assembly will switch to arm mode. We need to make sure that we switch back to thumb mode after emitting the inline assembly or we will incorrectly encode the instructions that follow (i.e. the assembly instructions for return r+1). Based on patch by David Peixotto Change-Id: Ib57f6d2d78a22afad5de8693fba6230ff56ba48b llvm-svn: 199818
* Tweak the MCExternalSymbolizer to not use the SymbolLookUp() call backKevin Enderby2014-01-211-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to not guess at a symbol name in some cases. The problem is that in object files assembled starting at address 0, when trying to symbolicate something that starts like this: % cat x.s _t1: vpshufd $0x0, %xmm1, %xmm0 the symbolic disassembly can end up like this: % otool -tV x.o x.o: (__TEXT,__text) section _t1: 0000000000000000 vpshufd $_t1, %xmm1, %xmm0 Which is in this case produced incorrect symbolication. But it is useful in some cases to use the SymbolLookUp() call back to guess at some immediate values. For example one like this that does not have an external relocation entry: % cat y.s _t1: movl $_d1, %eax .data _d1: .long 0 % clang -c -arch i386 y.s % otool -tV y.o y.o: (__TEXT,__text) section _t1: 0000000000000000 movl $_d1, %eax % otool -rv y.o y.o: Relocation information (__TEXT,__text) 1 entries address pcrel length extern type scattered symbolnum/value 00000001 False long False VANILLA False 2 (__DATA,__data) So the change is based on it is not likely that an immediate Value coming from an instruction field of a width of 1 byte, other than branches and items with relocation, are not likely symbol addresses. With the change the first case above simply becomes: % otool -tV x.o x.o: (__TEXT,__text) section _t1: 0000000000000000 vpshufd $0x0, %xmm1, %xmm0 and the second case continues to work as expected. rdar://14863405 llvm-svn: 199698
* ARM: add tlsldo relocationKai Nacke2014-01-201-0/+3
| | | | | | | | | Add support for the symbol(tlsldo) relocation. This is required in order to solve PR18554. Reviewed by R. Golin, A. Korobeynikov. llvm-svn: 199644
* Tweak the MCExternalSymbolizer to print references to C string literalsKevin Enderby2014-01-161-2/+5
| | | | | | | | | | | | | | | with raw_ostream's write_escaped() method. For example darwin's otool(1) program that uses the llvm disassembler now produces disassembly like this: leaq 0x7b(%rip), %rdi ## literal pool for: "%f\ntoto\n" and not print the new lines which messes up the output. rdar://15145300 llvm-svn: 199407
* Add an emitRawComment function and use it to simplify some uses of EmitRawText.Rafael Espindola2014-01-162-0/+11
| | | | llvm-svn: 199397
* CommentColumn is always 40. Simplify.Rafael Espindola2014-01-161-1/+0
| | | | llvm-svn: 199357
* Fix parsing of .symver directive on ARMDavid Peixotto2014-01-151-0/+7
| | | | | | | | | | | | | | | ARM assembly syntax uses @ for a comment, execpt for the second parameter of the .symver directive which requires @ as part of the symbol name. This commit fixes the parsing of this directive by adding a special case for ARM for this one argumnet. To make the change we had to move the AllowAtInIdentifier variable to the MCAsmLexer interface (from AsmLexer) and expose a setter for the value. The ELFAsmParser then toggles this value when parsing the second argument to the .symver directive for a target that uses @ as a comment symbol llvm-svn: 199339
* Replace .mips_hack_stocg with ".set micromips" and ".set nomicromips".Rafael Espindola2014-01-141-0/+5
| | | | | | | This matches what gnu as does and implementing this is easier than arguing about it. llvm-svn: 199181
* Fix indentation.Joerg Sonnenberger2014-01-131-11/+11
| | | | llvm-svn: 199118
* Revert "Revert r198851, "Prototype of skeleton type units for fission""David Blaikie2014-01-101-2/+3
| | | | | | | | | This reverts commit r198865 which reverts r198851. ASan identified a use-of-uninitialized of the DwarfTypeUnit::Ty variable in skeleton type units. llvm-svn: 198908
* Revert r198851, "Prototype of skeleton type units for fission"NAKAMURA Takumi2014-01-091-3/+2
| | | | | | It caused undefined behavior. DwarfTypeUnit::Ty might not be initialized properly, I guess. llvm-svn: 198865
* Prototype of skeleton type units for fissionDavid Blaikie2014-01-091-2/+3
| | | | llvm-svn: 198851
* Force emit a relocation for @gnu_indirect_function symbols so that the indirectRoman Divacky2014-01-081-1/+1
| | | | | | resolution works. llvm-svn: 198780
* [patch] Adjust behavior of FDE cross-section relocs for targets that don't ↵Iain Sandoe2014-01-082-6/+11
| | | | | | | | | | | | support abs-differences. Modern versions of OSX/Darwin's ld (ld64 > 97.17) have an optimisation present that allows the back end to omit relocations (and replace them with an absolute difference) for FDE some text section refs. This patch allows a backend to opt-in to this behaviour by setting "DwarfFDESymbolsUseAbsDiff". At present, this is only enabled for modern x86 OSX ports. test changes by David Fang. llvm-svn: 198744
* In the ELFWriter when writing aliased (.set) symbols dont blindlyRoman Divacky2014-01-071-1/+36
| | | | | | | | | | | | take type from the new symbol but merge them so that the type is never "downgraded". This is probably quite rare, except for IFUNC symbols which we used to misassemble, losing the IFUNC type. Fixes #18372. llvm-svn: 198706
OpenPOWER on IntegriCloud