llvm-6502/lib
Ulrich Weigand edaa58ee66 [PowerPC] Clean up generation of ha16() / lo16() markers
When targeting the Darwin assembler, we need to generate markers ha16() and
lo16() to designate the high and low parts of a (symbolic) immediate.  This
is necessary not just for plain symbols, but also for certain symbolic
expression, typically along the lines of ha16(A - B).  The latter doesn't
work when simply using VariantKind flags on the symbol reference.
This is why the current back-end uses hacks (explicitly called out as such
via multiple FIXMEs) in the symbolLo/symbolHi print methods.

This patch uses target-defined MCExpr codes to represent the Darwin
ha16/lo16 constructs, following along the lines of the equivalent solution
used by the ARM back end to handle their :upper16: / :lower16: markers.
This allows us to get rid of special handling both in the symbolLo/symbolHi
print method and in the common code MCExpr::print routine.  Instead, the
ha16 / lo16 markers are printed simply in a custom print routine for the
target MCExpr types.  (As a result, the symbolLo/symbolHi print methods
can now replaced by a single printS16ImmOperand routine that also handles
symbolic operands.)

The patch also provides a EvaluateAsRelocatableImpl routine to handle
ha16/lo16 constructs.  This is not actually used at the moment by any
in-tree code, but is provided as it makes merging into David Fang's
out-of-tree Mach-O object writer simpler.

Since there is no longer any need to treat VK_PPC_GAS_HA16 and
VK_PPC_DARWIN_HA16 differently, they are merged into a single
VK_PPC_ADDR16_HA (and likewise for the _LO16 types).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182616 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-23 22:26:41 +00:00
..
Analysis isKnownToBeAPowerOfTwo: (X & Y) + Y is a power of 2 or zero if y is also. 2013-05-18 19:30:37 +00:00
Archive
AsmParser Add ArrayRef constructor from None, and do the cleanups that this constructor enables 2013-05-05 00:40:33 +00:00
Bitcode Micro-optimization: don't shift an entire bitcode record over to get the code. 2013-05-10 22:17:10 +00:00
CodeGen Fix PR16110: Handle DBG_VALUE in ConnectedVNInfoEqClasses::Distribute(). 2013-05-23 17:02:23 +00:00
DebugInfo libDebugInfo depends on libObject nowadays. 2013-05-09 13:48:26 +00:00
ExecutionEngine Expose the RTDyldMemoryManager through the C API. This allows clients of 2013-05-22 02:46:43 +00:00
IR Solidify the assumption that a DW_TAG_subprogram's type is a DW_TAG_subroutine_type 2013-05-22 23:22:18 +00:00
IRReader Measure time that IR parsing took as part of the -time-passes measurement. 2013-04-03 15:33:45 +00:00
Linker Fix a performance bug in the Linker. 2013-05-04 05:05:18 +00:00
MC [PowerPC] Clean up generation of ha16() / lo16() markers 2013-05-23 22:26:41 +00:00
Object Convert obj2yaml to use yamlio. 2013-05-17 22:58:42 +00:00
Option
Support Add cmake bits for md5. 2013-05-21 01:30:38 +00:00
TableGen
Target [PowerPC] Clean up generation of ha16() / lo16() markers 2013-05-23 22:26:41 +00:00
Transforms More symbols that should be static. 2013-05-23 16:09:15 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile