OSDN Git Service

MC: Add support for treating $ as a reference to the PC
authorDavid Majnemer <david.majnemer@gmail.com>
Wed, 25 Sep 2013 10:47:21 +0000 (10:47 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Wed, 25 Sep 2013 10:47:21 +0000 (10:47 +0000)
commit3f22cc1df64a6dd6a3ecc5e7e261f15af083f806
tree22cf719d9177fb9d16b1c632e98ba7ed7330f217
parent76f8ae87b4705f5c08c3995948223531715a2d58
MC: Add support for treating $ as a reference to the PC

The binutils assembler supports a mode called DOLLAR_DOT which treats
the dollar sign token as a reference to the current program counter if
the dollar sign doesn't precede a constant or identifier.

This commit adds a new MCAsmInfo flag stating whether or not a given
target supports this interpretation of the dollar sign token; by
default, this flag is not enabled.

Further, enable this flag for PPC. The system assembler for AIX and
binutils both support using the dollar sign in this manner.

This fixes PR17353.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191368 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCAsmInfo.h
lib/MC/MCAsmInfo.cpp
lib/MC/MCParser/AsmParser.cpp
lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp
test/MC/PowerPC/ppc64-operands.s