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

Simon Atanasyan via cfe-commits cfe-commits at lists.llvm.org
Thu May 26 07:44:06 PDT 2016


atanasyan accepted this revision.
atanasyan added a reviewer: atanasyan.
atanasyan added a comment.
This revision is now accepted and ready to land.

LGTM


================
Comment at: lib/Basic/Targets.cpp:6986
@@ +6985,3 @@
+      : TargetInfo(Triple), CPU((getTriple().getArch() == llvm::Triple::mips ||
+                                 getTriple().getArch() == llvm::Triple::mipsel)
+                                    ? "mips32r2"
----------------
dsanders wrote:
> 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.
Agreed. In that case the separate function is redundant.


http://reviews.llvm.org/D20678





More information about the cfe-commits mailing list