summaryrefslogtreecommitdiff
path: root/lib/MC
Commit message (Collapse)AuthorAge
* Merging MIPS GOT changeset into 3.2 release branch.Pawel Wodnicki2012-12-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merging r168471: Mips direct object xgot support This patch provides support for the MIPS relocations: *) R_MIPS_GOT_HI16 *) R_MIPS_GOT_LO16 *) R_MIPS_CALL_HI16 *) R_MIPS_CALL_LO16 These are used for large GOT instruction sequences. Contributer: Jack Carter Merging r168460: [mips] Generate big GOT code. Merging r168458: [mips] Simplify lowering functions in MipsISelLowering.cpp by using the helper functions added in r168456. Merging r168456: [mips] Add helper functions that create nodes for computing address. Merging r168455: [mips] Add command line option "-mxgot". Merging r168453: [mips] When a node which loads from a GOT is created, pass a MachinePointerInfo referring to a GOT entry. Merging r168450: [mips] Add target operand flag enums for big GOT relocations. Merging r168448: Add relocations used for mips big GOT. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@169294 91177308-0d34-0410-b5e6-96231b3b80d8
* Add ARM TARGET2 relocation. The testcase will follow with actualy use-case.Anton Korobeynikov2012-11-09
| | | | | | | Based on the patch by Logan Chien! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167633 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for PR14264 cause by commit r167237 which did not take into account aKevin Enderby2012-11-05
| | | | | | | | | possible buffer change with a .macro directive. rdar://12637628 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167408 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for generating dwarf debugging info with assembly filesKevin Enderby2012-11-01
| | | | | | | | | | | | run through the 'C' preprocessor. That is pick up the file name and line numbers from the cpp hash file line comments for the dwarf file and line numbers tables. rdar://9275556 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167237 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add support for the TYPE operator.Chad Rosier2012-10-26
| | | | | | | Part of rdar://12576868 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166790 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Have the target AsmParser create the asmrewrite for the offsetofChad Rosier2012-10-26
| | | | | | operator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166779 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add support for creating AsmRewrites in the target specificChad Rosier2012-10-25
| | | | | | AsmParser logic. To be used/tested in a subsequent commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166714 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial TOC support for PowerPC64 object creationAdhemerval Zanella2012-10-25
| | | | | | | | | | | | | | | | This patch adds initial PPC64 TOC MC object creation using the small mcmodel (a single 64K TOC) adding the some TOC relocations (R_PPC64_TOC, R_PPC64_TOC16, and R_PPC64_TOC16DS). The addition of 'undefinedExplicitRelSym' hook on 'MCELFObjectTargetWriter' is meant to avoid the creation of an unreferenced ".TOC." symbol (used in the .odp creation) as well to set the R_PPC64_TOC relocation target as the temporary ".TOC." symbol. On PPC64 ABI, the R_PPC64_TOC relocation should not point to any symbol. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166677 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Create a register operand, rather than a memory operand when weChad Rosier2012-10-24
| | | | | | | | | | | | see the offsetof operator. Previously, we were matching something like MOVrm in the front-end and later matching MOVrr in the back-end. This change makes things more consistent. It also fixes cases where we can't match against a memory operand as the source (test cases coming). Part of rdar://12470317 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166592 91177308-0d34-0410-b5e6-96231b3b80d8
* Make branch heavy code for generating marked up disassembly simplerKevin Enderby2012-10-23
| | | | | | | | and easier to read by adding a couple helper functions. Suggestion by Chandler Carruth and seconded by Meador Inge! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166515 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add an implementation of the offset operator. This is a followChad Rosier2012-10-23
| | | | | | | on patch to r166433. rdar://12470317 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166488 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline-asm] Implement _emit directive (which is roughly equivalent to ↵Eli Friedman2012-10-22
| | | | | | | | | | .byte). <rdar://problem/12470345>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166451 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for annotated disassembly output for X86 and arm.Kevin Enderby2012-10-22
| | | | | | | | | | | | Per the October 12, 2012 Proposal for annotated disassembly output sent out by Jim Grosbach this set of changes implements this for X86 and arm. The llvm-mc tool now has a -mdis option to produced the marked up disassembly and a couple of small example test cases have been added. rdar://11764962 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166445 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Don't rewrite out parts of an inline-asm skipped by .if 0 ↵Eli Friedman2012-10-22
| | | | | | | | | | and friends. It's unnecessary and makes the generated assembly less faithful to the original source. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166440 91177308-0d34-0410-b5e6-96231b3b80d8
* Symbol hygiene: Make sure declarations and definitions match, make helper ↵Benjamin Kramer2012-10-20
| | | | | | functions static. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166376 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Rename AsmOpRewrite to just AsmRewrite to be more generic. ↵Chad Rosier2012-10-20
| | | | | | No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166360 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] If the state of the parser is ignore, then don't parse theChad Rosier2012-10-20
| | | | | | | | inline assembly. Also make sure the remove the ignored statements from the IR. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166357 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Continue parsing even when we're in an ignore block.Chad Rosier2012-10-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166352 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Reset the opcode prior to parsing a statement.Chad Rosier2012-10-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166349 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Have the TargetParser callback to Sema to determine the size ofChad Rosier2012-10-19
| | | | | | | | | a memory operand. Retain this information and then add the sizing directives to the IR. This allows the backend to do proper instruction selection. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166316 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add the isParsingInlineAsm() function to the MCAsmTargetParser.Chad Rosier2012-10-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166292 91177308-0d34-0410-b5e6-96231b3b80d8
* Pacify -Wnon-virtual-dtor.Nick Lewycky2012-10-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166270 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add a size argument to the LookupInlineAsmIdentifier() callback,Chad Rosier2012-10-18
| | | | | | | | which will be used by the asm matcher in the near future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166222 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Have the LookupInlineAsmIdentifier() callback function return aChad Rosier2012-10-18
| | | | | | | | *NamedDecl. In turn, build the expressions after we're finished parsing the asm. This avoids a crasher if the lookup fails. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166212 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Move most of the AsmParsing logic in clang back into the MCChad Rosier2012-10-18
| | | | | | | | | layer. Add the ParseMSInlineAsm() function, which is the new interface to clang. Also expose the new MCAsmParserSemaCallback interface, which is used by the back-end to do name lookup in Sema. Finally, remove the now defunct APIs introduced in r165946. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166183 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add the helper function, isParseringInlineAsm(). To be used ↵Chad Rosier2012-10-16
| | | | | | in a future commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166054 91177308-0d34-0410-b5e6-96231b3b80d8
* Check .rela instead of ELF64 for the compensation vaue resettingMichael Liao2012-10-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166051 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] If we parsed a statement and the opcode is valid, then it's ↵Chad Rosier2012-10-15
| | | | | | an instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165955 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add a few new APIs to the AsmParser class in support of MS-StyleChad Rosier2012-10-15
| | | | | | | | | | inline assembly. For the time being, these will be called directly by clang. However, in the near future I expect these to be sunk back into the MC layer and more basic APIs (e.g., getClobbers(), getConstraints(), etc.) will be called by clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165946 91177308-0d34-0410-b5e6-96231b3b80d8
* PowerPC: add EmitTCEntry class for TOC creationAdhemerval Zanella2012-10-15
| | | | | | | | This patch replaces the EmitRawText by a EmitTCEntry class (specialized for each Streamer) in PowerPC64 TOC entry creation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165940 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Remove the MatchInstruction() function. Previously, this wasChad Rosier2012-10-13
| | | | | | | | | | | | | the interface between the front-end and the MC layer when parsing inline assembly. Unfortunately, this is too deep into the parsing stack. Specifically, we're unable to handle target-independent assembly (i.e., assembly directives, labels, etc.). Note the MatchAndEmitInstruction() isn't the correct abstraction either. I'll be exposing target-independent hooks shortly, so this is really just a cleanup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165858 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespace.Chad Rosier2012-10-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165540 91177308-0d34-0410-b5e6-96231b3b80d8
* Add names for the accelerator table sections so that they canEric Christopher2012-10-08
| | | | | | be emitted if they're wanted on elf platforms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165432 91177308-0d34-0410-b5e6-96231b3b80d8
* Hoist some grossly duplicated code from the COFF/ELF/MachO streamers into ↵Benjamin Kramer2012-10-04
| | | | | | MCObjectStreamer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165225 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove template from function that is only used with one type after r165092.Craig Topper2012-10-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165203 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix doxygen comment to match function name.Craig Topper2012-10-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165094 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused function that used to get itineraries from SubTargetFeatures. ↵Craig Topper2012-10-03
| | | | | | This is done from MCSubTargetInfo these days. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165092 91177308-0d34-0410-b5e6-96231b3b80d8
* Support for generating ELF objects on Windows.Andrew Kaylor2012-10-02
| | | | | | This adds 'elf' as a recognized target triple environment value and overrides the default generated object format on Windows platforms if that value is present. This patch also enables MCJIT tests on Windows using the new environment value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165030 91177308-0d34-0410-b5e6-96231b3b80d8
* MachO: direct-to-object attribute for data-in-code markers.Jim Grosbach2012-10-01
| | | | | | | | | | The target backend can support data-in-code load commands even when the assembler doesn't, or vice-versa. Allow targets to opt-in for direct-to-object. PR13973. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164974 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide a shortcut for MCObjectStreamer when emitting fills.Benjamin Kramer2012-10-01
| | | | | | | Reduces runtime of i386-large-relocations.s by 10x in Release builds, even more in Debug+Asserts builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164945 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. ↵Sylvestre Ledru2012-09-27
| | | | | | See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164768 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo 'iff' => 'if'Sylvestre Ledru2012-09-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164767 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename virtual table anchors from Anchor() to anchor() for consistency with ↵Craig Topper2012-09-26
| | | | | | the rest of the tree. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164666 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit dtors into proper section while compiling in vcpp-compatible mode.Anton Korobeynikov2012-09-23
| | | | | | | Patch by Kai! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164476 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for macro parameters/arguments delimited by spaces,Preston Gurd2012-09-19
| | | | | | | | | | | | to improve compatibility with GNU as. Based on a patch by PaX Team. Fixed assertion failures on non-Darwin and added additional test cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164248 91177308-0d34-0410-b5e6-96231b3b80d8
* Support default parameters/arguments for assembler macros.Preston Gurd2012-09-19
| | | | | | | | | | This patch is based on the one by PaX Team. Patch by Andy Zhang! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164246 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance unmatched '.endr' directive error message in assembler.Preston Gurd2012-09-19
| | | | | | | | | | The directive can be matched with directives other than '.rept' Patch by Andy Zhang! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164245 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up. Minor formatting.Jim Grosbach2012-09-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164182 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up. 80 columns.Jim Grosbach2012-09-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164181 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid symbol name clash when filling TOC.Roman Divacky2012-09-18
| | | | | | | Patch by Adhemerval Zanella. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164141 91177308-0d34-0410-b5e6-96231b3b80d8