llvm-6502/lib/MC/MCParser
David Peixotto 0fc8c68b11 Add support for parsing ARM symbol variants on ELF targets
ARM symbol variants are written with parens instead of @ like this:

  .word __GLOBAL_I_a(target1)

This commit adds support for parsing these symbol variants in
expressions. We introduce a new flag to MCAsmInfo that indicates the
parser should use parens to parse the symbol variant. The expression
parser is modified to look for symbol variants using parens instead
of @ when the corresponding MCAsmInfo flag is true.

The MCAsmInfo parens flag is enabled only for ARM on ELF.

By adding this flag to MCAsmInfo, we are able to get rid of
redundant ARM-specific symbol variants and use the generic variants
instead (e.g. VK_GOT instead of VK_ARM_GOT). We use the new
UseParensForSymbolVariant attribute in MCAsmInfo to correctly print
the symbol variants for arm.

To achive this we need to keep a handle to the MCAsmInfo in the
MCSymbolRefExpr class that we can check when printing the symbol
variant.

Updated Tests:
  Changed case of symbol variant to match the generic kind.
  test/CodeGen/ARM/tls-models.ll
  test/CodeGen/ARM/tls1.ll
  test/CodeGen/ARM/tls2.ll
  test/CodeGen/Thumb2/tls1.ll
  test/CodeGen/Thumb2/tls2.ll

PR18080


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196424 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04 22:43:20 +00:00
..
AsmLexer.cpp MC asm parser: allow ?'s in symbol names, and handle @'s in names in MS asm 2013-10-18 20:46:28 +00:00
AsmParser.cpp Add support for parsing ARM symbol variants on ELF targets 2013-12-04 22:43:20 +00:00
CMakeLists.txt build/CMake: Finish removal of add_llvm_library_dependencies. 2011-11-29 19:25:30 +00:00
COFFAsmParser.cpp Support multiple COFF sections with the same name but different COMDAT. 2013-11-19 19:52:52 +00:00
DarwinAsmParser.cpp Add Support For .bss Named Section Directive For Darwin Targets. 2013-10-02 14:09:29 +00:00
ELFAsmParser.cpp Move .ident handling to MCStreamer. 2013-10-16 01:05:45 +00:00
LLVMBuild.txt LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
Makefile
MCAsmLexer.cpp Change SMRange to be half-open (exclusive end) instead of closed (inclusive) 2013-01-07 19:00:49 +00:00
MCAsmParser.cpp MCParser: Update method names per coding guidelines. 2013-02-20 22:21:35 +00:00
MCAsmParserExtension.cpp
MCTargetAsmParser.cpp [ms-inline asm] Add the isParsingInlineAsm() function to the MCAsmTargetParser. 2012-10-19 17:57:49 +00:00