[clang] [clang][Mips] Use the ISA features instead of CPU name checks (PR #245672)

Ying Huang via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 26 00:19:21 PST 2026


================
@@ -113,17 +98,16 @@ void MipsTargetInfo::getTargetDefines(const LangOptions &Opts,
 
   // Like GCC, __mips and _MIPS_ISA give the ISA level: 1 to 5 for MIPS I to
   // MIPS V, and 32 or 64 for any revision of MIPS32 or MIPS64.
-  unsigned Level = ISALevel ? ISALevel : (ABI == "o32" ? 32 : 64);
-  Builder.defineMacro("__mips", Twine(Level));
-  Builder.defineMacro("_MIPS_ISA", "_MIPS_ISA_MIPS" + Twine(Level));
+  Builder.defineMacro("__mips", Twine(ISALevel));
+  Builder.defineMacro("_MIPS_ISA", "_MIPS_ISA_MIPS" + Twine(ISALevel));
 
   if (ABI != "o32") {
     Builder.defineMacro("__mips64");
     Builder.defineMacro("__mips64__");
   }
 
   // __mips_isa_rev is only defined for MIPS32 and MIPS64.
----------------
yingopq wrote:

OK, mark this resolve.

https://github.com/llvm/llvm-project/pull/245672


More information about the cfe-commits mailing list