summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Convert BindingExplicitlySet into a MCSymbolELF field.Rafael Espindola2015-06-032-6/+2
| | | | | | I will pack it better in a followup patch. llvm-svn: 238975
* Clarify when we can avoid creating names for temp symbols.Rafael Espindola2015-06-021-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some temporary symbols are created by MC itself. These symbols are never used for lookup and are never included in the object symbol table, so we can avoid creating a name for them. Other temporaries are created by CodeGen or by the user by explicitly asking for a name starting with .L (or L on MachO). These temporaries behave like regular symbols, we just try to avoid including them in the object symbol table, but sometimes they end up there: const char *foo() { return "abc" + 3; } will have a relocation pointing to a .L symbol. It just so happens that almost all MC created temporary has the AlwaysAddSuffix option and CodeGen/user created ones don't. One interesting future optimization would be to use unnamed symbols for all temporaries, but that would require use an st_name of 0 or having the object writer create the names if a symbol does end up in the symbol table. No testcase since this just avoid creating a few extra names for MC created temporaries. llvm-svn: 238887
* Pass a MCSymbolELF to a few ELF only functions. NFC.Rafael Espindola2015-06-022-6/+6
| | | | llvm-svn: 238868
* Merge MCELF.h into MCSymbolELF.h.Rafael Espindola2015-06-024-102/+96
| | | | | | | Now that we have a dedicated type for ELF symbol, these helper functions can become member function of MCSymbolELF. llvm-svn: 238864
* [mips] Make TTypeEncoding indirect to allow .eh_frame to be read-only.Daniel Sanders2015-06-021-3/+9
| | | | | | | | | | | | | | | | | | | | | Summary: Following on from r209907 which made personality encodings indirect, do the same for TType encodings. This fixes the case where a try/catch block needs to generate references to, for example, std::exception in the .gcc_except_table. Previous attempts at committing this broke the buildbots due to bugs in IAS. These bugs have now been fixed so trying again. Reviewers: petarj Reviewed By: petarj Subscribers: srhines, joerg, tberghammer, llvm-commits Differential Revision: http://reviews.llvm.org/D9669 llvm-svn: 238863
* Create a MCSymbolELF.Rafael Espindola2015-06-028-28/+32
| | | | | | | | | This create a MCSymbolELF class and moves SymbolSize since only ELF needs a size expression. This reduces the size of MCSymbol from 56 to 48 bytes. llvm-svn: 238801
* MC: Tidy up LOH naming a bit. NFC.Jim Grosbach2015-06-012-2/+2
| | | | llvm-svn: 238800
* The fragment implies the section, don't store both.Rafael Espindola2015-06-014-3/+15
| | | | | | This reduces MCSymbol from 64 to 56 bytes on x86_64. llvm-svn: 238747
* [WinCOFF] Ignore .safeseh for non-x86 architecturesDavid Majnemer2015-06-011-0/+6
| | | | | | | We don't want to bother with creating .sxdata sections on Win64; all the relevant information is already in the .pdata section. llvm-svn: 238730
* Rename HasData to IsRegistered.Rafael Espindola2015-06-012-5/+1
| | | | | | | | | There is no MCSectionData, so the old name is now meaningless. Also remove some asserts/checks that were there just because the information they used was in MCSectionData. llvm-svn: 238708
* Remove trivial forwarding function.Rafael Espindola2015-06-012-2/+2
| | | | llvm-svn: 238707
* Store a bit in MCSection saying if it was registered with MCAssembler.Rafael Espindola2015-06-013-17/+11
| | | | | | With this we can replace a SetVector with a plain std::vector. llvm-svn: 238706
* Use a bitfield. NFC.Rafael Espindola2015-06-011-1/+2
| | | | llvm-svn: 238705
* [MC] Simplify code. No functionality change intended.Benjamin Kramer2015-05-311-7/+2
| | | | llvm-svn: 238676
* [MC] Allow backends to decide relaxation for unresolved fixups.Colin LeMahieu2015-05-302-24/+28
| | | | | | Differential Revision: http://reviews.llvm.org/D8217 llvm-svn: 238659
OpenPOWER on IntegriCloud