summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Move all folding to AttemptToFoldSymbolOffsetDifference.Rafael Espindola2010-12-191-50/+44
| | | | llvm-svn: 122160
* Merge isAbsolute into IsSymbolRefDifferenceFullyResolved.Rafael Espindola2010-12-181-5/+4
| | | | llvm-svn: 122148
* Remove the MCObjectFormat class.Rafael Espindola2010-12-181-3/+2
| | | | llvm-svn: 122147
* Add a FIXME and explain a hack.Rafael Espindola2010-12-181-1/+4
| | | | llvm-svn: 122144
* Fix the note.Rafael Espindola2010-12-181-1/+1
| | | | llvm-svn: 122139
* Revert 122011, 122012, 122013, 122023 adding back an important optimization.Rafael Espindola2010-12-181-16/+56
| | | | | | I added a note, but suggestions on how to add a test are really welcome. llvm-svn: 122138
* MC/Expr: Implemnt more aggressive folding during symbol evaluation usingDaniel Dunbar2010-12-171-8/+44
| | | | | | | | | | | | | | | | IsSymbolRefDifferenceFullyResolved(). For example, we will now fold away something like: -- _a: ... L0: ... L1: ... .long (L1 - L0) / 2 -- llvm-svn: 122043
* MC/Expr: Simplify.Daniel Dunbar2010-12-171-8/+0
| | | | llvm-svn: 122023
* MC: Remove another dead MCAssembler argument, and update clients.Daniel Dunbar2010-12-171-21/+1
| | | | llvm-svn: 122013
* MC: Remove dead MCAssembler argument -- Rafael, can you check the FIXME I addedDaniel Dunbar2010-12-171-12/+9
| | | | | | here? llvm-svn: 122012
* MC: Simplify (remove unnecessary MCAssembler argument, obsoleted by containmentDaniel Dunbar2010-12-171-12/+8
| | | | | | in MCAsmLayout). llvm-svn: 122011
* Write => in a more normal form.Daniel Dunbar2010-12-171-1/+2
| | | | llvm-svn: 122009
* MC/Expr: Simplify (and add a FIXME).Daniel Dunbar2010-12-171-10/+16
| | | | llvm-svn: 122008
* MC/Expr: Add a doxyment.Daniel Dunbar2010-12-161-0/+14
| | | | llvm-svn: 121988
* Sorry for such a large commit. The summary is that only MachO cares about theRafael Espindola2010-12-071-20/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Use references to simplify the code a bit.Rafael Espindola2010-12-061-7/+4
| | | | llvm-svn: 121050
* Simplify a bit.Rafael Espindola2010-12-061-1/+1
| | | | llvm-svn: 120980
* Try to resolve symbol differences early, and if successful create a plainRafael Espindola2010-12-031-21/+52
| | | | | | | data fragment. This reduces the time to assemble the test in 8711 from 60s to 54s. llvm-svn: 120767
* Add a fast path to EvaluateSymbolicAdd. This avoids computing symbol addressesRafael Espindola2010-12-021-3/+11
| | | | | | | | which then avoids running EnsureValid. This cuts the assembly time of the testcase in PR8711 from 2:50 minutes to 1 minute. llvm-svn: 120697
* Fix typo.Jim Grosbach2010-11-171-1/+1
| | | | llvm-svn: 119542
* Change MCExpr::EvaluateAsRelocatableImpl of variables to return the originalRafael Espindola2010-11-151-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | variable if recursing fails to simplify it. Factor AliasedSymbol to be a method of MCSymbol. Update MCAssembler::EvaluateFixup to match the change in EvaluateAsRelocatableImpl. Remove the WeakRefExpr hack, as the object writer now sees the weakref with no extra effort needed. Nothing else is using MCTargetExpr, but keep it for now. Now that the ELF writer sees relocations with aliases, handle .weak foo2 foo2: .weak bar2 .set bar2,foo2 .quad bar2 the same way gas does and produce a relocation with bar2. llvm-svn: 119152
* add targetoperand flags for jump tables, constant pool and block addressChris Lattner2010-11-151-4/+15
| | | | | | | | | | | | | | nodes to indicate when ha16/lo16 modifiers should be used. This lets us pass PowerPC/indirectbr.ll. The one annoying thing about this patch is that the MCSymbolExpr isn't expressive enough to represent ha16(label1-label2) which we need on PowerPC. I have a terrible hack in the meantime, but this will have to be revisited at some point. Last major conversion item left is global variable references. llvm-svn: 119105
* reimplement ppc asmprinter "toc" handling to use a VariantKindChris Lattner2010-11-141-1/+2
| | | | | | | | on the operand, required for .o file writing and fixing the PowerPC/mult-alt-generic-powerpc64.ll failure with the new instprinter. llvm-svn: 119087
* Update ARMConstantPoolValue to not use a modifier string. Use an explicitJim Grosbach2010-11-101-1/+11
| | | | | | | VariantKind marker to indicate the additional information necessary. Update MC to handle the new Kinds. rdar://8647623 llvm-svn: 118671
* Implement TLSLD.Rafael Espindola2010-10-281-0/+2
| | | | llvm-svn: 117547
* Implement DTPOFF.Rafael Espindola2010-10-281-0/+2
| | | | llvm-svn: 117546
* Implement TLSLDM.Rafael Espindola2010-10-281-0/+2
| | | | llvm-svn: 117544
* Implement VK_GOTNTPOFF and switch RelocNeedsGOT to use VariantKind.Rafael Espindola2010-10-281-0/+2
| | | | llvm-svn: 117543
* Do not recurse into symbol refs that have a variant kind. This prevents usRafael Espindola2010-10-211-1/+1
| | | | | | from losing the variant when producing a relocation on an alias. llvm-svn: 117037
* Add a MCObjectFormat class so that code common to all targets that use aRafael Espindola2010-10-161-27/+39
| | | | | | | | | | | | single object format can be shared. This also adds support for mov zed+(bar-foo), %eax on ELF and COFF targets. llvm-svn: 116675
* Changes EvaluateAsAbsolute() to return the "current value" of the expressionKevin Enderby2010-09-301-1/+16
| | | | | | | | if we are given a Layout object, even in cases when the value is not fixed. This will be needed by the final patch for the dwarf .loc support to size a new MCDwarf fragment needed to build and emit dwarf line number tables. llvm-svn: 115155
* Add support for ELF PLT references for ARM MC asm printing. Adding aJim Grosbach2010-09-221-3/+6
| | | | | | | | new VariantKind to the MCSymbolExpr seems like overkill, but I'm not sure there's a more straightforward way to get the printing difference captured. (i.e., x86 uses @PLT, ARM uses (PLT)). llvm-svn: 114613
* Convert some tab stops into spaces.Duncan Sands2010-07-121-3/+3
| | | | llvm-svn: 108130
* Start adding mach-o tls reloc support.Eric Christopher2010-05-261-0/+2
| | | | llvm-svn: 104651
* Add support for movi32 of global values to the new (MC) asm printer.Rafael Espindola2010-05-121-1/+9
| | | | llvm-svn: 103576
* MC: Rename MCSymbol::{g,s}etValue -> MCSymbol::{g,s}etVariableValue.Daniel Dunbar2010-05-051-1/+1
| | | | llvm-svn: 103095
* Rip out the 'is temporary' nonsense from the MCContext interface toChris Lattner2010-03-301-6/+0
| | | | | | | | | create symbols. It is extremely error prone and a source of a lot of the remaining integrated assembler bugs on x86-64. This fixes rdar://7807601. llvm-svn: 99902
* MC: Fix refacto in MCExpr evaluation, I mistakenly replaced a fragment ↵Daniel Dunbar2010-03-251-2/+2
| | | | | | | | address with a symbol address. - This fixes the integrated-as nightly test regressions. llvm-svn: 99466
* MC: Direct all {fragment,section,symbol} address access through the ↵Daniel Dunbar2010-03-241-2/+2
| | | | | | MCAsmLayout object. llvm-svn: 99380
* MC: Sprinkle in some more interesting statistics.Daniel Dunbar2010-03-231-0/+10
| | | | llvm-svn: 99350
* llvm-mc: Fast path EvaluateAbsolute of constants.Daniel Dunbar2010-03-231-0/+6
| | | | llvm-svn: 99348
* MCValue: Change to holding MCSymbolRefExprs instead of MCSymbols, we will ↵Daniel Dunbar2010-03-181-20/+24
| | | | | | need this for accessing to symbol modifiers. llvm-svn: 98791
* MC: Allow modifiers in MCSymbolRefExpr, and eliminate X86MCTargetExpr.Daniel Dunbar2010-03-151-5/+51
| | | | | | | - Although it would be nice to allow this decoupling, the assembler needs to be able to reason about MCSymbolRefExprs in too many places to make this viable. We can use a target specific encoding of the variant if this becomes an issue. - This patch also extends llvm-mc to support parsing of the modifiers, as opposed to lumping them in with the symbol. llvm-svn: 98592
* MC: Fix a crash on invalid, attempting to evaluate undefined symbols.Daniel Dunbar2010-03-141-3/+4
| | | | llvm-svn: 98464
* MC: Constify MCAsmLayout argument to MCExpr::EvaluteAs...Daniel Dunbar2010-03-121-2/+3
| | | | llvm-svn: 98380
* MC/Mach-O: Implement "absolutizing" semantics of .set, by evaluating the ↵Daniel Dunbar2010-03-111-2/+20
| | | | | | assembly time value of variables. llvm-svn: 98241
* MC: Sketch initial MCAsmLayout class, which encapsulates the current layout ↵Daniel Dunbar2010-03-111-8/+8
| | | | | | of an assembly file. The MCAsmLayout is also available for use by MCExpr::EvaluateAs{Absolute,Relocatable}, to allow target specific hooks and "absolutizing" of symbols. llvm-svn: 98227
* set the temporary bit on MCSymbols correctly.Chris Lattner2010-03-101-0/+5
| | | | llvm-svn: 98124
* Document that MCExpr::Mod is actually remainder.Dan Gohman2010-02-081-2/+2
| | | | | | | | | | | Document that MCExpr::Div, Mod, and the comparison operators are all signed operators. Document that the comparison operators' results are target-dependent. Document that the behavior of shr is target-dependent. llvm-svn: 95619
* don't make hte dtor private or we can't construct the class.Chris Lattner2010-02-081-1/+1
| | | | llvm-svn: 95587
OpenPOWER on IntegriCloud