summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* [WinCOFF] Add support for the .safeseh directiveDavid Majnemer2015-05-307-17/+89
| | | | | | | | | .safeseh adds an entry to the .sxdata section to register all the appropriate functions which may handle an exception. This entry is not a relocation to the symbol but instead the symbol table index of the function. llvm-svn: 238641
* MC: Clean up MCExpr naming. NFC.Jim Grosbach2015-05-3015-112/+112
| | | | llvm-svn: 238634
* Remove getData.Rafael Espindola2015-05-2910-110/+65
| | | | | | This completes the mechanical part of merging MCSymbol and MCSymbolData. llvm-svn: 238617
* Remove the MCSymbolData typedef.Rafael Espindola2015-05-2910-33/+33
| | | | | | The getData member function is next. llvm-svn: 238611
* Merge MCSymbol and MCSymbolData.Rafael Espindola2015-05-291-12/+0
| | | | | | | As a transition hack leave MCSymbolData as a typedef of MCSymbol. I will be removing that in a second. llvm-svn: 238609
* Rename getOrCreateSymbolData to registerSymbol and return void.Rafael Espindola2015-05-296-27/+37
| | | | | | Another step in merging MCSymbol and MCSymbolData. llvm-svn: 238607
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-291-4/+3
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238602
* Move Flags from MCSymbolData to MCSymbol.Rafael Espindola2015-05-296-49/+38
| | | | llvm-svn: 238598
* Fix build without asserts.Rafael Espindola2015-05-291-0/+2
| | | | llvm-svn: 238597
* Pass MCSymbols to the helper functions in MCELF.h.Rafael Espindola2015-05-293-71/+75
| | | | llvm-svn: 238596
* Pass a MCSymbol to needsRelocateWithSymbol.Rafael Espindola2015-05-292-2/+2
| | | | llvm-svn: 238589
* Move common symbol related information from MCSectionData to MCSymbol.Rafael Espindola2015-05-299-27/+22
| | | | llvm-svn: 238583
* Store MCSymbols in PendingLabels.Rafael Espindola2015-05-291-2/+3
| | | | llvm-svn: 238582
* Move SymbolSize from MCSymbolData to MCSymbol.Rafael Espindola2015-05-292-5/+4
| | | | llvm-svn: 238580
* Fix crash in MCExpr::print.Pete Cooper2015-05-291-1/+1
| | | | | | | | | | | | Symbols are no longer required to be named, but this leads to a crash here if an unnamed symbol checks that its first character is '$'. Change the code to first check for a name, then check its first character. No test case i'm afraid as this is debugging code, but any test case with temp labels and 'llc --debug --filetype=obj' would have crashed. llvm-svn: 238579
* [WinEH] Emit EH tables for __CxxFrameHandler3 on 32-bit x86Reid Kleckner2015-05-292-3/+9
| | | | | | | | | | | | | Small (really small!) C++ exception handling examples work on 32-bit x86 now. This change disables the use of .seh_* directives in WinException when CFI is not in use. It also uses absolute symbol references in the tables instead of imagerel32 relocations. Also fixes a cache invalidation bug in MMI personality classification. llvm-svn: 238575
* Simplify now that symbols contain the correct section.Rafael Espindola2015-05-291-9/+4
| | | | | | | The complexity in here was because before r233995 variable symbols would report the incorrect section. llvm-svn: 238559
* Fix ELFObjectWriter::isLocal for signature symbols.Rafael Espindola2015-05-291-8/+8
| | | | | | | | | And with that simplify the logic for inserting them in ExternalSymbolData or LocalSymbolData. No functionality change overall since the old code avoided the isLocal bug. llvm-svn: 238555
* Don't special case undefined symbol when deciding the symbol order.Rafael Espindola2015-05-281-9/+1
| | | | | | | | | ELF has no restrictions on where undefined symbols go relative to other defined symbols. In fact, gas just sorts them together. Do the same. This was there since r111174 probably just because the MachO writer has it. llvm-svn: 238513
* Remove a trivial forwarding function. NFC.Rafael Espindola2015-05-289-20/+19
| | | | llvm-svn: 238506
* Inline trivial method. NFC.Rafael Espindola2015-05-281-14/+2
| | | | llvm-svn: 238492
* Revert r238427 - [mips] Make TTypeEncoding indirect to allow .eh_frame to be ↵Daniel Sanders2015-05-281-10/+3
| | | | | | | | read-only. It caused a smaller number of failures than the previous attempt at committing but still caused a couple on the llvm-linux-mips builder. Reverting while I investigate the remainder. llvm-svn: 238483
* Remove structure field that can be computed just before use.Rafael Espindola2015-05-281-14/+15
| | | | llvm-svn: 238480
* Avoid warnings when building without asserts.Rafael Espindola2015-05-281-7/+2
| | | | llvm-svn: 238479
* Move these vectors to the only function where they are used.Rafael Espindola2015-05-281-6/+4
| | | | llvm-svn: 238477
* Merge redundant loops. NFC.Rafael Espindola2015-05-281-18/+11
| | | | llvm-svn: 238471
* Simplify LastLocalSymbolIndex computation. NFC.Rafael Espindola2015-05-281-4/+2
| | | | llvm-svn: 238465
* Use range loops. NFC.Rafael Espindola2015-05-281-7/+3
| | | | llvm-svn: 238463
* Remove temporary FileSymbolData. NFC.Rafael Espindola2015-05-281-12/+8
| | | | llvm-svn: 238461
* [llvm] Parameterizing the output stream for dumpbytes and outputting ↵Colin LeMahieu2015-05-281-0/+9
| | | | | | directly to stream. llvm-svn: 238453
* Use range loops for accessing file names. NFC.Rafael Espindola2015-05-282-10/+9
| | | | llvm-svn: 238446
* Merge computeSymbolTable and writeSymbolTable.Rafael Espindola2015-05-281-94/+80
| | | | | | | For now this just saves a few loops, but it will allow more simplifications in the future. llvm-svn: 238444
* Don't create an unused _GLOBAL_OFFSET_TABLE_.Rafael Espindola2015-05-281-43/+1
| | | | | | | | This was a bug for bug compatibility with gas that is completely unnecessary. If a _GLOBAL_OFFSET_TABLE_ symbol is used, it will already be created by the time we get to the ELF writer. llvm-svn: 238432
* [mips] Make TTypeEncoding indirect to allow .eh_frame to be read-only.Daniel Sanders2015-05-281-3/+10
| | | | | | | | | | | | | | | | | | 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. Reviewers: petarj Reviewed By: petarj Subscribers: srhines, joerg, tberghammer, llvm-commits Differential Revision: http://reviews.llvm.org/D9669 llvm-svn: 238427
* [MC] Replace custom string join function with the one from StringExtras.Benjamin Kramer2015-05-281-22/+2
| | | | | | NFC. llvm-svn: 238414
OpenPOWER on IntegriCloud