llvm/lib
Daniel Sanders 007417372d [mips][ias] Fix all the hacks related to MIPS-specific unary operators (%hi/%lo/%gp_rel/etc.).
Summary:
They are now lexed as a single token on targets where
MCAsmInfo::HasMipsExpressions is true and then parsed in a similar way to
the '~' operator as part of MCExpr::parseExpression.

As a result:
* expressions and immediates no longer have different parsing rules. The
  difference is now solely down to whether evaluateAsAbsolute() succeeds.
* %hi(%neg(%gp_rel(x))) are no longer parsed as a single operator and
  decomposed into the three MipsMCExpr nodes. They are parsed directly as
  three MipsMCExpr nodes.
  * parseMemOperand no longer needs to eat all the surrounding parenthesis
    to get at the outermost operator to make this work
* %hi(%neg(%gp_rel(x))) and %lo(%neg(%gp_rel(x))) are no longer the only
  3-in-1 relocs that parse for N64. They're still the only combinations that
  are permitted in relocatable expressions though. Fixing that should be a
  later patch.
* We no longer need to list all the tokens that can occur as the first token of
  an expression or immediate.

test/MC/Mips/expr1.s:
    This change also prevents the incorrect lowering of %lo(2*4)+foo to
    %lo(8+foo) which is not an equivalent expression (the difference is
    whether foo is truncated to 16-bit or not) and the test has been
    updated to account for the macro expansion the correct expression requires.

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

Differential Revision: https://reviews.llvm.org/D23110

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277988 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-08 09:20:52 +00:00
..
Analysis [JumpThreading] Fix handling of aliasing metadata. 2016-08-08 04:10:22 +00:00
AsmParser LLLexer.cpp: Avoid using BitsToDouble() to preserve SNaN like "double 0x7FF4000000000000". 2016-08-05 11:59:49 +00:00
Bitcode [ThinLTO] Address review comments from PGO indirect call promotion (NFC) 2016-07-18 18:31:50 +00:00
CodeGen [SelectionDAG] Refactor visitInlineAsm a bit. NFCI. 2016-08-08 08:54:39 +00:00
DebugInfo CodeView: Remove an unused variable 2016-08-05 21:57:10 +00:00
ExecutionEngine [ExecutionEngine][RuntimeDyld] Move JITSymbol from ExecutionEngine to RuntimeDyld. 2016-08-07 01:19:37 +00:00
Fuzzer [libFuzzer] make libFuzzer work with a bit older clang versions 2016-08-06 21:28:56 +00:00
IR Move helpers into anonymous namespaces. NFC. 2016-08-06 11:13:10 +00:00
IRReader Remove autoconf support 2016-01-26 21:29:08 +00:00
LibDriver Object: Replace NewArchiveIterator with a simpler NewArchiveMember class. NFCI. 2016-06-29 22:27:42 +00:00
LineEditor Fix Clang-tidy modernize-deprecated-headers warnings in some files; other minor fixes. 2016-03-28 17:40:08 +00:00
Linker IR: New representation for CFI and virtual call optimization pass metadata. 2016-06-24 21:21:32 +00:00
LTO Move legacy LTO interface headers to legacy/ directory. 2016-07-14 21:21:16 +00:00
MC [mips][ias] Fix all the hacks related to MIPS-specific unary operators (%hi/%lo/%gp_rel/etc.). 2016-08-08 09:20:52 +00:00
Object Add the first of what will be a long line of additional error checks for invalid Mach-O files. 2016-08-05 18:19:40 +00:00
ObjectYAML BPF: Use official ELF e_machine value 2016-07-15 22:27:55 +00:00
Option Option parser: class for consuming a joined arg in addition to all remaining args 2016-04-15 00:23:30 +00:00
Passes [PM] Change the name of the repeating utility to something less 2016-08-04 03:52:53 +00:00
ProfileData [PGO] Make needsComdatForCounter() available (NFC) 2016-07-21 20:50:02 +00:00
Support Add unittests to {ARM | AArch64}TargetParser. 2016-07-28 06:11:18 +00:00
TableGen [TableGen] Autobrief-ize Record. NFC. 2016-07-14 14:53:14 +00:00
Target [mips][ias] Fix all the hacks related to MIPS-specific unary operators (%hi/%lo/%gp_rel/etc.). 2016-08-08 09:20:52 +00:00
Transforms Add some comments linking back to PR28400. 2016-08-08 07:03:49 +00:00
CMakeLists.txt Move ObjectYAML code to a new library. 2016-03-01 19:15:06 +00:00
LLVMBuild.txt Add LLVMBuild for ObjectYAML. 2016-03-01 21:29:33 +00:00