[PATCH] D55341: [RISCV, WIP] Support assembling TLS add and associated modifiers

Lewis Revill via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 6 10:02:52 PST 2018


lewis-revill added inline comments.


================
Comment at: lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp:1139
 
+OperandMatchResultTy
+RISCVAsmParser::parseTPRelAddSymbol(OperandVector &Operands) {
----------------
rogfer01 wrote:
> I am a bit curious about this function because it looks very similar to `RISCVAsmParser::parseOperandWithModifier(OperandVector &Operands)`, which ends being used when attempting to parse an immediate that starts with `%`.
> 
> My understanding is that `isTPRelAddSymbol` should filter wrong cases without the need of a custom parser but I think you wanted a more precise diagnostic (as shown in the relevant testcases below)? Is my understanding correct or I am missing other reasons to need a custom parser here?
> 
> Thanks!
Yes, I did pretty much copy the function. I will check just using `isTPRelAddSymbol` with `parseOperandWithModifier` as the parsing method and see if I can get some decent error messages out of it. If non-`%tprel_add` operands are valid as @luismarques suggested might be the case then this would be irrelevant anyway.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55341/new/

https://reviews.llvm.org/D55341





More information about the llvm-commits mailing list