summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
...
* Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith ↵Yaron Keren2016-01-299-11/+11
| | | | | | | | r259192 post commit comment. clang part in r259232, this is the LLVM part of the patch. llvm-svn: 259240
* [CodeView] Implement .cv_inline_linetableDavid Majnemer2016-01-295-6/+155
| | | | | | | | | | | This support is _very_ rudimentary, just enough to get some basic data into the CodeView debug section. Left to do is: - Use the combined opcodes to save space. - Do something about code offsets. llvm-svn: 259230
* [codeview] Begin to add support for inlined call sitesReid Kleckner2016-01-291-3/+10
| | | | | | | | | | | | | | | | | | | | | Summary: There are three parts to inlined call frames: 1. The inlinee line subsection 2. The inline site symbol record 3. The function ids referenced by both This change starts by emitting function ids (3) for all subprograms and emitting the base inline site symbol record (2). The actual line numbers in (2) use an encoded format that will come next, along with the inlinee line subsection. Reviewers: majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16333 llvm-svn: 259217
* Fix some -Wstring-conversion warningsDavid Blaikie2016-01-291-6/+6
| | | | | | | I don't seem to see these locally, maybe just need to update my compiler, or we haven't turned them on for LLVM's build and we should... llvm-svn: 259146
* Reland "[CodeView] Use assembler directives for line tables"Reid Kleckner2016-01-298-8/+580
| | | | | | | | This reverts commit r259126 and relands r259117. This time with updated library dependencies. llvm-svn: 259130
* Revert "[CodeView] Use assembler directives for line tables"Reid Kleckner2016-01-298-580/+8
| | | | | | | | | This reverts commit r259117. The LineInfo constructor is defined in the codeview library and we have to link against it now. Doing that isn't trivial, so reverting for now. llvm-svn: 259126
* Silence gcc warning about ternary and enumerationsReid Kleckner2016-01-281-1/+1
| | | | llvm-svn: 259123
* [CodeView] Use assembler directives for line tablesReid Kleckner2016-01-288-8/+580
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a new family of .cv_* directives to LLVM's variant of GAS syntax: - .cv_file: Similar to DWARF .file directives - .cv_loc: Similar to the DWARF .loc directive, but starts with a function id. CodeView line tables are emitted by function instead of by compilation unit, so we needed an extra field to communicate this. Rather than overloading the .loc direction further, we decided it was better to have our own directive. - .cv_stringtable: Emits the codeview string table at the current position. Currently this just contains the filenames as null-terminated strings. - .cv_filechecksums: Emits the file checksum table for all files used with .cv_file so far. There is currently no support for emitting actual checksums, just filenames. This moves the line table emission code down into the assembler. This is in preparation for implementing the inlined call site line table format. The inline line table format encoding algorithm requires knowing the absolute code offsets, so it must run after the assembler has laid out the code. David Majnemer collaborated on this patch. llvm-svn: 259117
* ARMv7k: base ABI decision on v7k Arch rather than watchos OS.Tim Northover2016-01-271-2/+2
| | | | | | | | Various bits we want to use the new ABI actually compile with "-arch armv7k -miphoneos-version-min=9.0". Not ideal, but also not ridiculous given how slices work. llvm-svn: 258975
* One more batch of self-containing headers.Benjamin Kramer2016-01-271-7/+7
| | | | llvm-svn: 258974
* Move MCTargetAsmParser.h to llvm/MC/MCParser where it belongs.Benjamin Kramer2016-01-274-4/+4
| | | | llvm-svn: 258917
* Remove autoconf supportChris Bieneman2016-01-263-45/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened." - Obi Wan Kenobi Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16471 llvm-svn: 258861
* Reflect the MC/MCDisassembler split on the include/ level.Benjamin Kramer2016-01-267-11/+11
| | | | | | No functional change, just moving code around. llvm-svn: 258818
* [MC] Use .p2align instead of .alignDan Gohman2016-01-261-5/+2
| | | | | | | | | | | | | | | For historic reasons, the behavior of .align differs between targets. Fortunately, there are alternatives, .p2align and .balign, which make the interpretation of the parameter explicit, and which behave consistently across targets. This patch teaches MC to use .p2align instead of .align, so that people reading code for multiple architectures don't have to remember which way each platform does its .align directive. Differential Revision: http://reviews.llvm.org/D16549 llvm-svn: 258750
* [COFF] Simplify SetSectionNameDavid Majnemer2016-01-241-12/+10
| | | | | | | | Consolidate the code which handles string table offsets less than 999999 with the code for offsets less than 9999999. While we are here, simplify the code by not using sprintf to generate the string. llvm-svn: 258664
* Rename MCLineEntry to MCDwarfLineEntryDavid Majnemer2016-01-212-9/+9
| | | | | | | MCLineEntry gives the impression that it is generic MC machinery. However, it is specific to DWARF. llvm-svn: 258381
* Accept subtractions involving a weak symbol.Rafael Espindola2016-01-201-6/+0
| | | | | | | | | | | | | | | | | | When a symbol S shows up in an expression in assembly there are two possible interpretations * The expression is referring to the value of S in this file. * The expression is referring to the value after symbol resolution. In the first case the assembler can reason about the value and try to produce a relocation. In the second case, that is only possible if the symbol cannot be preempted. Assemblers are not very consistent about which interpretation gets used. This changes MC to agree with GAS in the case of an expression of the form "Sym - WeakSym". llvm-svn: 258329
* [MC, COFF] Add .reloc support for WinCOFFDavid Majnemer2016-01-193-4/+12
| | | | | | | This adds rudimentary support for a few relocations that we will use for the CodeView debug format. llvm-svn: 258216
* Use larger write sizes for MCFillFragment.Rafael Espindola2016-01-191-3/+14
| | | | | | | This brings the pr26208 testcase down to 3.2 seconds. Not checking it in since it does create a 4GB .o file. llvm-svn: 258149
* Simplify MCFillFragment.Rafael Espindola2016-01-195-19/+8
| | | | | | | | | The value size was always 1 or 0, so we don't need to store it. In a no asserts build this takes the testcase of pr26208 from 11 to 10 seconds. llvm-svn: 258141
* Handle 64 bit offsets.Rafael Espindola2016-01-191-1/+1
| | | | | | | | | No tests since llvm-mc takes 14 seconds on it. I will try to improve it and then test. Part of pr26208. llvm-svn: 258129
* [WebAssembly] Don't create a needless .note.GNU-stack sectionDan Gohman2016-01-151-0/+3
| | | | | | | | | | WebAssembly's stack will never be executable by default, so it isn't necessary to declare .note.GNU-stack sections to request a non-executable stack. Differential Revision: http://reviews.llvm.org/D15969 llvm-svn: 257962
* Delete MCRelocationInfo::createExprForRelocation.Pete Cooper2016-01-151-5/+0
| | | | | | | | | | | This method has no callers. Also remove X86ELFRelocationInfo.cpp and X86MachORelocationInfo.cpp which only existed to provide an implementation of that method. Ok'd by Rafael and Jim. llvm-svn: 257859
* Update to use new name alignTo().Rui Ueyama2016-01-142-4/+4
| | | | llvm-svn: 257804
* Convert a few assert failures into proper errors.Rafael Espindola2016-01-131-4/+4
| | | | | | Fixes PR25944. llvm-svn: 257697
* Simplify. NFC.Rafael Espindola2016-01-131-9/+9
| | | | llvm-svn: 257689
* [WebAssembly] Define WebAssembly-specific relocation codes.Dan Gohman2016-01-111-0/+1
| | | | | | | | Currently WebAssembly has two kinds of relocations; data addresses and function addresses. This adds ELF relocations for them, as well as an MC symbol kind to indicate which type of relocation is needed. llvm-svn: 257416
* Remove a bugs assert.Rafael Espindola2016-01-111-2/+0
| | | | | | | There is no reason the value being printed has to be positive. Fixes pr25802. llvm-svn: 257412
* Added support for macro emission in dwarf (supporting DWARF version 4).Amjad Aboud2016-01-071-0/+10
| | | | | | Differential Revision: http://reviews.llvm.org/D15495 llvm-svn: 257060
* Make WinCOFFObjectWriter.cpp's timestamp writing not use ENABLE_TIMESTAMPSNico Weber2016-01-061-7/+1
| | | | | | | | | | | | | | | | | | | | | LLVM_ENABLE_TIMESTAMPS controls if timestamps are embedded into llvm's binaries. Turning it off is useful for deterministic builds. r246905 made it so that the define suddenly also controls if the binaries that the llvm binaries _create_ embed timestamps or not – but this shouldn't be a configure-time option. r256203/r256204 added a driver option to toggle this on and off, so this patch now passes this driver option in LLVM_ENABLE_TIMESTAMPS builds so that if LLVM_ENABLE_TIMESTAMPS is set, the build of LLVM is deterministic – but the built clang can still write timestamps into other executables when requested. This also allows removing some of the test machinery added in r292012 to work around this problem. See PR24740 for background. http://reviews.llvm.org/D15783 llvm-svn: 256958
* (NFC) Change SubtargetFeatures::ToggleFeature andArtyom Skrobov2016-01-052-16/+8
| | | | | | | | | | | SubtargetFeatures::ApplyFeatureFlag to be static, so that MCSubtargetInfo doesn't need to instantiate SubtargetFeatures for nothing. Also change the return type to void, as it wasn't ever used. This is a partial commit of http://reviews.llvm.org/D15746 llvm-svn: 256823
* Clang-format my previous change (r256313)Paul Robinson2016-01-041-5/+5
| | | | llvm-svn: 256764
* [MC] Fix file name in file headerJeroen Ketema2016-01-041-1/+1
| | | | llvm-svn: 256749
* Use an ArrayRef to simplify repeated calculation of the array end. NFCCraig Topper2016-01-031-5/+6
| | | | llvm-svn: 256702
* Use std::is_sorted instead of manual loops. NFCCraig Topper2016-01-031-8/+4
| | | | llvm-svn: 256701
* [ptr-traits] Provide a real MCFragment address for the sentinel insteadChandler Carruth2015-12-291-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | of casting the integer '4' to such a pointer. There is no reason to expect '4' to be a portable or reliable pointer of this form. The only reason this ever worked is because the PointerIntPair that this actually gets used with has an artificially *low* presumed alignment that allowed it to work. When the alignment of PointerIntPair is derived from the actual type's alignment, the asserts start firing on this pointer. I'm amazed we never managed to do anything that triggered the alignment sanitizer with it, as this is just flat out UB. If folks dislike this approach to providing a sentinel fragment address, there are a myriad of other alternatives, suggestions welcome. But this one has the distinct advantage of not requiring the friend dance of ilist's sentinel (which I'll point out is *also* in play for MCFragment!) and seems to be using a nicely provided facility in MCFragment to establish just such dummy nodes. This is part of a series of patches to allow LLVM to check for complete pointee types when computing its pointer traits. This is absolutely necessary to get correct (or reproducible) results for things like how many low bits are guaranteed to be zero. llvm-svn: 256552
* [ptr-traits] Split the MCFragment type hierarchy out of the MCAssemblerChandler Carruth2015-12-293-429/+459
| | | | | | | | | | | | | | | | | | | | | | header to its own header, allowing users of fragments to have a narrower header file, and avoid circular header dependencies when getting the definition of MCSection prior to inspecting traits on MCSection pointers. This is part of a series of patches to allow LLVM to check for complete pointee types when computing its pointer traits. This is absolutely necessary to get correct (or reproducible) results for things like how many low bits are guaranteed to be zero. Note that this doesn't in any way change the design of MC, it is just moving code around to allow the *header files* to be more fine grained. Without this, it is impossible to get a complete type for MCSection where it is needed. If anyone would prefer a different slicing of the header files, I'm happy to oblige of course. =] llvm-svn: 256548
* Accept dwarf version 5 for CIE versions.Eric Christopher2015-12-281-0/+1
| | | | llvm-svn: 256527
* Form reform for MCDwarf.Paul Robinson2015-12-231-4/+8
| | | | | | | | | MCDwarf emits a canned abbreviation table, but was not emitting proper forms for DWARF version 4, which is the default after r249655. Differential Revision: http://reviews.llvm.org/D15732 llvm-svn: 256313
* [MC] Don't use the architecture to govern which object file format to useDavid Majnemer2015-12-221-14/+14
| | | | | | | | | | | InitMCObjectFileInfo was trying to override the triple in awkward ways. For example, a triple specifying COFF but not Windows was forced as ELF. This makes it easy for internal invariants to get violated, such as those which triggered PR25912. This fixes PR25912. llvm-svn: 256226
* [MC, COFF] Support link /incremental conditionallyDavid Majnemer2015-12-213-8/+17
| | | | | | | | | | | | | | | | Today, we always take into account the possibility that object files produced by MC may be consumed by an incremental linker. This results in us initialing fields which vary with time (TimeDateStamp) which harms hermetic builds (e.g. verifying a self-host went well) and produces sub-optimal code because we cannot assume anything about the relative position of functions within a section (call sites can get redirected through incremental linker thunks). Let's provide an MCTargetOption which controls this behavior so that we can disable this functionality if we know a-priori that the build will not rely on /incremental. llvm-svn: 256203
* Teach MCOperand::print how to print FPImm operands.Dan Gohman2015-12-211-0/+2
| | | | llvm-svn: 256163
* [MC, COFF] Unbreak support for COFF timestampsDavid Majnemer2015-12-211-0/+1
| | | | | | | | | | | | | | | | | | | Support for COFF timestamps was unintentionally broken in r246905 when it was conditionally available depending on whether or not LLVM was configured with LLVM_ENABLE_TIMESTAMPS. However, Config/config.h was never included which essentially broke the feature. Due to lax testing, the breakage was never identified until we observed strange failures during incremental links of Chromium. This issue is resolved by simply including Config/config.h in WinCOFFObjectWriter and teaching lit that the MC/COFF/timestamp.s test is conditionally supported depending on LLVM_ENABLE_TIMESTAMPS. With this in place, we can strengthen the test to ensure that it will not accidentally get broken in the future. This fixes PR25891. llvm-svn: 256137
* Recognize strings for Hexagon-specific variant kindsKrzysztof Parzyszek2015-12-181-0/+7
| | | | llvm-svn: 256007
* Avoid explicit relocation sorting most of the time.Rafael Espindola2015-12-171-17/+6
| | | | | | | | | | These days relocations are created and stored in a deterministic way. The order they are created is also suitable for the .o file, so we don't need an explicit sort. The last remaining exception is MIPS. llvm-svn: 255902
* Always sort by offset first. NFC.Rafael Espindola2015-12-172-16/+16
| | | | | | | Every target changing sortRelocs was first calling the parent implementation. Just run that first. llvm-svn: 255898
* Use std::unique_ptr. NFC.Rafael Espindola2015-12-162-10/+7
| | | | llvm-svn: 255852
* [X86][inline asm] support even directive Michael Zuckerman2015-12-131-0/+5
| | | | | | | | | | | The .even directive aligns content to an evan-numbered address. In at&t syntax .even In Microsoft syntax even (without the dot). Differential Revision: http://reviews.llvm.org/D15413 llvm-svn: 255462
* Replace uint16_t with the MCPhysReg typedef in many places. A lot of ↵Craig Topper2015-12-052-3/+3
| | | | | | physical register arrays already use this typedef. llvm-svn: 254843
* [llvm-dwp] Support debug_tu_indexDavid Blaikie2015-12-051-0/+10
| | | | llvm-svn: 254827
OpenPOWER on IntegriCloud