llvm-6502/lib/MC
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
..
MCDisassembler
MCParser Add support for parsing ARM symbol variants on ELF targets 2013-12-04 22:43:20 +00:00
CMakeLists.txt
ELFObjectWriter.cpp Move the STT_FILE symbols out of the normal symbol table processing for 2013-10-29 01:06:17 +00:00
LLVMBuild.txt
MachObjectWriter.cpp
Makefile
MCAsmBackend.cpp
MCAsmInfo.cpp Add support for parsing ARM symbol variants on ELF targets 2013-12-04 22:43:20 +00:00
MCAsmInfoCOFF.cpp Refactor the setting of PrivateGlobalPrefix. 2013-12-02 23:39:26 +00:00
MCAsmInfoDarwin.cpp Refactor the setting of PrivateGlobalPrefix. 2013-12-02 23:39:26 +00:00
MCAsmInfoELF.cpp Refactor the setting of PrivateGlobalPrefix. 2013-12-02 23:39:26 +00:00
MCAsmStreamer.cpp MCStreamer: Reimplement the virtual EmitRawText as a protected member, EmitRawTextImpl, to avoid string literal ambiguities 2013-10-24 22:43:10 +00:00
MCAssembler.cpp
MCAtom.cpp [weak vtables] Remove a bunch of weak vtables 2013-11-19 00:57:56 +00:00
MCCodeEmitter.cpp
MCCodeGenInfo.cpp
MCContext.cpp Avoid buffer copies when a Twine already is a StringRef. 2013-12-03 18:18:28 +00:00
MCDisassembler.cpp
MCDwarf.cpp
MCELF.cpp Move the STT_FILE symbols out of the normal symbol table processing for 2013-10-29 01:06:17 +00:00
MCELFObjectTargetWriter.cpp
MCELFStreamer.cpp Add support for parsing ARM symbol variants on ELF targets 2013-12-04 22:43:20 +00:00
MCExpr.cpp Add support for parsing ARM symbol variants on ELF targets 2013-12-04 22:43:20 +00:00
MCExternalSymbolizer.cpp Add to the disassembler C API output reference types for 2013-11-01 00:00:07 +00:00
MCFunction.cpp
MCInst.cpp
MCInstPrinter.cpp
MCInstrAnalysis.cpp
MCLabel.cpp
MCMachObjectTargetWriter.cpp
MCMachOStreamer.cpp
MCModule.cpp
MCModuleYAML.cpp
MCNullStreamer.cpp
MCObjectDisassembler.cpp
MCObjectFileInfo.cpp Add a method to get the object-file appropriate stack map section. 2013-11-08 22:14:49 +00:00
MCObjectStreamer.cpp Emit DWARF line entries for all data in the instruction stream. 2013-10-20 02:16:18 +00:00
MCObjectSymbolizer.cpp
MCObjectWriter.cpp
MCPureStreamer.cpp
MCRegisterInfo.cpp
MCRelocationInfo.cpp
MCSection.cpp
MCSectionCOFF.cpp Use simple section names for COMDAT sections on COFF. 2013-11-27 01:18:37 +00:00
MCSectionELF.cpp Remove AllowQuotesInName and friends from MCAsmInfo. 2013-11-13 14:01:59 +00:00
MCSectionMachO.cpp
MCStreamer.cpp [weak vtables] Remove a bunch of weak vtables 2013-11-19 00:57:56 +00:00
MCSubtargetInfo.cpp
MCSymbol.cpp Don't mangle \n and " 2013-11-14 06:05:49 +00:00
MCSymbolizer.cpp
MCValue.cpp
MCWin64EH.cpp
SubtargetFeature.cpp
WinCOFFObjectWriter.cpp Fix a funny typo. 2013-12-04 02:26:54 +00:00
WinCOFFStreamer.cpp Output .eh_frames on COFF too now that the integrated as is used on mingw. 2013-12-02 14:59:34 +00:00