summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
* Object: Add support for bigobjDavid Majnemer2014-09-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | This adds support for reading the "bigobj" variant of COFF produced by cl's /bigobj and mingw's -mbig-obj. The most significant difference that bigobj brings is more than 2**16 sections to COFF. bigobj brings a few interesting differences with it: - It doesn't have a Characteristics field in the file header. - It doesn't have a SizeOfOptionalHeader field in the file header (it's only used in executable files). - Auxiliary symbol records have the same width as a symbol table entry. Since symbol table entries are bigger, so are auxiliary symbol records. Write support will come soon. Differential Revision: http://reviews.llvm.org/D5259 llvm-svn: 217496
* MC: correct DWARF line info for PE/COFFSaleem Abdulrasool2014-09-061-1/+2
| | | | | | | | | DWARF address ranges contain a reference to the debug_info section. This offset is an absolute relocation except on non-PE/COFF targets where it is section relative. We would emit this incorrectly, and trying to map the debug info from the address would fail. llvm-svn: 217317
* MC: correct DWARF header for PE/COFF assembly inputSaleem Abdulrasool2014-09-051-4/+4
| | | | | | | | | | | The header contains an offset to the DWARF line table for the CU. The offset must be section relative for COFF and absolute for others. The non-assembly code path for the DWARF header generation already has the correct emission for the headers. This corrects the assembly input path. This was identified by BFD objecting to the LLVM generated DWARF information. llvm-svn: 217222
* MC Win64: Put unwind info for COMDAT code into the same COMDAT groupReid Kleckner2014-09-044-27/+62
| | | | | | | | | | | | | | | | | Summary: This fixes a long standing issue where we would emit many little .text sections and only one .pdata and .xdata section. Now we generate one .pdata / .xdata pair per .text section and associate them correctly. Fixes PR19667. Reviewers: majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5181 llvm-svn: 217176
* Add override to overriden virtual methods, remove virtual keywords.Benjamin Kramer2014-09-031-2/+2
| | | | | | No functionality change. Changes made by clang-tidy + some manual cleanup. llvm-svn: 217028
* Nuke MCAnalysis.Sean Silva2014-09-0212-1668/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code is buggy and barely tested. It is also mostly boilerplate. (This includes MCObjectDisassembler, which is the interface to that functionality) Following an IRC discussion with Jim Grosbach, it seems sensible to just nuke the whole lot of functionality, and dig it up from VCS if necessary (I hope not!). All of this stuff appears to have been added in a huge patch dump (look at the timeframe surrounding e.g. r182628) where almost every patch seemed to be untested and not reviewed before being committed. Post-review responses to the patches were never addressed. I don't think any of it would have passed pre-commit review. I doubt anyone is depending on this, since this code appears to be extremely buggy. In limited testing that Michael Spencer and I did, we couldn't find a single real-world object file that wouldn't crash the CFG reconstruction stuff. The symbolizer stuff has O(n^2) behavior and so is not much use to anyone anyway. It seemed simpler to remove them as a whole. Most of this code is boilerplate, which is the only way it was able to scrape by 60% coverage. HEADSUP: Modules folks, some files I nuked were referenced from include/llvm/module.modulemap; I just deleted the references. Hopefully that is the right fix (one was a FIXME though!). llvm-svn: 216983
* Change MCSchedModel to be a struct of statically initialized data.Pete Cooper2014-09-022-12/+10
| | | | | | | | This removes static initializers from the backends which generate this data, and also makes this struct match the other Tablegen generated structs in behaviour Reviewed by Andy Trick and Chandler C llvm-svn: 216919
* Fix left shifts by too large exponents in MCParserAlexey Samsonov2014-09-021-7/+8
| | | | | | | | (which happened only on error recovery path). This bug was reported by UBSan. llvm-svn: 216915
* MC: remove unnecessary enumeration prefixSaleem Abdulrasool2014-09-011-1/+1
| | | | | | | | This is an enum class, and will be appropriately prefixed, making the encoding type prefix redundant. No change to any uses as the use of this was not yet introduced. llvm-svn: 216893
* Fix some cases where StringRef was being passed by const reference. Remove ↵Craig Topper2014-08-301-8/+8
| | | | | | const from some other StringRefs since its implicitly const already. llvm-svn: 216820
* Silence a -Wsign-compare warning. NFC.Aaron Ballman2014-08-281-1/+1
| | | | llvm-svn: 216666
* MC: Don't crash when the COFF section limit is reachedDavid Majnemer2014-08-281-6/+11
| | | | | | | I've decided not to commit a test, it takes 2.5 seconds to run on my an incredibly strong machine. llvm-svn: 216647
* Return a std::unique_ptr when creating a new MemoryBuffer.Rafael Espindola2014-08-271-4/+4
| | | | llvm-svn: 216583
* Remove unused argument.Rafael Espindola2014-08-271-9/+6
| | | | llvm-svn: 216580
* Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or ↵Craig Topper2014-08-271-4/+4
| | | | | | just letting them be implicitly created. llvm-svn: 216525
* Convert MC command line option for fatal assembler warnings into aJoerg Sonnenberger2014-08-262-8/+4
| | | | | | proper flag. llvm-svn: 216471
* Modernize raw_fd_ostream's constructor a bit.Rafael Espindola2014-08-251-4/+4
| | | | | | | | | | Take a StringRef instead of a "const char *". Take a "std::error_code &" instead of a "std::string &" for error. A create static method would be even better, but this patch is already a bit too big. llvm-svn: 216393
* Explicitly pass ownership of the MemoryBuffer to AddNewSourceBuffer using ↵David Blaikie2014-08-211-6/+6
| | | | | | std::unique_ptr llvm-svn: 216223
* Don't allow MCStreamer::EmitIntValue to output 0-byte integers.Alexey Samsonov2014-08-202-2/+3
| | | | | | | | It makes no sense and can hide bugs. In particular, it lead to left shift by 64 bits, which is an undefined behavior, properly reported by UBSan. llvm-svn: 216134
* Remove unused field.Rafael Espindola2014-08-201-3/+1
| | | | llvm-svn: 216086
* TableGen: allow use of uint64_t for available features mask.Tim Northover2014-08-181-1/+1
| | | | | | | | | | ARM in particular is getting dangerously close to exceeding 32 bits worth of possible subtarget features. When this happens, various parts of MC start to fail inexplicably as masks get truncated to "unsigned". Mostly just refactoring at present, and there's probably no way to test. llvm-svn: 215887
* Remove unused member variable.Rafael Espindola2014-08-171-10/+7
| | | | llvm-svn: 215860
* Make EmitAbsValue an static helper.Rafael Espindola2014-08-152-31/+31
| | | | llvm-svn: 215721
* Delete dead code. NFC.Rafael Espindola2014-08-151-6/+0
| | | | llvm-svn: 215720
* Make EmitDwarfSetLineAddr an static helper. NFC.Rafael Espindola2014-08-152-13/+13
| | | | llvm-svn: 215718
* Make BuildSymbolDiff an static helper.Rafael Espindola2014-08-152-15/+13
| | | | llvm-svn: 215717
* Make ForceExpAbs an static helper.Rafael Espindola2014-08-151-3/+4
| | | | llvm-svn: 215715
* Add a helper to MCExpr for when an expression is know to be absolute.Rafael Espindola2014-08-153-22/+23
| | | | llvm-svn: 215713
* Remove HasLEB128.Rafael Espindola2014-08-153-4/+0
| | | | | | We already require CFI, so it should be safe to require .leb128 and .uleb128. llvm-svn: 215712
* Don't print comments to an object streamer :-)Rafael Espindola2014-08-151-128/+13
| | | | llvm-svn: 215689
* EmitAbsValue is the same as EmitValue on non-darwin. NFC.Rafael Espindola2014-08-151-1/+1
| | | | llvm-svn: 215688
* MC: AsmLexer: handle multi-character CommentStrings correctlySaleem Abdulrasool2014-08-141-5/+13
| | | | | | | | | | | | As X86MCAsmInfoDarwin uses '##' as CommentString although a single '#' starts a comment a workaround for this special case is added. Fixes divisions in constant expressions for the AArch64 assembler and other targets which use '//' as CommentString. Patch by Janne Grunau! llvm-svn: 215615
* Canonicalize header guards into a common format.Benjamin Kramer2014-08-131-2/+2
| | | | | | | | | | Add header guards to files that were missing guards. Remove #endif comments as they don't seem common in LLVM (we can easily add them back if we decide they're useful) Changes made by clang-tidy with minor tweaks. llvm-svn: 215558
* MC: Diagnose an unexpected token in COFF .section instead of assertingReid Kleckner2014-08-111-0/+4
| | | | | | | This can easily arise when trying to assemble and ELF style .section directive for a COFF object file. llvm-svn: 215373
* SubTargetFeature.cpp: it seems the size of this SmallVector should be 3Hans Wennborg2014-08-111-1/+1
| | | | | | because some subtarget feature strings have three components. llvm-svn: 215339
* Fix tabs.Joerg Sonnenberger2014-08-101-4/+4
| | | | llvm-svn: 215311
* If available, pass down the Fixup object to EvaluateAsRelocatable.Joerg Sonnenberger2014-08-103-24/+32
| | | | | | | At least on PowerPC, the interpretation of certain modifiers depends on the context they appear in. llvm-svn: 215310
* MC: remove duplicated codeSaleem Abdulrasool2014-08-091-14/+2
| | | | | | | | This removes the duplicate definition of GetXDataSection. This function is available as a static method and is identical to the previous implementation. This just cleans up the unnecessary duplication. llvm-svn: 215289
* MC: cleanup includesSaleem Abdulrasool2014-08-091-1/+0
| | | | | | Cleanup Win64EH header inclusion. NFC. llvm-svn: 215288
* MC: split Win64EHUnwindEmitter into a shared streamerSaleem Abdulrasool2014-08-074-59/+84
| | | | | | | | | | This changes Win64EHEmitter into a utility WinEH UnwindEmitter that can be shared across multiple architectures and a target specific bit which is overridden (Win64::UnwindEmitter). This enables sharing the section selection code across X86 and the intended use in ARM for emitting unwind information for Windows on ARM. llvm-svn: 215050
* Enable Darwin vararg parameters support in assembler macros.Kevin Enderby2014-08-041-1/+1
| | | | | | | | | Duplicate the vararg tests for linux and add a tests which mixed vararg arguments with darwin positional parameters. Patch by: Janne Grunau <j@jannau.net> llvm-svn: 214799
* MC: virtualise EmitWindowsUnwindTablesSaleem Abdulrasool2014-08-031-4/+0
| | | | | | | | | This makes EmitWindowsUnwindTables a virtual function and lowers the implementation of the function to the X86WinCOFFStreamer. This method is a target specific operation. This enables making the behaviour target dependent by isolating it entirely to the target specific streamer. llvm-svn: 214664
* MC: rename Win64EHFrameInfo to WinEH::FrameInfoSaleem Abdulrasool2014-08-033-26/+38
| | | | | | | | | | | | | | The frame information stored in this structure is driven by the requirements for Windows NT unwinding rather than Windows 64 specifically. As a result, this type can be shared across multiple architectures (ARM, AXP, MIPS, PPC, SH). Rename this class in preparation for adding support for supporting unwinding information for Windows on ARM. Take the opportunity to constify the members as everything except the ChainedParent is read-only. This required some adjustment to the label handling. llvm-svn: 214663
* Add support for StackMap section for ELF/Linux systemsPhilip Reames2014-08-011-0/+6
| | | | | | | | | | This patch adds code to emits the StackMap section on ELF systems. This section is required to support llvm.experimental.stackmap and llvm.experimental.patchpoint intrinsics. Reviewers: ributzka, echristo Differential Revision: http://reviews.llvm.org/D4574 llvm-svn: 214538
* Revert "Remove MCObjectDisassembler.cpp as it is untested and unused." as it ↵Eric Christopher2014-07-312-0/+575
| | | | | | | | is apparently used, but the build didn't return errors weirdly. This reverts commits 214437 and 214438. llvm-svn: 214444
* Fixing CMake problems with MCObjectDisassembler.cpp not existing.Aaron Ballman2014-07-311-1/+0
| | | | llvm-svn: 214438
* Remove MCObjectDisassembler.cpp as it is untested and unused.Eric Christopher2014-07-311-574/+0
| | | | llvm-svn: 214437
* Move MCObjectSymbolizer.h to MC/MCAnalysis.Rafael Espindola2014-07-312-2/+2
| | | | | | The cpp file is already in lib/MC/MCAnalysis. llvm-svn: 214424
* Fix loop end condition.Eric Christopher2014-07-311-1/+1
| | | | | Note: This code appears to be untested. llvm-svn: 214416
* Reapply "DebugInfo: Don't put fission type units in comdat sections."David Blaikie2014-07-251-7/+7
| | | | | | | | | | | | | | | | This recommits r208930, r208933, and r208975 (by reverting r209338) and reverts r209529 (the FIXME to readd this functionality once the tools were fixed) now that DWP has been fixed to cope with a single section for all fission type units. Original commit message: "Since type units in the dwo file are handled by a debug aware tool, they don't need to leverage the ELF comdat grouping to implement deduplication. Avoid creating all the .group sections for these as a space optimization." llvm-svn: 213956
OpenPOWER on IntegriCloud