aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC/MCAssembler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Convert assert(0) to llvm_unreachableCraig Topper2012-02-071-8/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149967 91177308-0d34-0410-b5e6-96231b3b80d8
* Source information in 'expected relocatable expression' diagnostic.Jim Grosbach2012-01-271-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149105 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up. MCAsmBackend naming conventions.Jim Grosbach2012-01-181-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148400 91177308-0d34-0410-b5e6-96231b3b80d8
* Move some ARM specific MCAssmebler bits into the ARMAsmBackend.Jim Grosbach2012-01-181-9/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148364 91177308-0d34-0410-b5e6-96231b3b80d8
* Unweaken vtables as per ↵David Blaikie2011-12-201-0/+10
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146960 91177308-0d34-0410-b5e6-96231b3b80d8
* Move target-specific logic out of generic MCAssembler.Jim Grosbach2011-12-061-5/+2
| | | | | | | | Whether a fixup needs relaxation for the associated instruction is a target-specific function, as the FIXME indicated. Create a hook for that and use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145881 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up. Hard tabs.Jim Grosbach2011-12-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145878 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch MCAssembler to method names starting w/ lower-case.Jim Grosbach2011-12-061-31/+31
| | | | | | per http://llvm.org/docs/CodingStandards.html#ll_naming git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145873 91177308-0d34-0410-b5e6-96231b3b80d8
* Better fix for ARM MOVT relocation encoding of thumb bit.Jim Grosbach2011-11-291-8/+8
| | | | | | Replaces r145318 with a more targetted fix for the relocation handling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145346 91177308-0d34-0410-b5e6-96231b3b80d8
* Thumb2 only force the fixup thumb bit for data relocations.Jim Grosbach2011-11-281-8/+8
| | | | | | rdar://10493453 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145318 91177308-0d34-0410-b5e6-96231b3b80d8
* Trailing whitespace.Jim Grosbach2011-10-261-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143071 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TargetRegistry and TargetSelect from Target to Support where they belong.Evan Cheng2011-08-241-1/+1
| | | | | | | These are strictly utilities for registering targets and components. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138450 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename TargetAsmBackend to MCAsmBackend; rename createAsmBackend to ↵Evan Cheng2011-07-251-2/+2
| | | | | | createMCAsmBackend. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136010 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where ↵Evan Cheng2011-07-231-1/+1
| | | | | | they belong. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135833 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't force relaxation of AdvanceLoc instructions on OS X. gdb is happy withRafael Espindola2011-05-081-2/+1
| | | | | | | the smaller encoding and this cuts 270336 bytes from a release version of clang and 1246272 bytes from a debug build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131067 91177308-0d34-0410-b5e6-96231b3b80d8
* MCAsmLayout: Add support for computing the symbol offset of variables. NotDaniel Dunbar2011-04-291-0/+27
| | | | | | currently used, because variables don't get reported as being "defined". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130524 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a small temporary hack for producing identical eh_frame sections on OS X.Rafael Espindola2011-04-281-1/+2
| | | | | | | This removes one of the main advantages of moving eh_frame to MC, but makes the transition a lot easier to debug (run md5). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130379 91177308-0d34-0410-b5e6-96231b3b80d8
* No relocation produces a SLEB or ULEB, make sure they are handled in MC.Rafael Espindola2011-04-261-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130181 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused STL header includes.Jay Foad2011-04-231-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130068 91177308-0d34-0410-b5e6-96231b3b80d8
* Gas is very inconsistent about when a relaxation/relocation is needed. DoRafael Espindola2011-02-161-2/+4
| | | | | | the right thing and stop trying to copy it. Fixes PR8944. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125648 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for the --noexecstack option.Rafael Espindola2011-01-231-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124077 91177308-0d34-0410-b5e6-96231b3b80d8
* Relax address updates in the eh_frame section.Rafael Espindola2010-12-281-3/+37
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122591 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge IsFixupFullyResolved and IsSymbolRefDifferenceFullyResolved. We nowRafael Espindola2010-12-241-12/+24
| | | | | | have a single point where targets test if a relocation is needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122549 91177308-0d34-0410-b5e6-96231b3b80d8
* Assert that the AddrDelta expression is really constant and wrap it in a setRafael Espindola2010-12-221-1/+3
| | | | | | if we have a lame assembler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122446 91177308-0d34-0410-b5e6-96231b3b80d8
* Use references and simplify.Rafael Espindola2010-12-221-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122405 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't relax org or align. They change size as the relaxation happens, but theyRafael Espindola2010-12-211-42/+27
| | | | | | | are not actually relaxed. For example, a section with only alignments will never needs relaxation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122356 91177308-0d34-0410-b5e6-96231b3b80d8
* Layout one section until no relaxations are done and then move to the nextRafael Espindola2010-12-211-34/+41
| | | | | | | | | | section. This helps because in practice sections form a dag with debug sections pointing to text sections. Finishing up the text sections first makes the debug section relaxation trivial. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122314 91177308-0d34-0410-b5e6-96231b3b80d8
* Thumb's forced-PC-alignment requirement applies to the _total_ displacement, ↵Owen Anderson2010-12-171-2/+2
| | | | | | | | | | not just to the fragment relative portion. While the fragment boundary is usually already aligned, it is possible for it not to be, which would lead to a non-aligned final displacement. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122091 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Assembler: Strip out object writer arguments, now that it is always availableDaniel Dunbar2010-12-171-49/+36
| | | | | | -- and remove FIXME asking for the same! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122032 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Assembler: Make the MCObjectWriter available through the lifetime of theDaniel Dunbar2010-12-171-21/+11
| | | | | | assembler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122031 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Move target specific fixup info descriptors to TargetAsmBackend instead ofDaniel Dunbar2010-12-161-2/+2
| | | | | | | the MCCodeEmitter, which seems like a better organization. - Also, cleaned up some magic constants while in the area. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121953 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo in r121875.Owen Anderson2010-12-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121880 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement cleanups suggested by Daniel.Owen Anderson2010-12-151-7/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121875 91177308-0d34-0410-b5e6-96231b3b80d8
* Relax alignment fragments.Rafael Espindola2010-12-151-29/+26
| | | | | | | | | | | With this we don't need the EffectiveSize field anymore. Without that field LayoutFragment only updates offsets and we don't need to invalidate the current fragment when it is relaxed (only the ones following it). This is also a very small improvement in the accuracy of the layout info as we now use the after relaxation size immediately. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121857 91177308-0d34-0410-b5e6-96231b3b80d8
* Patch by David Meyer to avoid a O(N^2) behaviour when relaxing fragments.Rafael Espindola2010-12-151-2/+5
| | | | | | | Since we now don't update addresses so early, we might relax a bit more than we need to. This is simillar to the issue in PR8467. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121856 91177308-0d34-0410-b5e6-96231b3b80d8
* ARM Fixups relative to thumb functions need to have the low bit of the valueJim Grosbach2010-12-141-0/+10
| | | | | | set for interworking to work properly. rdar://8755956 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121778 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an issue in some Thumb fixups, where the effective PC address needs to ↵Owen Anderson2010-12-091-2/+9
| | | | | | | | | | | be 4-byte aligned when calculating the offset. Add a new fixup flag to represent this, and use it for the one fixups that I have a testcase for needing this. It's quite likely that the other Thumb fixups will need this too, and to have their fixup encoding logic adjusted accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121408 91177308-0d34-0410-b5e6-96231b3b80d8
* Layout each section independently. With the testcase in PR8711:Rafael Espindola2010-12-071-58/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | before: 4 assembler - Number of assembler layout and relaxation steps 78563 assembler - Number of emitted assembler fragments 8693904 assembler - Number of emitted object file bytes 271223 assembler - Number of evaluated fixups 330771677 assembler - Number of fragment layouts 5958 assembler - Number of relaxed instructions 2508361 mcexpr - Number of MCExpr evaluations real 0m26.123s user 0m25.694s sys 0m0.388s after: 4 assembler - Number of assembler layout and relaxation steps 78563 assembler - Number of emitted assembler fragments 8693904 assembler - Number of emitted object file bytes 271223 assembler - Number of evaluated fixups 231507 assembler - Number of fragment layouts 5958 assembler - Number of relaxed instructions 2508361 mcexpr - Number of MCExpr evaluations real 0m2.500s user 0m2.113s sys 0m0.273s And yes, the outputs are identical :-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121207 91177308-0d34-0410-b5e6-96231b3b80d8
* Sorry for such a large commit. The summary is that only MachO cares about theRafael Espindola2010-12-071-107/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | actuall addresses in a .o file, so it is better to let the MachO writer compute it. This is good for two reasons. First, areas that shouldn't care about addresses now don't have access to it. Second, the layout of each section is independent. I should use this in a subsequent commit to speed it up. Most of the patch is just removing the section address computation. The two interesting parts are the change on how we handle padding in the end of sections and how MachO can get the address of a-b when a and b are in different sections. Since now the expression evaluation normally doesn't know the section address, it will think that a-b needs relocation and let the MachO writer know. Once it has computed the section addresses, it calls back the expression evaluation with the section addresses to resolve these expressions. The remaining problem is the handling of padding. Currently it will create a special alignment fragment at the end. Since that fragment doesn't update the alignment of the section, it needs the real address to be computed. Since now the layout will not compute a-b with a and b in different sections, the only effect that the special alignment fragment has is update the address size of the section. This can also be done by the MachO writer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121076 91177308-0d34-0410-b5e6-96231b3b80d8
* Use references to simplify the code a bit.Rafael Espindola2010-12-061-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121050 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the instruction fragment to data fragment lowering since it was causingRafael Espindola2010-12-061-98/+38
| | | | | | freed data to be read. I will open a bug to track it being reenabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121028 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the getAddress getter, initialize Ordinal in the constructor and useRafael Espindola2010-12-061-0/+1
| | | | | | that on the ELF writer to detect a section we created. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120981 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a getSymbolOffset method and use it in the ELF writer.Rafael Espindola2010-12-061-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120977 91177308-0d34-0410-b5e6-96231b3b80d8
* Once the layout is done we don't need to keep updating which fragments areRafael Espindola2010-12-041-13/+5
| | | | | | valid. Addresses will not change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120921 91177308-0d34-0410-b5e6-96231b3b80d8
* Remember the contents of leb and dwarfline fragments when relaxing. This avoidsRafael Espindola2010-12-041-35/+19
| | | | | | having to evaluate the expression again when writing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120920 91177308-0d34-0410-b5e6-96231b3b80d8
* The sections that the ELF object writer has to create are very simple andRafael Espindola2010-12-021-20/+0
| | | | | | | | contain only data. Handle them specially instead of using AddSectionToTheEnd. This moves a hack from the generic assembler to the elf writer. It is also a bit faster and should make other improvements easier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120683 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused argument.Rafael Espindola2010-12-011-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120621 91177308-0d34-0410-b5e6-96231b3b80d8
* Invalidate the layout on any relaxation, not just Instructions. Bug found by ↵Rafael Espindola2010-11-231-9/+11
| | | | | | | | David Meyer. While here, remove unused argument and rename UpdateForSlide to Invalidate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120009 91177308-0d34-0410-b5e6-96231b3b80d8
* Reuse data fragments while lowering. Patch by David Meyer.Rafael Espindola2010-11-231-26/+77
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119999 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an assert.Rafael Espindola2010-11-191-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119788 91177308-0d34-0410-b5e6-96231b3b80d8