aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
* Fix section relocation for SECTIONREL32 with immediate offset.Rafael Espindola2013-04-251-0/+2
| | | | | | Patch by Kai Nacke. This matches the gnu as output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180568 91177308-0d34-0410-b5e6-96231b3b80d8
* Align the __LD,__compact_unwind section.Bill Wendling2013-04-241-7/+16
| | | | | | | | | I know what would be cool! We should align the compact unwind section because aligned data access is faster. <rdar://problem/13723271> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180171 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused DwarfSectionOffsetDirective stringMatt Arsenault2013-04-222-2/+2
| | | | | | | The value isn't actually used, and setting it emits a COFF specific directive. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180064 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Get the OpDecl and remove a redundant lookup.Chad Rosier2013-04-221-2/+1
| | | | | | Part of rdar://13663589 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180057 91177308-0d34-0410-b5e6-96231b3b80d8
* COFF: Fix weak external aliases.Peter Collingbourne2013-04-221-28/+29
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D700 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180034 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Refactor/clean up the SemaLookup interface. No functionalChad Rosier2013-04-221-5/+2
| | | | | | | change indended. Part of rdar://13663589 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180028 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix indentation. No functional change.Craig Topper2013-04-221-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179994 91177308-0d34-0410-b5e6-96231b3b80d8
* Put 'else' on same line as preceding curly brace per coding standards. No ↵Craig Topper2013-04-221-12/+6
| | | | | | functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179993 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an unreachable 'break' following a 'return'.Craig Topper2013-04-221-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179991 91177308-0d34-0410-b5e6-96231b3b80d8
* Relax this assert. It may not hold in all cases.Bill Wendling2013-04-181-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179814 91177308-0d34-0410-b5e6-96231b3b80d8
* Assert if we're trying to generate a null compact unwind entry.Bill Wendling2013-04-181-4/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179809 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for subsections to the ELF assembler. Fixes PR8717.Peter Collingbourne2013-04-1715-71/+169
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D598 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179725 91177308-0d34-0410-b5e6-96231b3b80d8
* Use object file specific section type for initial text sectionNico Rieck2013-04-142-12/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179494 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add the implementation for the AOK_Delete kind, which was addedChad Rosier2013-04-121-3/+5
| | | | | | | in r179325. Test case coming shortly on the clang side. Part of rdar://13453209 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179383 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Remove brackets from around a symbol reference in the targetChad Rosier2013-04-111-10/+1
| | | | | | | | | specific logic. This makes the code much less fragile. Test case coming on the clang side in a moment. rdar://13634327 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179323 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Support COFF image-relative MCSymbolRefsNico Rieck2013-04-102-7/+5
| | | | | | | | | | | | | | | | Add support for the COFF relocation types IMAGE_REL_I386_DIR32NB and IMAGE_REL_AMD64_ADDR32NB for 32- and 64-bit respectively. These are similar to normal 4-byte relocations except that they do not include the base address of the image. Image-relative relocations are used for debug information (32-bit) and SEH unwind tables (64-bit). A new MCSymbolRef variant called 'VK_COFF_IMGREL32' is introduced to specify such relocations. For AT&T assembly, this variant can be accessed using the symbol suffix '@imgrel'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179240 91177308-0d34-0410-b5e6-96231b3b80d8
* No need to have this return a bool.Bill Wendling2013-04-101-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179226 91177308-0d34-0410-b5e6-96231b3b80d8
* Track the compact unwind encoding for when we are unable to generate compact ↵Bill Wendling2013-04-102-6/+11
| | | | | | | | | | | unwind information. Compact unwind has an encoding for when we're not able to generate compact unwind and must generate an EH frame instead. Track that, but still emit that CU encoding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179220 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r179115, but use parsePrimaryExpression a little more judiciously.Chad Rosier2013-04-101-0/+5
| | | | | | | | | | | | | | | | | Test cases that regressed due to r179115, plus a few more, were added in r179182. Original commit message below: [ms-inline asm] Use parsePrimaryExpr in lieu of parseExpression if we need to parse an identifier. Otherwise, parseExpression may parse multiple tokens, which makes it impossible to properly compute an immediate displacement. An example of such a case is the source operand (i.e., [Symbol + ImmDisp]) in the below example: __asm mov eax, [Symbol + ImmDisp] Part of rdar://13611297 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179187 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a scheme closer to that of GNU as when deciding the type of aPeter Collingbourne2013-04-101-6/+34
| | | | | | | | symbol with multiple .type declarations. Differential Revision: http://llvm-reviews.chandlerc.com/D607 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179184 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused method and default values.Rafael Espindola2013-04-091-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179124 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r179115 as it looks to have killed the ASan tests.Chad Rosier2013-04-091-5/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179120 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Use parsePrimaryExpr in lieu of parseExpression if we need toChad Rosier2013-04-091-0/+5
| | | | | | | | | | | | | | | parse an identifier. Otherwise, parseExpression may parse multiple tokens, which makes it impossible to properly compute an immediate displacement. An example of such a case is the source operand (i.e., [Symbol + ImmDisp]) in the below example: __asm mov eax, [Symbol + ImmDisp] The existing test cases exercise this patch. rdar://13611297 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179115 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Maintain a StringRef to reference a symbol in a parsed operand,Chad Rosier2013-04-091-5/+8
| | | | | | | | | | | | | rather than deriving the StringRef from the Start and End SMLocs. Using the Start and End SMLocs works fine for operands such as [Symbol], but not for operands such as [Symbol + ImmDisp]. All existing test cases that reference a variable exercise this patch. rdar://13602265 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179109 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add support for ImmDisp [ Symbol ] memory operands.Chad Rosier2013-04-081-11/+9
| | | | | | | rdar://13521249 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179030 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the fde encoding used by mips to match gas.Rafael Espindola2013-04-031-4/+7
| | | | | | | | | | | | | This finally fixes the encoding. The patch also * Removes eh-frame.ll. It was an unnecessary .ll to .o test that was checking the wrong value. * Merge fde-reloc.s and eh-frame.s into a single test, since the only difference was the run lines. * Don't blindly test the content of the entire .eh_frame section. It makes it hard to anyone actually fixing a bug and hitting a difference in a binary blob. Instead, use a CHECK for each field and document what is being checked. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178615 91177308-0d34-0410-b5e6-96231b3b80d8
* Mips direct object exception handling regressionJack Carter2013-04-011-3/+4
| | | | | | | | | | | | | | | | | | | Revision 177141 caused a regression in all but mips64 little endian. That is because none of the other Mips targets had test cases checking the contents of the .eh_frame section. This patch fixes both the llvm code and adds an assembler test case to include the current 4 flavors. The test cases unfortunately rely on llvm-objdump. A preferable method would be to use a pretty printer output such as what readelf -wf <elf_file> would give. I also changed the name of the test case to correct a typo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178506 91177308-0d34-0410-b5e6-96231b3b80d8
* Change '@SECREL' suffix to GAS-compatible '@SECREL32'.Benjamin Kramer2013-03-301-1/+1
| | | | | | | | | | '@SECREL' is what is used by the Microsoft assembler, but GNU as expects '@SECREL32'. With the patch, the MC-generated code works fine in combination with a recent GNU as (2.23.51.20120920 here). Patch by David Nadlinger! Differential Revision: http://llvm-reviews.chandlerc.com/D429 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178427 91177308-0d34-0410-b5e6-96231b3b80d8
* Dead code.Chad Rosier2013-03-191-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177451 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Move the immediate asm rewrite into the target specificChad Rosier2013-03-191-5/+1
| | | | | | | logic as a QOI cleanup. No functional change. Tests already in place. rdar://13456414 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177446 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Remove the brackets from X86Operand in the IR. These will beChad Rosier2013-03-191-8/+19
| | | | | | | | | | | | | | | | | | | | added back in by X86AsmPrinter::printIntelMemReference() during codegen. Previously, this following example void t() { int i; __asm mov eax, [i] } would generate the below assembly mov eax, dword ptr [[eax]] which resulted in a fatal error when compiling. Test case coming on the clang side. rdar://13444264 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177440 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Move the size directive asm rewrite into the target specificChad Rosier2013-03-191-12/+4
| | | | | | | logic as a QOI cleanup. rdar://13445327 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177413 91177308-0d34-0410-b5e6-96231b3b80d8
* Change NULL to 0.Jakub Staszak2013-03-181-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177342 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the FDE encoding to be relative on ELF.Rafael Espindola2013-03-151-6/+6
| | | | | | | | | | | | This is a very late complement to r130637 which fixed this on x86_64. Fixes pr15448. Since it looks like that every elf architecture uses this encoding when using cfi, make it the default for elf. Just exclude mips64el. It has a lovely .ll -> .o test (ef_frame.ll) that tests that nothing changes in the binary content of the .eh_frame produced by llc. Oblige it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177141 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: use SmallVector instead of std::vector in MCDwarfDirsCUMap and ↵Manman Ren2013-03-123-9/+9
| | | | | | MCDwarfFilesCUMap git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176893 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the assert()'s from the LLVMCreateDisasmCPU() library API and justKevin Enderby2013-03-121-8/+16
| | | | | | | | | | | | | | | | | | | | | | return 0 to indicate failure to create the disassembler. A library routine should not assert and just let the caller handler the error. For example darwin's otool(1) will simply print an error if it ends up using a library that is not configured for a target it wants: % otool -tv ViewController.o ViewController.o: (__TEXT,__text) section can't create arm llvm disassembler This is much better than an abort which appears as a crash to the user or even the assert when using a Debug+Asserts built library: Assertion failed: (MAI && "Unable to create target asm info!"), function LLVMCreateDisasmCPU, file /Volumes/SandBox/llvm/lib/MC/MCDisassembler/Disassembler.cpp, line 47. radr://12539918 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176880 91177308-0d34-0410-b5e6-96231b3b80d8
* Commit the right files for r176762. Sigh.Nick Lewycky2013-03-091-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176763 91177308-0d34-0410-b5e6-96231b3b80d8
* We need a shndx if the number of sections breaks SHN_LORESERVE. This conditionNick Lewycky2013-03-091-1/+1
| | | | | | | for choosing to emit a shndx was simply testing the wrong variable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176762 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: store the files and directories for each compile unit.Manman Ren2013-03-076-15/+21
| | | | | | | | | | | | | | | We now emit a line table for each compile unit. To reduce the prologue size of each line table, the files and directories used by each compile unit are stored in std::map<unsigned, std::vector< > > instead of std::vector< >. The prologue for a lto'ed image can be as big as 93K. Duplicating 93K for each compile unit causes a huge increase of debug info. With this patch, each prologue will only emit the files required by the compile unit. rdar://problem/13342023 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176605 91177308-0d34-0410-b5e6-96231b3b80d8
* AsmParser: More generic support for integer type suffices.Jim Grosbach2013-02-261-6/+9
| | | | | | | | | | For integer constants, allow 'L', 'UL' as well as 'ULL' and 'LL'. This provides better support for shared headers between .s and .c files that define bunches of constant values. rdar://9321056 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176118 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR15359.Bill Schmidt2013-02-261-0/+13
| | | | | | | | The PowerPC TLS relocation types were not previously added to the necessary list in MCELFStreamer::fixSymbolsInTLSFixups(). Now they are! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176094 91177308-0d34-0410-b5e6-96231b3b80d8
* 'Hexadecimal' has two 'a's and only one 'i'.Matt Beaumont-Gay2013-02-251-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176031 91177308-0d34-0410-b5e6-96231b3b80d8
* MCParser: Update method names per coding guidelines.Jim Grosbach2013-02-205-270/+270
| | | | | | | | | | | | | | | | | | | s/AddDirectiveHandler/addDirectiveHandler/ s/ParseMSInlineAsm/parseMSInlineAsm/ s/ParseIdentifier/parseIdentifier/ s/ParseStringToEndOfStatement/parseStringToEndOfStatement/ s/ParseEscapedString/parseEscapedString/ s/EatToEndOfStatement/eatToEndOfStatement/ s/ParseExpression/parseExpression/ s/ParseParenExpression/parseParenExpression/ s/ParseAbsoluteExpression/parseAbsoluteExpression/ s/CheckForValidSection/checkForValidSection/ http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175675 91177308-0d34-0410-b5e6-96231b3b80d8
* clear new map and initialize new variablePedro Artigas2013-02-201-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175578 91177308-0d34-0410-b5e6-96231b3b80d8
* ELF symbol table field st_other support, Jack Carter2013-02-194-3/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | excluding visibility bits. Generic STO handling at the Target level. The st_other field of the ELF symbol table is one byte in size. The first 2 bytes are used for generic visibility and are currently handled by llvm. The other six bits are processor specific and need to be set at the target level. A couple of notes: The new static methods for accessing and setting the "other" flags in include/llvm/MC/MCELF.h match the style guide and not the other methods in the file. I don't like the inconsistency, but feel I should follow the prescribed lowerUpper() convention. STO_ value definitions are not specified in gnu land as consistently as the STT_ and STB_ fields. Probably because the latter were defined in a standards doc and the former defined partially in code. I have stuck with the full byte definition of the flags. Contributer: Zoran Jovanovic git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175561 91177308-0d34-0410-b5e6-96231b3b80d8
* MCParser: Reject .balign with non-pow2 alignments.Benjamin Kramer2013-02-161-0/+4
| | | | | | | | GNU as rejects them and there are configure scripts in the wild that check if the assembler rejects ".align 3" to determine whether the alignment is in bytes or powers of two. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175360 91177308-0d34-0410-b5e6-96231b3b80d8
* Derive ELF section type from the name in some cases where GNU as doesJoerg Sonnenberger2013-02-161-1/+10
| | | | | | | so. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175327 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress a GCC -Wunused-variable warning in -Asserts buildsMatt Beaumont-Gay2013-02-151-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175319 91177308-0d34-0410-b5e6-96231b3b80d8
* c[ms-inline asm] It's possible to have a SizeDirective rewrite and anChad Rosier2013-02-151-1/+16
| | | | | | | | Input/Output rewrite to the same location. Make sure the SizeDirective rewrite is performed first. This also ensure the sort algorithm is stable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175317 91177308-0d34-0410-b5e6-96231b3b80d8
* If bundle alignment is enabled, do not add data to a fragment with instructionsDerek Schuff2013-02-152-4/+7
| | | | | | | | | | | | With bundle alignment, instructions all get their own MCFragments (unless they are in a bundle-locked group). For instructions with fixups, this is an MCDataFragment. Emitting actual data (e.g. for .long) attempts to re-use MCDataFragments, which we don't want int this case since it leads to fragments which exceed the bundle size. So, don't reuse them in this case. Also adds a test and fixes some formatting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175316 91177308-0d34-0410-b5e6-96231b3b80d8