[PATCH] D49539: [mips] Replace custom parsing logic for data directives by the `addAliasForDirective`

Simon Atanasyan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 19 05:05:08 PDT 2018


atanasyan created this revision.
atanasyan added reviewers: smaksimovic, abeserminji, asb, petarj.
Herald added subscribers: jrtc27, arichardson, sdardis.

The target independent AsmParser doesn't recognise .hword, .word, .dword which are required for Mips. Currently MipsAsmParser recognises these through dispatch to MipsAsmParser::parseDataDirective. This contains equivalent logic to AsmParser::parseDirectiveValue. This patch allows reuse of AsmParser::parseDirectiveValue by making use of addAliasForDirective to support .hword, .word and .dword.

Original patch provided by Alex Bradbury at https://reviews.llvm.org/D47001 was modified to fix handling of microMIPS symbols. The `AsmParser::parseDirectiveValue` calls either `EmitIntValue` or `EmitValue`. In this patch we override `EmitIntValue` in the `MipsELFStreamer` to clear a pending set of microMIPS symbols.


Repository:
  rL LLVM

https://reviews.llvm.org/D49539

Files:
  lib/Target/Mips/AsmParser/MipsAsmParser.cpp
  lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp
  lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49539.156236.patch
Type: text/x-patch
Size: 3713 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180719/1cccd77b/attachment.bin>


More information about the llvm-commits mailing list