aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/MC
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2013-09-25 10:47:21 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2013-09-25 10:47:21 +0000
commit3f22cc1df64a6dd6a3ecc5e7e261f15af083f806 (patch)
tree22cf719d9177fb9d16b1c632e98ba7ed7330f217 /include/llvm/MC
parent76f8ae87b4705f5c08c3995948223531715a2d58 (diff)
downloadexternal_llvm-3f22cc1df64a6dd6a3ecc5e7e261f15af083f806.zip
external_llvm-3f22cc1df64a6dd6a3ecc5e7e261f15af083f806.tar.gz
external_llvm-3f22cc1df64a6dd6a3ecc5e7e261f15af083f806.tar.bz2
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
Diffstat (limited to 'include/llvm/MC')
-rw-r--r--include/llvm/MC/MCAsmInfo.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/MC/MCAsmInfo.h b/include/llvm/MC/MCAsmInfo.h
index f5acd17..3734d7e 100644
--- a/include/llvm/MC/MCAsmInfo.h
+++ b/include/llvm/MC/MCAsmInfo.h
@@ -93,6 +93,10 @@ namespace llvm {
/// this value. Factored out in .debug_frame and .debug_line.
unsigned MinInstAlignment; // Defaults to 1.
+ /// DollarIsPC - The '$' token, when not referencing an identifier or
+ /// constant, refers to the current PC.
+ bool DollarIsPC; // Defaults to false.
+
/// SeparatorString - This string, if specified, is used to separate
/// instructions from each other when on the same line.
const char *SeparatorString; // Defaults to ';'
@@ -421,6 +425,9 @@ namespace llvm {
unsigned getMinInstAlignment() const {
return MinInstAlignment;
}
+ bool getDollarIsPC() const {
+ return DollarIsPC;
+ }
const char *getSeparatorString() const {
return SeparatorString;
}