[PATCH] D20678: [mips] Fold MipsTargetInfoBase subclasses into MipsTargetInfoBase and rename to MipsTargetInfo. NFC

Daniel Sanders via cfe-commits cfe-commits at lists.llvm.org
Thu May 26 07:41:53 PDT 2016


dsanders added inline comments.

================
Comment at: lib/Basic/Targets.cpp:6986
@@ +6985,3 @@
+      : TargetInfo(Triple), CPU((getTriple().getArch() == llvm::Triple::mips ||
+                                 getTriple().getArch() == llvm::Triple::mipsel)
+                                    ? "mips32r2"
----------------
atanasyan wrote:
> What do you think about creation a static function and using it to simplify this and similar conditions?
> 
> ```
> static bool is32BitTriple(const llvm::Triple &Triple) {
>   return Triple.getArch() == llvm::Triple::mips || Triple.getArch() == llvm::Triple::mipsel;
> }
> ```
I'm happy to add one if you want it but I'm currently finishing a patch that removes most of them in favour of ABI checks. The only one I think should remain as an Arch check is the one for MipsTargetInfo::ABI. Even that one is incorrect on our buildbots which detect as mips64-linux-gnu but should default to O32.

================
Comment at: lib/Basic/Targets.cpp:7006
@@ +7005,3 @@
+      MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32;
+    } else if (getTriple().getArch() == llvm::Triple::mips64 ||
+               getTriple().getArch() == llvm::Triple::mips64el) {
----------------
atanasyan wrote:
> Can we use just `else` here?
Sure


http://reviews.llvm.org/D20678





More information about the cfe-commits mailing list