summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
...
* Move MCSymbol Value in to the union of Offset and CommonSize.Pete Cooper2015-06-221-0/+4
| | | | | | | | | | | | | | | | This is a reapplication of r239440 which was reverted in r239441. There are no changes to this patch from then, but this had instead exposed a bug in .thumb_set which was fixed in r240318. Having fixed that bug, it is now safe to re-apply this code. Original commit message below: 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: 240320
* Change .thumb_set to have the same error checks as .set.Pete Cooper2015-06-221-70/+106
| | | | | | | | | | | | | | According to the documentation, .thumb_set is 'the equivalent of a .set directive'. We didn't have equivalent behaviour in terms of all the errors we could throw, for example, when a symbol is redefined. This change refactors parseAssignment so that it can be used by .set and .thumb_set and implements tests for .thumb_set for all the errors thrown by that method. Reviewed by Rafael Espíndola. llvm-svn: 240318
* Bring r240130 back.Rafael Espindola2015-06-223-19/+25
| | | | | | | | | | | | | | | | | | | | | | Now that pr23900 is fixed, we can bring it back with no changes. Original message: Make all temporary symbols unnamed. What this does is make all symbols that would otherwise start with a .L (or L on MachO) unnamed. Some of these symbols still show up in the symbol table, but we can just make them unnamed. In order to make sure we produce identical results when going thought assembly, all .L (not just the compiler produced ones), are now unnamed. Running llc on llvm-as.opt.bc, the peak memory usage goes from 208.24MB to 205.57MB. llvm-svn: 240302
* Update ELFObjectWriter::reset() following r238073.Yaron Keren2015-06-201-0/+1
| | | | llvm-svn: 240218
* Revert 240130, it caused crashes (repro in PR23900).Nico Weber2015-06-194-27/+23
| | | | llvm-svn: 240193
* Fix header path in CMake. NFC.Pete Cooper2015-06-191-1/+1
| | | | | | | The ADDITIONAL_HEADER_DIRS command can be used to tell UIs that a given library owns certain headers. The path for MCParser was missing MC/ in it. llvm-svn: 240175
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-1913-18/+18
| | | | | | | | | | | | | The patch is generated using this command: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/ Thanks to Eugene Kosov for the original patch! llvm-svn: 240137
* Make all temporary symbols unnamed.Rafael Espindola2015-06-193-19/+25
| | | | | | | | | | | | | | | | What this does is make all symbols that would otherwise start with a .L (or L on MachO) unnamed. Some of these symbols still show up in the symbol table, but we can just make them unnamed. In order to make sure we produce identical results when going thought assembly, all .L (not just the compiler produced ones), are now unnamed. Running llc on llvm-as.opt.bc, the peak memory usage goes from 208.24MB to 205.57MB. llvm-svn: 240130
* [MC] Adding prettyPrintAsm to MCTargetStreamer to allow targets to ↵Colin LeMahieu2015-06-182-1/+10
| | | | | | specialize how instructions are printed to asm. llvm-svn: 240050
* 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
OpenPOWER on IntegriCloud