summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
...
* Print a=b as an assignment.Rafael Espindola2014-06-248-35/+1
| | | | | | | | | | | In assembly the expression a=b is parsed as an assignment, so it should be printed as one. This remove a truly horrible hack for producing a label with "a=.". It would be used by codegen but would never be reached by the asm parser. Sorry I missed this when it was first committed. llvm-svn: 211639
* Allow using .cfi_startproc without a leading symbol.Rafael Espindola2014-06-232-10/+2
| | | | | | This is possible now that we don't produce .eh symbols. This fixes pr19430. llvm-svn: 211502
* Stop producing func.eh symbols on Darwin.Rafael Espindola2014-06-232-9/+0
| | | | | | | | | | According Nick Kledzik (http://llvm.org/bugs/show_bug.cgi?id=19430#c2): "... mach-o no longer needs names in the __eh_frame section (and has not for years)." Iain Sandoe confirms it is also unnecessary for their old darwin support. llvm-svn: 211500
* MC: Cleanup parseMSInlineAsmDavid Majnemer2014-06-231-16/+13
| | | | | | | | | Utilize range based for-loops to simplify some code. Use insert() instead of a loop for simplicity/efficiency. No functionality change. llvm-svn: 211486
* MC: adjust text section flags for WoASaleem Abdulrasool2014-06-222-8/+15
| | | | | | | | | | | | | | | | | | | | | | | Correct the section flags for code built for Windows on ARM with `-ffunction-sections`. Windows on ARM uses solely Thumb-2 instructions, and indicates that the function is thumb by placing it in a text section that has IMAGE_SCN_MEM_16BIT flag set. When we encounter a .section directive, a new section is constructed. This may be a text segment. In order to identify that we need the additional flag, expose the target triple through the ObjectFileInfo as this information is lost otherwise. Since any modern ARM targeting environment on Windows would be Thumb-2 (Windows ARM NT or Windows Embedded Compact), introducing a new flag to indicate the section attribute seems to be a bit overkill. Simply depend on the target triple. Since there is one location that this information is currently needed, creating a target specific assembly parser and delegating the parsing of section switches also feels a bit heavy handed. If it turns out that this information ends up changing additional behaviour, then it may be worth considering that alternative. llvm-svn: 211481
* Revert r211399, "Generate native unwind info on Win64"NAKAMURA Takumi2014-06-222-12/+5
| | | | | | It broke Legacy JIT Tests on x86_64-{mingw32|msvc}, aka Windows x64. llvm-svn: 211480
* Report error for non-zero data in .bssWeiming Zhao2014-06-221-2/+8
| | | | | | | | | | | | User may initialize a var with non-zero value and specify .bss section. E.g. : int a __attribute__((section(".bss"))) = 2; This patch converts an assertion to error report for better user experience. Differential Revision: http://reviews.llvm.org/D4199 llvm-svn: 211455
* Always use a temp symbol for CIE.Rafael Espindola2014-06-201-6/+1
| | | | | | Fixes pr19185. llvm-svn: 211423
* Use compact unwind for the iOS simulator.Rafael Espindola2014-06-201-0/+5
| | | | | | Another step in fixing pr19185. llvm-svn: 211416
* Use a helper function and clang-format.Rafael Espindola2014-06-201-6/+19
| | | | | | No functionality change. llvm-svn: 211415
* Generate native unwind info on Win64Reid Kleckner2014-06-202-5/+12
| | | | | | | | | | | | | | | | | | | | This patch enables LLVM to emit Win64-native unwind info rather than DWARF CFI. It handles all corner cases (I hope), including stack realignment. Because the unwind info is not flexible enough to describe stack frames with a gap of unknown size in the middle, such as the one caused by stack realignment, I modified register spilling code to place all spills into the fixed frame slots, so that they can be accessed relative to the frame pointer. Patch by Vadim Chugunov! Reviewed By: rnk Differential Revision: http://reviews.llvm.org/D4081 llvm-svn: 211399
* Fix up a few formatting issues.Eric Christopher2014-06-191-14/+13
| | | | llvm-svn: 211307
* MCNullStreamer: assign file IDs to resolve crashes and errorsAlp Toker2014-06-191-9/+1
| | | | | | | | | | Use the MCStreamer base implementations for file ID tracking instead of overriding them as no-ops. Avoids assertions when streaming Dwarf debug info, and fixes ASM parsing of loc and file directives. llvm-svn: 211282
* Emit DWARF info for all code section in an assembly fileOliver Stannard2014-06-194-57/+189
| | | | | | | | Currently, when using llvm as an assembler, DWARF debug information is only generated for the .text section. This patch modifies this so that DWARF info is emitted for all executable sections. llvm-svn: 211273
* Emit DWARF3 call frame information when DWARF3+ debug info is requestedOliver Stannard2014-06-191-2/+12
| | | | | | | | | | | | | | | | Currently, llvm always emits a DWARF CIE with a version of 1, even when emitting DWARF 3 or 4, which both support CIE version 3. This patch makes it emit the newer CIE version when we are emitting DWARF 3 or 4. This will not reduce compatibility, as we already emit other DWARF3/4 features, and is worth doing as the DWARF3 spec removed some ambiguities in the interpretation of call frame information. It also fixes a minor bug where the "return address" field of the CIE was encoded as a ULEB128, which is only valid when the CIE version is 3. There are no test changes for this, because (as far as I can tell) none of the platforms that we test have a return address register with a DWARF register number >127. llvm-svn: 211272
* Move -dwarf-version to an MC level command line option so it'sEric Christopher2014-06-191-1/+2
| | | | | | | used by all of the MC level tools and codegen. Fix up all uses in the compiler to use this and set it on the context accordingly. llvm-svn: 211257
* Convert some assert(0) to llvm_unreachable or fold an 'if' condition into ↵Craig Topper2014-06-191-2/+1
| | | | | | the assert. llvm-svn: 211254
* MS asm: Properly handle quoted symbol namesDavid Majnemer2014-06-191-1/+13
| | | | | | | | | | | | | We would get confused by '@' characters in symbol names, we would mistake the text following them for the variant kind. When an identifier a string, the variant kind will never show up inside of it. Instead, check to see if there is a variant following the string. This fixes PR19965. llvm-svn: 211249
* MC: do not add comment string to the AsmToken in AsmLexer::LexLineCommentSaleem Abdulrasool2014-06-181-2/+2
| | | | | | | | Fixes macros with varargs if the macro instantiation has a trailing comment. Patch by Janne Grunau! llvm-svn: 211219
* MCAsmParser: full support for gas' '.if{cond} expression' directivesSaleem Abdulrasool2014-06-181-8/+41
| | | | | | Patch by Janne Grunau! llvm-svn: 211218
* [ARM] [MC] Refactor the constant pool classesWeiming Zhao2014-06-182-0/+96
| | | | | | | | | | | ARMTargetStreamer implements ConstantPool and AssmeblerConstantPools to keep track of assembler-generated constant pools that are used for ldr-pseudo. When implementing ldr-pseudo for AArch64, these two classes can be reused. So this patch factors them out from ARM target to the general MC lib. llvm-svn: 211198
* Using llvm::sys::swapByteOrder() for the common case of byte-swapping a ↵Artyom Skrobov2014-06-141-1/+1
| | | | | | value in place llvm-svn: 210978
* Renaming SwapByteOrder() to getSwappedBytes()Artyom Skrobov2014-06-141-1/+1
| | | | | | The next commit will add swapByteOrder(), acting in-place llvm-svn: 210973
* Remove 'using std::errro_code' from lib.Rafael Espindola2014-06-132-4/+2
| | | | llvm-svn: 210871
* Don't use 'using std::error_code' in include/llvm.Rafael Espindola2014-06-122-0/+2
| | | | | | This should make sure that most new uses use the std prefix. llvm-svn: 210835
* MC: add enumeration of WinEH data encodingSaleem Abdulrasool2014-06-111-1/+2
| | | | | | | | | | | | | | | Most Windows platforms use auxiliary data for unwinding. This information is stored in the .pdata section. The encoding format for the data differs between architectures and Windows variants. Windows MIPS and Alpha use identical formats; Alpha64 is the same with different widths. Windows x86_64 and Itanium share the representation. All Windows CE entries are identical irrespective of the architecture. ARMv7 (Windows [NT] on ARM) has its own format. This enumeration will become the differentiator once the windows EH emission infrastructure is generalised, allowing us to emit the necessary unwinding information for Windows on ARM. llvm-svn: 210634
* Revert "Patch by Ray Donnelly to print register names instead of numbers."Reid Kleckner2014-06-101-11/+4
| | | | | | | | | | | | | This reverts commit r206683. The code was confusing SEH register numbers with DWARF register numbers. The test case it was committed with was obviously incorrect. The disassembler was roundtripping '.seh_pushreg %rsi' as '.seh_pushreg %rbp', and other exciting things. Noticed by Vadim Chugunov. llvm-svn: 210574
* Fix gcc warning (enumeral and non-enumeral type in conditional expression)Patrik Hagglund2014-06-091-1/+2
| | | | llvm-svn: 210450
* AsmMatchers: Use unique_ptr to manage ownership of MCParsedAsmOperandDavid Blaikie2014-06-081-19/+12
| | | | | | | | | | | | I saw at least a memory leak or two from inspection (on probably untested error paths) and r206991, which was the original inspiration for this change. I ran this idea by Jim Grosbach a few weeks ago & he was OK with it. Since it's a basically mechanical patch that seemed sufficient - usual post-commit review, revert, etc, as needed. llvm-svn: 210427
* MC: fix text section characteristics for WoASaleem Abdulrasool2014-06-081-0/+3
| | | | | | | | | | link.exe requires that the text section has the IMAGE_SCN_MEM_16BIT flag set. Otherwise, it will treat the function as ARM. If this occurs, then jumps to the function will fail, switching from thumb to ARM mode execution. With this change, it is possible to link using the MSVC linker as well. llvm-svn: 210415
* MC: make ELF .type handling more GNU AS compatibleSaleem Abdulrasool2014-06-081-38/+34
| | | | | | | | | | | | | | GAS documents the .type directive as having an optional comma following the key symbol name when using the STT_<TYPE_IN_UPPER_CASE> form. However, it treats the comma as optional in all cases. This makes the IAS support both forms of inputs. Furthermore, the prefixed forms take either the upper case name or the lower case alias. The tests are split into two separate sets as the hash character serves as a comment character on x86, which is tested in the second set by using arm-elf which uses the at symbol as a comment character. llvm-svn: 210407
* MC: fix ctor/dtor section for windows-itaniumSaleem Abdulrasool2014-06-081-1/+1
| | | | | | | | This adjusts the section setup for the windows-itanium environment. This environment does not report to be a known windows msvc environment, even though it is (nearly) identical to the MSVC environment for C code. llvm-svn: 210406
* MC: whitespace, grouping for COFF section setupSaleem Abdulrasool2014-06-081-26/+33
| | | | | | | | Add some whitespace, combine two sequential conditionals into a single one. Reformat some section definitions to maintain uniformity in the function. NFC. llvm-svn: 210405
* MC: prevent early DCE of empty sectionsSaleem Abdulrasool2014-06-061-7/+3
| | | | | | | | | | | | | | | | Prevent the early elimination of sections in the object writer. There may be references to the section itself by other symbols, which may potentially not be possible to resolve. ML (Visual Studio's Macro Assembler) also seems to retain empty sections. The elimination of symbols and sections which are unused should really occur at the link phase. This will not cause any change in the resulting binary, simply in the generated object files. The adjustments to the other unit tests account for the fluctuating section index caused by the appearance of sections which were previously discarded. llvm-svn: 210373
* Fix a few issues with comdat handling on COFF.Rafael Espindola2014-06-064-57/+47
| | | | | | | | | | | | | | | | | | | | | * Section association cannot use just the section name as many sections can have the same name. With this patch, the comdat symbol in an assoc section is interpreted to mean a symbol in the associated section and the mapping is discovered from it. * Comdat symbols were not being set correctly. Instead we were getting whatever was output first for that section. A consequence is that associative sections now must use .section to set the association. Using .linkonce would not work since it is not possible to change a sections comdat symbol (it is used to decide if we should create a new section or reuse an existing one). This includes r210298, which was reverted because it was asserting on an associated section having the same comdat as the associated section. llvm-svn: 210367
* Revert r210298 'Correctly set the comdat symbol on COFF' as it asserts on ↵Timur Iskhodzhanov2014-06-061-13/+2
| | | | | | Windows llvm-svn: 210317
* Correctly set the comdat symbol on COFF.Rafael Espindola2014-06-051-2/+13
| | | | | | | | | | | | | | | | | | | | | We extended the .section syntax to allow multiple sections with the same name but different comdats, but currently we don't make sure that the output section has that comdat symbol. That happens to work with the code llc produces currently because it looks like .section secName, "dr", one_only, "COMDATSym" .globl COMDATSym COMDATSym: .... but that is not very friendly to anyone coding in assembly or even to llc once we get comdat support in the IR. This patch changes the coff object writer to make sure the comdat symbol is output just after the section symbol, as required by the coff spec. llvm-svn: 210298
* Fix MIPS exception personality encoding.Logan Chien2014-05-301-0/+7
| | | | | | | | | For MIPS, we have to encode the personality routine with an indirect pointer to absptr; otherwise, some link warning warning will be raised, and the program might crash in some early MIPS Android device. llvm-svn: 209907
* MachO: support N_INDR aliases in assembly files.Tim Northover2014-05-301-9/+41
| | | | | | | | | This makes LLVM create N_INDR aliases (to be resolved by the linker) when appropriate. rdar://problem/15125513 llvm-svn: 209894
* [mips][mips64r6] Add Relocations R_MIPS_PCHI16, R_MIPS_PCLO16 Zoran Jovanovic2014-05-271-0/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D3860 llvm-svn: 209659
* AArch64/ARM64: move ARM64 into AArch64's placeTim Northover2014-05-241-4/+6
| | | | | | | | | | | | | | | This commit starts with a "git mv ARM64 AArch64" and continues out from there, renaming the C++ classes, intrinsics, and other target-local objects for consistency. "ARM64" test directories are also moved, and tests that began their life in ARM64 use an arm64 triple, those from AArch64 use an aarch64 triple. Both should be equivalent though. This finishes the AArch64 merge, and everyone should feel free to continue committing as normal now. llvm-svn: 209577
* MC: initialise MCAsmParser variableSaleem Abdulrasool2014-05-221-2/+2
| | | | | | | Properly initialise HadError to false during construction. Detected as use-of-uninitialised variable by MSan! llvm-svn: 209393
* MC: formalise some assertions into proper errorsSaleem Abdulrasool2014-05-221-8/+23
| | | | | | | | | Now that clang can be used as an assembler via the IAS, invalid assembler inputs would cause the assertions to trigger. Although we cannot recover from the errors here, nor provide caret diagnostics, attempt to handle them slightly more gracefully by reporting a fatal error. llvm-svn: 209387
* Revert "DebugInfo: Don't put fission type units in comdat sections."David Blaikie2014-05-211-7/+7
| | | | | | | | | This reverts commit r208930, r208933, and r208975. It seems not all fission consumers are ready to handle this behavior. Reverting until tools are brought up to spec. llvm-svn: 209338
* MC: introduce ability to restrict recorded relocationsSaleem Abdulrasool2014-05-211-1/+2
| | | | | | | | | Add support to allow a target specific COFF object writer to restrict the recorded resolutions in the emitted object files. This is motivated by the need in Windows on ARM, where an intermediate relocation needs to be prevented from being emitted in the object file. llvm-svn: 209336
* MC: loosen an overzealous assertionSaleem Abdulrasool2014-05-211-1/+2
| | | | | | | | Permit active macro expansions when terminating the assembler if there were errors during the expansion. This would only trigger on invalid input when built with assertions. llvm-svn: 209309
* MC: mark COFF .drectve section as REMOVESaleem Abdulrasool2014-05-211-1/+1
| | | | | | | | | The .drectve section should be marked as IMAGE_SCN_LNK_REMOVE. This matches what the MSVC toolchain does and accurately reflects that this section should not be emitted into the final binary. This section is merely information for the linker, comprising of additional linker directives. llvm-svn: 209273
* Move the verbose asm option to be part of the options struct andEric Christopher2014-05-201-1/+1
| | | | | | set appropriately. llvm-svn: 209258
* Fix hardcoded slash to native path seperator which was exposed from ↵Yaron Keren2014-05-161-1/+1
| | | | | | | | llvm::sys::path. http://reviews.llvm.org/D3687 llvm-svn: 208980
* MC: Add DwarfTypesDWOSection also to MCCOFF.NAKAMURA Takumi2014-05-161-0/+4
| | | | llvm-svn: 208975
OpenPOWER on IntegriCloud