aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCAssembler.cpp
AgeCommit message (Collapse)AuthorFilesLines
2012-09-18Tidy up. Minor formatting.Jim Grosbach1-3/+2
llvm-svn: 164182
2012-09-14Fix Doxygen issues:Dmitri Gribenko1-1/+1
* wrap code blocks in \code ... \endcode; * refer to parameter names in paragraphs correctly (\arg is not what most people want -- it starts a new paragraph); * use \param instead of \arg to document parameters in order to be consistent with the rest of the codebase. llvm-svn: 163902
2012-09-12Release build: guard dump functions withManman Ren1-1/+1
"#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)" No functional change. Update r163344. llvm-svn: 163679
2012-09-06Release build: guard dump functions with "ifndef NDEBUG"Manman Ren1-0/+2
No functional change. llvm-svn: 163344
2012-08-29Allow targets to specify a minimum supported NOP size when performing NOP ↵Owen Anderson1-0/+6
padding. If the desired padding is smaller than the supported NOP size, we will enlarge the padding to make it work. llvm-svn: 162870
2012-08-08Move [SU]LEB128 encoding to a utility header.Jim Grosbach1-2/+3
These functions are very generic. There's no reason for them to be tied to MCObjectWriter. llvm-svn: 161545
2012-07-23Fix a typo (the the => the)Sylvestre Ledru1-1/+1
llvm-svn: 160621
2012-03-26Prune some includes and forward declarations.Craig Topper1-1/+1
llvm-svn: 153429
2012-02-27ARM BL/BLX instruction fixups should use relocations.Jim Grosbach1-2/+4
We on the linker to resolve calls to the appropriate BL/BLX instruction to make interworking function correctly. It uses the symbol in the relocation to do that, so we need to be careful about being too clever. To enable this for ARM mode, split the BL/BLX fixup kind off from the unconditional-branch fixups. rdar://10927209 llvm-svn: 151571
2012-02-07Convert assert(0) to llvm_unreachableCraig Topper1-8/+4
llvm-svn: 149967
2012-01-27Source information in 'expected relocatable expression' diagnostic.Jim Grosbach1-1/+1
llvm-svn: 149105
2012-01-18Tidy up. MCAsmBackend naming conventions.Jim Grosbach1-5/+5
llvm-svn: 148400
2012-01-18Move some ARM specific MCAssmebler bits into the ARMAsmBackend.Jim Grosbach1-9/+2
llvm-svn: 148364
2011-12-20Unweaken vtables as per ↵David Blaikie1-0/+10
http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146960
2011-12-06Move target-specific logic out of generic MCAssembler.Jim Grosbach1-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. llvm-svn: 145881
2011-12-06Tidy up. Hard tabs.Jim Grosbach1-1/+1
llvm-svn: 145878
2011-12-06Switch MCAssembler to method names starting w/ lower-case.Jim Grosbach1-31/+31
per http://llvm.org/docs/CodingStandards.html#ll_naming llvm-svn: 145873
2011-11-29Better fix for ARM MOVT relocation encoding of thumb bit.Jim Grosbach1-8/+8
Replaces r145318 with a more targetted fix for the relocation handling. llvm-svn: 145346
2011-11-28Thumb2 only force the fixup thumb bit for data relocations.Jim Grosbach1-8/+8
rdar://10493453 llvm-svn: 145318
2011-10-26Trailing whitespace.Jim Grosbach1-2/+2
llvm-svn: 143071
2011-08-24Move TargetRegistry and TargetSelect from Target to Support where they belong.Evan Cheng1-1/+1
These are strictly utilities for registering targets and components. llvm-svn: 138450
2011-07-25Rename TargetAsmBackend to MCAsmBackend; rename createAsmBackend to ↵Evan Cheng1-2/+2
createMCAsmBackend. llvm-svn: 136010
2011-07-23Move TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where ↵Evan Cheng1-1/+1
they belong. llvm-svn: 135833
2011-05-08Don't force relaxation of AdvanceLoc instructions on OS X. gdb is happy withRafael Espindola1-2/+1
the smaller encoding and this cuts 270336 bytes from a release version of clang and 1246272 bytes from a debug build. llvm-svn: 131067
2011-04-29MCAsmLayout: Add support for computing the symbol offset of variables. NotDaniel Dunbar1-0/+27
currently used, because variables don't get reported as being "defined". llvm-svn: 130524
2011-04-28Add a small temporary hack for producing identical eh_frame sections on OS X.Rafael Espindola1-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). llvm-svn: 130379
2011-04-26No relocation produces a SLEB or ULEB, make sure they are handled in MC.Rafael Espindola1-1/+3
llvm-svn: 130181
2011-04-23Remove unused STL header includes.Jay Foad1-1/+0
llvm-svn: 130068
2011-02-16Gas is very inconsistent about when a relaxation/relocation is needed. DoRafael Espindola1-2/+4
the right thing and stop trying to copy it. Fixes PR8944. llvm-svn: 125648
2011-01-23Add support for the --noexecstack option.Rafael Espindola1-1/+1
llvm-svn: 124077
2010-12-28Relax address updates in the eh_frame section.Rafael Espindola1-3/+37
llvm-svn: 122591
2010-12-24Merge IsFixupFullyResolved and IsSymbolRefDifferenceFullyResolved. We nowRafael Espindola1-12/+24
have a single point where targets test if a relocation is needed. llvm-svn: 122549
2010-12-22Assert that the AddrDelta expression is really constant and wrap it in a setRafael Espindola1-1/+3
if we have a lame assembler. llvm-svn: 122446
2010-12-22Use references and simplify.Rafael Espindola1-1/+1
llvm-svn: 122405
2010-12-21Don't relax org or align. They change size as the relaxation happens, but theyRafael Espindola1-42/+27
are not actually relaxed. For example, a section with only alignments will never needs relaxation. llvm-svn: 122356
2010-12-21Layout one section until no relaxations are done and then move to the nextRafael Espindola1-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. llvm-svn: 122314
2010-12-17Thumb's forced-PC-alignment requirement applies to the _total_ displacement, ↵Owen Anderson1-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. llvm-svn: 122091
2010-12-17MC/Assembler: Strip out object writer arguments, now that it is always availableDaniel Dunbar1-49/+36
-- and remove FIXME asking for the same! llvm-svn: 122032
2010-12-17MC/Assembler: Make the MCObjectWriter available through the lifetime of theDaniel Dunbar1-21/+11
assembler. llvm-svn: 122031
2010-12-16MC: Move target specific fixup info descriptors to TargetAsmBackend instead ofDaniel Dunbar1-2/+2
the MCCodeEmitter, which seems like a better organization. - Also, cleaned up some magic constants while in the area. llvm-svn: 121953
2010-12-15Fix typo in r121875.Owen Anderson1-1/+1
llvm-svn: 121880
2010-12-15Implement cleanups suggested by Daniel.Owen Anderson1-7/+11
llvm-svn: 121875
2010-12-15Relax alignment fragments.Rafael Espindola1-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. llvm-svn: 121857
2010-12-15Patch by David Meyer to avoid a O(N^2) behaviour when relaxing fragments.Rafael Espindola1-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. llvm-svn: 121856
2010-12-14ARM Fixups relative to thumb functions need to have the low bit of the valueJim Grosbach1-0/+10
set for interworking to work properly. rdar://8755956 llvm-svn: 121778
2010-12-09Fix an issue in some Thumb fixups, where the effective PC address needs to ↵Owen Anderson1-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. llvm-svn: 121408
2010-12-07Layout each section independently. With the testcase in PR8711:Rafael Espindola1-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 :-) llvm-svn: 121207
2010-12-07Sorry for such a large commit. The summary is that only MachO cares about theRafael Espindola1-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. llvm-svn: 121076
2010-12-06Use references to simplify the code a bit.Rafael Espindola1-3/+3
llvm-svn: 121050
2010-12-06Remove the instruction fragment to data fragment lowering since it was causingRafael Espindola1-98/+38
freed data to be read. I will open a bug to track it being reenabled. llvm-svn: 121028