[MC] Resolve the difference of symbols in consecutive MCDataFragements
authorJian Cai <caij2003@gmail.com>
Wed, 9 Sep 2020 18:58:22 +0000 (11:58 -0700)
committerJian Cai <caij2003@gmail.com>
Wed, 9 Sep 2020 19:35:43 +0000 (12:35 -0700)
commit415a4fbea7c1a39c780caa3cb7287fe09c5267d2
treeaff155b0802c11885d4c5bbe4348d116f6b9e350
parentad61e346d302eccbc12fdfb81ea1b0cd28e80010
[MC] Resolve the difference of symbols in consecutive MCDataFragements

Try to resolve the difference of two symbols in consecutive MCDataFragments.
This is important for an idiom like "foo:instr; .if . - foo; instr; .endif"
(https://bugs.llvm.org/show_bug.cgi?id=43795).

Reviewed By: nickdesaulniers

Differential Revision: https://reviews.llvm.org/D69411
llvm/include/llvm/MC/MCFragment.h
llvm/lib/MC/MCExpr.cpp
llvm/lib/MC/MCSection.cpp
llvm/test/MC/ARM/directive-if-subtraction.s [new file with mode: 0644]
llvm/test/MC/MachO/reloc-diff.s