summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
...
* Devirtualize and pack MCFragment to reduce memory usage.Pete Cooper2015-06-172-49/+79
| | | | | | | | | | | | | MCFragment didn't really need vtables. The majority of virtual methods were just getters and setters. This removes the vtables and uses dispatch on the kind to do things like delete which needs to get the appropriate class. This reduces memory on the verify use list order test case by about 2MB out of 800MB. Reviewed by Rafael Espíndola llvm-svn: 239952
* Move IsUsedInReloc from MCSymbolELF to MCSymbol.Rafael Espindola2015-06-172-24/+2
| | | | | | There is a free bit is MCSymbol and MachO needs the same information. llvm-svn: 239933
* Use named temporaries for directional labels.Rafael Espindola2015-06-171-9/+10
| | | | | | | | | | Directional labels can show up in symbol tables (and we have a llvm-mc test for that). Given that, we need to make sure they are named. With that out of the way, use setUseNamesOnTempLabels in llvm-mc so that it too benefits from the memory saving. llvm-svn: 239914
* [MC/Dwarf] Encode DW_CFA_advance_loc in target endianess.Benjamin Kramer2015-06-171-9/+8
| | | | | | This matches GNU as output. llvm-svn: 239911
* Recommit r239721: Replace string GNU Triples with llvm::Triple in ↵Daniel Sanders2015-06-161-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | InitMCObjectFileInfo. NFC. Summary: This affects other tools so the previous C++ API has been retained as a deprecated function for the moment. Clang has been updated with a trivial patch (not covered by the pre-commit review) to avoid breaking -Werror builds. Other in-tree tools will be fixed with similar patches. This continues the patch series to eliminate StringRef forms of GNU triples from the internals of LLVM that began in r239036. The first time this was committed it accidentally fixed an inconsistency in triples in llvm-mc and this caused a failure. This inconsistency was fixed in r239808. Reviewers: rengolin Reviewed By: rengolin Subscribers: llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10366 llvm-svn: 239812
* [CodeGen] Introduce a FAULTING_LOAD_OP pseudo-op.Sanjoy Das2015-06-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This instruction encodes a loading operation that may fault, and a label to branch to if the load page-faults. The locations of potentially faulting loads and their "handler" destinations are recorded in a FaultMap section, meant to be consumed by LLVM's clients. Nothing generates FAULTING_LOAD_OP instructions yet, but they will be used in a future change. The documentation (FaultMaps.rst) needs improvement and I will update this diff with a more expanded version shortly. Depends on D10196 Reviewers: rnk, reames, AndyAyers, ab, atrick, pgavlin Reviewed By: atrick, pgavlin Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10197 llvm-svn: 239740
* Revert r239721 - Replace string GNU Triples with llvm::Triple in ↵Daniel Sanders2015-06-151-9/+2
| | | | | | | | InitMCObjectFileInfo. NFC. It appears to cause sparc-little-endian.s to assert on Windows and Darwin. llvm-svn: 239724
* Replace string GNU Triples with llvm::Triple in InitMCObjectFileInfo. NFC.Daniel Sanders2015-06-151-2/+9
| | | | | | | | | | | | | | | | | | | | | Summary: This affects other tools so the previous C++ API has been retained as a deprecated function for the moment. Clang has been updated with a trivial patch (not covered by the pre-commit review) to avoid breaking -Werror builds. Other in-tree tools will be fixed with similar trivial patches. This continues the patch series to eliminate StringRef forms of GNU triples from the internals of LLVM that began in r239036. Reviewers: rengolin Reviewed By: rengolin Subscribers: llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10366 llvm-svn: 239721
* [WinEH] Create an llvm.x86.seh.exceptioninfo intrinsicReid Kleckner2015-06-111-5/+4
| | | | | | | | | | | | | | This intrinsic is like framerecover plus a load. It recovers the EH registration stack allocation from the parent frame and loads the exception information field out of it, giving back a pointer to an EXCEPTION_POINTERS struct. It's designed for clang to use in SEH filter expressions instead of accessing the EXCEPTION_POINTERS parameter that is available on x64. This required a minor change to MC to allow defining a label variable to another absolute framerecover label variable. llvm-svn: 239567
* Generalize emitAbsoluteSymbolDiff.Rafael Espindola2015-06-112-9/+25
| | | | | | | | | | This makes emitAbsoluteSymbolDiff always succeed and moves logic from the asm printer to it. The object one now also works on ELF. If two symbols are in the same fragment, we will never move them apart. llvm-svn: 239552
* Replace string GNU Triples with llvm::Triple in MCSubtargetInfo and ↵Daniel Sanders2015-06-101-11/+6
| | | | | | | | | | | | | | | | | | create*MCSubtargetInfo(). NFC. Summary: This continues the patch series to eliminate StringRef forms of GNU triples from the internals of LLVM that began in r239036. Reviewers: rafael Reviewed By: rafael Subscribers: rafael, ted, jfb, llvm-commits, rengolin, jholewinski Differential Revision: http://reviews.llvm.org/D10311 llvm-svn: 239467
* Replace string GNU Triples with llvm::Triple in create*MCRelocationInfo(). NFC.Daniel Sanders2015-06-101-1/+2
| | | | | | | | | | | | | | | | Summary: This continues the patch series to eliminate StringRef forms of GNU triples from the internals of LLVM that began in r239036. Reviewers: rafael Reviewed By: rafael Subscribers: rafael, llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10307 llvm-svn: 239465
* [WinEH] Emit .safeseh directives for all 32-bit exception handlersReid Kleckner2015-06-101-2/+8
| | | | | | | | | | Use a "safeseh" string attribute to do this. You would think we chould just accumulate the set of personalities like we do on dwarf, but this fails to account for the LSDA-loading thunks we use for __CxxFrameHandler3. Each of those needs to make it into .sxdata as well. The string attribute seemed like the most straightforward approach. llvm-svn: 239448
* Fix warning of comparing different enums. NFCPete Cooper2015-06-091-1/+1
| | | | llvm-svn: 239443
* Revert "Move MCSymbol Value in to the union of Offset and CommonSize."Pete Cooper2015-06-091-4/+0
| | | | | | | | | This reverts commit 2e449ec5bcdf67b52b315b16c2128aaf25d5b73c. This was svn r239440. Its currently failing an ARM test so reverting while I work out what to do next. llvm-svn: 239441
* Move MCSymbol Value in to the union of Offset and CommonSize.Pete Cooper2015-06-091-0/+4
| | | | | | | | | It wasn't possible to have a variable Symbol with offset or 'isCommon' so this just enables better packing of the MCSymbol class. Reviewed by Rafael Espindola. llvm-svn: 239440
* Use AlignOf traits to enable static_assert.Pete Cooper2015-06-091-3/+3
| | | | | | This is better than runtime asserts. Thanks to David Blaikie for the help here. llvm-svn: 239431
* Reduce duplication in MCSymbol Name handling. NFC>Pete Cooper2015-06-091-0/+1
| | | | | | | | | | | | | Based on feedback to r239428 by David Blaikie, use const_cast to reduce duplication of the const and non-const versions of getNameEntryPtr. Also have that method return the pointer to the name directly instead of users having to then get the name from the union. Finally, add a FIXME that we should use a static_assert once available in the new operator. llvm-svn: 239429
* Make MCSymbol::Name be a union of uint64_t and a pointer.Pete Cooper2015-06-091-6/+9
| | | | | | | | | This should hopefully fix the 32-bit bots which were allocating space for a pointer but needed to be aligned to 64-bits. Now we allocate enough space for a uint64_t and a pointer and cast to the appropriate storage llvm-svn: 239428
* Change from alignof to llvm::alignOf to appease Visual StudioPete Cooper2015-06-091-2/+2
| | | | llvm-svn: 239424
* Allocate space for MCSymbol::Name only if required.Pete Cooper2015-06-092-5/+21
| | | | | | | | | | | | | | Similarly to User which allocates a number of Use's prior to the this pointer, allocate space for the Name* for MCSymbol only when we need a name. Given that an MCSymbol is 48-bytes on 64-bit systems, this saves a decent % of space. Given the verify_uselistorder test case with debug info and llc, 50k symbols have names out of 700k so this optimises for the common case of temporary unnamed symbols. Reviewed by David Blaikie. llvm-svn: 239423
* Removing spurious semi colons; NFC.Aaron Ballman2015-06-091-1/+1
| | | | llvm-svn: 239399
* MC: Add target hook to control symbol quotingMatt Arsenault2015-06-097-77/+127
| | | | llvm-svn: 239370
* Use a PointerUnion in MCSymbol for Section and Fragment. NFC.Pete Cooper2015-06-081-2/+1
| | | | | | | The Fragment and Section, and a bool for HasFragment were all used to create a PointerUnion. Just use a pointer union instead. llvm-svn: 239324
* Remove includes of MCMachOSymbolFlags.h after it was deletedPete Cooper2015-06-082-2/+0
| | | | llvm-svn: 239318
* Move all flags logic to MCSymbolMachO.Pete Cooper2015-06-082-35/+21
| | | | | | | | | | | Also delete the now unused MCMachOSymbolFlags.h header as the only enum in there was moved to MCSymbolMachO. Similarly to ELF and COFF, manipulating the flags is now done via helpers instead of spread throughout the codebase. Reviewed by Rafael Espíndola. llvm-svn: 239316
* Add MCSymbolMachO which will be used to hide the MCSymbolMachO flags.Pete Cooper2015-06-081-1/+2
| | | | | | Reviewed by Rafael Espíndola. llvm-svn: 239315
* Move all of the MCSymbol COFF flags logic in to MCSymbolCOFF.Pete Cooper2015-06-082-9/+7
| | | | | | | | | All flags setting/getting is now done in the class with helper methods instead of users having to get the bits in the correct order. Reviewed by Rafael Espíndola. llvm-svn: 239314
* Add MCSymbolCOFF class and use it to get and set the COFF type field.Pete Cooper2015-06-083-10/+18
| | | | | | Reviewed by Rafael Espíndola. llvm-svn: 239312
* Change MCSymbol IsELF to an enum to support future MCSymbolCOFF and ↵Pete Cooper2015-06-081-1/+1
| | | | | | | | MCSymbolMachO. Reviewed by Rafael Espíndola. llvm-svn: 239311
* [MC] Common symbols weren't being checked for redeclaration which allowed an ↵Colin LeMahieu2015-06-061-1/+3
| | | | | | assembly file to generate an assertion in setCommon(): !isCommon(). This change allows redeclaration as long as the size and alignment match exactly, otherwise report a fatal error. llvm-svn: 239227
* Refactor padding writing into a helper function.Rafael Espindola2015-06-051-12/+12
| | | | llvm-svn: 239174
* Save a map lookup. NFC.Rafael Espindola2015-06-051-2/+4
| | | | llvm-svn: 239168
* [ARM] Add knowledge of FPU subtarget features to TargetParserJohn Brawn2015-06-052-22/+38
| | | | | | | | | | | | | Add getFPUFeatures to TargetParser, which gets the list of subtarget features that are enabled/disabled for each FPU, and use it when handling the .fpu directive. No functional change in this commit, though clang will start behaving differently once it starts using this. Differential Revision: http://reviews.llvm.org/D10237 llvm-svn: 239150
* MC: Clean up naming in MCObjectFileInfo.h.Jim Grosbach2015-06-041-6/+6
| | | | | | Init*() methods to init*(). llvm-svn: 239121
* MC: Clean up the naming for MCMachObjectWriter. NFC.Jim Grosbach2015-06-044-34/+34
| | | | | | | | | | | | | | | | | | s/ExecutePostLayoutBinding/executePostLayoutBinding/ s/ComputeSymbolTable/computeSymbolTable/ s/BindIndirectSymbols/bindIndirectSymbols/ s/RecordTLVPRelocation/recordTLVPRelocation/ s/RecordScatteredRelocation/recordScatteredRelocation/ s/WriteLinkerOptionsLoadCommand/writeLinkerOptionsLoadCommand/ s/WriteLinkeditLoadCommand/writeLinkeditLoadCommand/ s/WriteNlist/writeNlist/ s/WriteDysymtabLoadCommand/writeDysymtabLoadCommand/ s/WriteSymtabLoadCommand/writeSymtabLoadCommand/ s/WriteSection/writeSection/ s/WriteSegmentLoadCommand/writeSegmentLoadCommand/ s/WriteHeader/writeHeader/ llvm-svn: 239119
* MC: Clean up naming in MCObjectWriter. NFC.Jim Grosbach2015-06-046-209/+209
| | | | | | | | | | | | | | | | | | | | s/WriteObject/writeObject/ s/RecordRelocation/recordRelocation/ s/IsSymbolRefDifferenceFullyResolved/isSymbolRefDifferenceFullyResolved/ s/Write8/write8/ s/WriteLE16/writeLE16/ s/WriteLE32/writeLE32/ s/WriteLE64/writeLE64/ s/WriteBE16/writeBE16/ s/WriteBE32/writeBE32/ s/WriteBE64/writeBE64/ s/Write16/write16/ s/Write32/write32/ s/Write64/write64/ s/WriteZeroes/writeZeroes/ s/WriteBytes/writeBytes/ llvm-svn: 239108
* [MachOWriter] Use for-range and roll some duplicated code into loops.Benjamin Kramer2015-06-041-43/+25
| | | | | | No functionality change intended. llvm-svn: 239096
* Remove unused argument. NFC.Rafael Espindola2015-06-041-4/+3
| | | | llvm-svn: 239092
* MC: Remove obsolete MachO UseAggressiveSymbolFolding.Jim Grosbach2015-06-042-11/+5
| | | | | | | | | | Fix the FIXME and remove this old as(1) compat option. It was useful for bringup of the integrated assembler to diff object files, but now it's just causing more relocations than strictly necessary to be generated. rdar://21201804 llvm-svn: 239084
* Test commit access.Gabor Ballabas2015-06-041-1/+1
| | | | | | Fix trailing whitespace. llvm-svn: 239058
* Omit unused section symbols from the symbol table.Rafael Espindola2015-06-041-3/+5
| | | | | | | | | | | | | | Section symbols exist as an optimization: instead of having multiple relocations point to different symbols, many of them can point to a single section symbol. When that optimization is unused, a section symbol is also unused and adds no extra information to the object file. This saves a bit of space on the object files and makes the output of llvm-objdump -t easier to read and consequently some tests get quite a bit simpler. llvm-svn: 239045
* Bring back r239006 with a fix.Rafael Espindola2015-06-042-41/+137
| | | | | | | | | | | | | | | | | | | The fix is just that getOther had not been updated for packing the st_other values in fewer bits and could return spurious values: - unsigned Other = (getFlags() & (0x3f << ELF_STO_Shift)) >> ELF_STO_Shift; + unsigned Other = (getFlags() & (0x7 << ELF_STO_Shift)) >> ELF_STO_Shift; Original message: Pack the MCSymbolELF bit fields into MCSymbol's Flags. This reduces MCSymolfELF from 64 bytes to 56 bytes on x86_64. While at it, also make getOther/setOther easier to use by accepting unshifted STO_* values. llvm-svn: 239012
* Revert "Pack the MCSymbolELF bit fields into MCSymbol's Flags."Rafael Espindola2015-06-042-136/+40
| | | | | | | | This reverts commit r239006. I am debugging the powerpc failures. llvm-svn: 239010
* Pack the MCSymbolELF bit fields into MCSymbol's Flags.Rafael Espindola2015-06-042-40/+136
| | | | | | | | | This reduces MCSymolfELF from 64 bytes to 56 bytes on x86_64. While at it, also make getOther/setOther easier to use by accepting unshifted STO_* values. llvm-svn: 239006
* Remove MCELFSymbolFlags.h. It is now internal to MCSymbolELF.Rafael Espindola2015-06-043-6/+12
| | | | llvm-svn: 238996
* Remember if a weakref of a symbol has been used.Rafael Espindola2015-06-033-26/+27
| | | | | | | | | This avoids yet another last minute patching of the binding. While at it, also simplify the weakref implementation a bit by not walking past it in the expression evaluation. llvm-svn: 238982
* Store whether a symbol is a comdat signature in MCSymbolELF.Rafael Espindola2015-06-032-25/+19
| | | | | | | With this getBinging can now return the correct answer for all cases not involving a .symver and the elf writer doesn't need to patch it last minute. llvm-svn: 238980
* Record in a MCSymbolELF if it has been used in a relocation.Rafael Espindola2015-06-032-10/+15
| | | | | | No functionality change, just saves an on the side map. llvm-svn: 238979
* Simplify the logic in ELFObjectWriter::isInSymtab. NFC.Rafael Espindola2015-06-031-9/+5
| | | | | | | _GLOBAL_OFFSET_TABLE_ is not magical and we can now directly check for a symbol never getting an explicit binding. llvm-svn: 238978
OpenPOWER on IntegriCloud