[PATCH] D110514: MIPS: Triple::setArch as R6 if MipsSubArch_r6

Simon Atanasyan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 12 00:31:06 PDT 2021


atanasyan added a subscriber: MaskRay.
atanasyan added a comment.

- This patch needs test cases. Take a look at `llvm/unittests/ADT/TripleTest.cpp`
- IMHO the current fix is not the best solution. It solves the problem but looks a bit strange. For example, the following code (unusual but correct) stops working. Without the patch it produces a correct "arm-linux-gnu" target triple.

  Triple T("mipsisa32r6-linux-gnu");
  T.setArch(Triple::arm);

It's better to modify `Triple::setArch()` function so it takes two arguments `ArchType` and `SubArchType`. The second argument is `NoSubARch` by default. Then the `setArch()` passes both arguments to the `getArchTypeName()`. We need to teach this function to generate architecture's name in accordance with `ArchType` and `SubArchType` arguments. In this patch we can do it for MIPS only. @MaskRay - what do you think?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110514



More information about the llvm-commits mailing list