[PATCH] D50557: [clang][mips] Set __mips_fpr correctly for -mfpxx

Simon Atanasyan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 15 22:13:26 PDT 2018


atanasyan added a comment.

Any test cases?



================
Comment at: lib/Basic/Targets/Mips.cpp:62
 
+unsigned MipsTargetInfo::getISARev(const std::string& CPU) const {
+  return llvm::StringSwitch<unsigned>(getCPU())
----------------
The CPU argument looks unused. We can either remove it or make this routine a non-member static function. Probably we can change the CPU’s type to StringRef.


================
Comment at: lib/Basic/Targets/Mips.cpp:97
 
-  const std::string ISARev = llvm::StringSwitch<std::string>(getCPU())
-                                 .Cases("mips32", "mips64", "1")
-                                 .Cases("mips32r2", "mips64r2", "2")
-                                 .Cases("mips32r3", "mips64r3", "3")
-                                 .Cases("mips32r5", "mips64r5", "5")
-                                 .Cases("mips32r6", "mips64r6", "6")
-                                 .Default("");
+  const std::string ISARev = std::to_string(getISARev(getCPU()));
+
----------------
Is this change required for the fix? It looks like a refactoring and maybe done by a separate commit.


================
Comment at: lib/Basic/Targets/Mips.h:61
   bool HasFP64;
+  bool HasFPXX;
   std::string ABI;
----------------
Maybe replace these two boolean flags by a single enumeration. Something like FPXX, FP32, FP64.


https://reviews.llvm.org/D50557





More information about the cfe-commits mailing list