diff options
| author | Simon Atanasyan <simon@atanasyan.com> | 2018-07-25 07:07:43 +0000 |
|---|---|---|
| committer | Simon Atanasyan <simon@atanasyan.com> | 2018-07-25 07:07:43 +0000 |
| commit | b5244592882f296097bcd5508630b73311d0ddde (patch) | |
| tree | a5a4a22d0466ba76dcc8202f37313c80cd97e8ab /llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h | |
| parent | 4eab1ba6196b9d5dd8b5980d076e52b0672cb3bd (diff) | |
| download | bcm5719-llvm-b5244592882f296097bcd5508630b73311d0ddde.tar.gz bcm5719-llvm-b5244592882f296097bcd5508630b73311d0ddde.zip | |
[mips] Replace custom parsing logic for data directives by the `addAliasForDirective`
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 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.
Differential revision: https://reviews.llvm.org/D49539
llvm-svn: 337893
Diffstat (limited to 'llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h')
| -rw-r--r-- | llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h b/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h index 8ffca340193..d141f5d77c6 100644 --- a/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h +++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h @@ -54,9 +54,11 @@ public: void SwitchSection(MCSection *Section, const MCExpr *Subsection = nullptr) override; - /// Overriding this function allows us to dismiss all labels that are - /// candidates for marking as microMIPS when .word directive is emitted. + /// Overriding these functions allows us to dismiss all labels that are + /// candidates for marking as microMIPS when .word/.long/.4byte etc + /// directives are emitted. void EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) override; + void EmitIntValue(uint64_t Value, unsigned Size) override; /// Emits all the option records stored up until the point it's called. void EmitMipsOptionRecords(); |

