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 [llvm-c][Disassembler] When printing latency information, fall back to the 2013-10-03 17:51:49 +00:00
MCParser Add support for parsing ARM symbol variants on ELF targets 2013-12-04 22:43:20 +00:00
CMakeLists.txt Add a MCAsmInfoELF class and factor some code into it. 2013-10-16 01:34:32 +00:00
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 LLVMBuild: Introduce a common section which currently has a list of the 2011-12-12 22:45:54 +00:00
MachObjectWriter.cpp MachO: Improve backend diagnostic for overalignment. 2013-09-24 23:56:31 +00:00
Makefile
MCAsmBackend.cpp Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]). 2013-07-15 04:27:47 +00:00
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 Move assert above first use of variable that we'd be asserting on. 2013-08-07 18:51:09 +00:00
MCAtom.cpp [weak vtables] Remove a bunch of weak vtables 2013-11-19 00:57:56 +00:00
MCCodeEmitter.cpp
MCCodeGenInfo.cpp Sink codegen optimization level into MCCodeGenInfo along side relocation model 2011-11-16 08:38:26 +00:00
MCContext.cpp Avoid buffer copies when a Twine already is a StringRef. 2013-12-03 18:18:28 +00:00
MCDisassembler.cpp Follow up of the introduction of MCSymbolizer. 2013-05-24 22:51:52 +00:00
MCDwarf.cpp Implements parsing and emitting of .cfi_window_save in MC. 2013-09-26 14:49:40 +00:00
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 Provide basic type safety for array_pod_sort comparators. 2013-09-22 14:09:50 +00:00
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 Style cleanup following David's review for r188876. 2013-08-21 19:40:25 +00:00
MCInst.cpp Release build: guard dump functions with 2012-09-12 05:06:18 +00:00
MCInstPrinter.cpp [MC] When MCInstPrint::printAnnotation uses a comment stream, it has to ensure 2013-10-01 19:21:24 +00:00
MCInstrAnalysis.cpp MC: Disassembled CFG reconstruction. 2013-05-24 01:07:04 +00:00
MCLabel.cpp Release build: guard dump functions with 2012-09-12 05:06:18 +00:00
MCMachObjectTargetWriter.cpp
MCMachOStreamer.cpp Move .ident handling to MCStreamer. 2013-10-16 01:05:45 +00:00
MCModule.cpp MC CFG: Split MCBasicBlocks to mirror atom splitting. 2013-08-21 07:28:24 +00:00
MCModuleYAML.cpp MC CFG: Add YAML MCModule representation to enable MC CFG testing. 2013-08-21 07:29:02 +00:00
MCNullStreamer.cpp Add a MCTargetStreamer interface. 2013-10-08 13:08:17 +00:00
MCObjectDisassembler.cpp Create an atom with just the data that failed to disassemble. 2013-10-16 19:03:14 +00:00
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 Move everything depending on Object/MachOFormat.h over to Support/MachO.h. 2013-09-01 04:28:48 +00:00
MCObjectWriter.cpp Move [SU]LEB128 encoding to a utility header. 2012-08-08 23:56:06 +00:00
MCPureStreamer.cpp Move .ident handling to MCStreamer. 2013-10-16 01:05:45 +00:00
MCRegisterInfo.cpp Make SubRegIndex size mandatory, following r183020. 2013-05-31 23:45:26 +00:00
MCRelocationInfo.cpp Follow up of the introduction of MCSymbolizer. 2013-05-24 22:51:52 +00:00
MCSection.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
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 Add support for subsections to the ELF assembler. Fixes PR8717. 2013-04-17 21:18:16 +00:00
MCStreamer.cpp [weak vtables] Remove a bunch of weak vtables 2013-11-19 00:57:56 +00:00
MCSubtargetInfo.cpp MC: Don't assume incoming StringRef's are null terminated. 2013-10-13 22:09:26 +00:00
MCSymbol.cpp Don't mangle \n and " 2013-11-14 06:05:49 +00:00
MCSymbolizer.cpp Add MCSymbolizer for symbolic/annotated disassembly. 2013-05-24 00:39:57 +00:00
MCValue.cpp Release build: guard dump functions with 2012-09-12 05:06:18 +00:00
MCWin64EH.cpp Fix alignment of unwind data. 2013-09-15 18:01:09 +00:00
SubtargetFeature.cpp MC: Don't assume incoming StringRef's are null terminated. 2013-10-13 22:09:26 +00:00
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