[PATCH] D50850: clang: Add triples support for MIPS r6

Simon Atanasyan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 18 13:27:06 PDT 2018


atanasyan added a comment.

Could you add test cases to cover these changes?



================
Comment at: lib/Driver/ToolChains/Arch/Mips.cpp:115
+  if (ABIName.empty() && (Triple.getEnvironment() == llvm::Triple::GNUABIN32))
+    ABIName = "n32";
+
----------------
It looks like this change is unrelated to introducing new target triples and can be made by a separate commit.


================
Comment at: lib/Driver/ToolChains/Gnu.cpp:2068
     BiarchTripleAliases.append(begin(MIPS64Triples), end(MIPS64Triples));
+    BiarchLibDirs.append(begin(MIPSN32LibDirs), end(MIPSN32LibDirs));
+    BiarchTripleAliases.append(begin(MIPSN32Triples), end(MIPSN32Triples));
----------------
Ditto


================
Comment at: lib/Driver/ToolChains/Gnu.cpp:2077
     BiarchTripleAliases.append(begin(MIPS64ELTriples), end(MIPS64ELTriples));
+    BiarchLibDirs.append(begin(MIPSN32ELLibDirs), end(MIPSN32ELLibDirs));
+    BiarchTripleAliases.append(begin(MIPSN32ELTriples), end(MIPSN32ELTriples));
----------------
Ditto


================
Comment at: lib/Driver/ToolChains/Gnu.cpp:2085
     BiarchTripleAliases.append(begin(MIPSTriples), end(MIPSTriples));
+    BiarchLibDirs.append(begin(MIPSN32LibDirs), end(MIPSN32LibDirs));
+    BiarchTripleAliases.append(begin(MIPSN32Triples), end(MIPSN32Triples));
----------------
Ditto


================
Comment at: lib/Driver/ToolChains/Gnu.cpp:2093
     BiarchTripleAliases.append(begin(MIPSELTriples), end(MIPSELTriples));
-    BiarchTripleAliases.append(begin(MIPSTriples), end(MIPSTriples));
+    BiarchLibDirs.append(begin(MIPSN32ELLibDirs), end(MIPSN32ELLibDirs));
+    BiarchTripleAliases.append(begin(MIPSN32ELTriples), end(MIPSN32ELTriples));
----------------
Ditto


================
Comment at: lib/Driver/ToolChains/Gnu.cpp:2437
     if (getTriple().getEnvironment() == llvm::Triple::GNUABI64 ||
-        getTriple().isAndroid() ||
-        getTriple().isOSFreeBSD() ||
+        getTriple().getEnvironment() == llvm::Triple::GNUABIN32 ||
+        getTriple().isAndroid() || getTriple().isOSFreeBSD() ||
----------------
Are you sure that integrated LLVM assembler is ready to support N32 code generation? Anyway this change is for  a separate patch.


================
Comment at: lib/Driver/ToolChains/Linux.cpp:126
       return "mips64-linux-gnu";
-    if (D.getVFS().exists(SysRoot + "/lib/mips64-linux-gnuabi64"))
-      return "mips64-linux-gnuabi64";
+    MipsCpu = (TargetSubArch == llvm::Triple::MipsSubArch_r6) ? "mipsisa64"
+                                                              : "mips64";
----------------
Suppose there are both "/lib/mips64-linux-gnu" and "/lib/mipsisa64-linux-gnuabi64" paths on a disk and provided target triple is mipsisa64-linux-gnuabi64. Is it good that we return "mips64-linux-gnu" from this function anyway?


Repository:
  rC Clang

https://reviews.llvm.org/D50850





More information about the cfe-commits mailing list