This is an archive of the discontinued LLVM Phabricator instance.

[mips] Fold MipsTargetInfoBase subclasses into MipsTargetInfoBase and rename to MipsTargetInfo. NFC
ClosedPublic

Authored by dsanders on May 26 2016, 6:57 AM.

Details

Summary

This unifies mips/mipsel and mips64/mips64el into a single class so that we can
later support O32 on mips64/mips64el and N32/N64 on mips/mipsel (when an
appropriate CPU selected).

Diff Detail

Repository
rL LLVM

Event Timeline

dsanders updated this revision to Diff 58604.May 26 2016, 6:57 AM
dsanders retitled this revision from to [mips] Fold MipsTargetInfoBase subclasses into MipsTargetInfoBase and rename to MipsTargetInfo. NFC.
dsanders updated this object.
dsanders added subscribers: cfe-commits, atanasyan.
atanasyan added inline comments.May 26 2016, 7:07 AM
lib/Basic/Targets.cpp
6986 ↗(On Diff #58604)

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;
}
7006 ↗(On Diff #58604)

Can we use just else here?

dsanders added inline comments.May 26 2016, 7:41 AM
lib/Basic/Targets.cpp
6986 ↗(On Diff #58604)

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.

7006 ↗(On Diff #58604)

Sure

atanasyan accepted this revision.May 26 2016, 7:44 AM
atanasyan added a reviewer: atanasyan.

LGTM

lib/Basic/Targets.cpp
6986 ↗(On Diff #58604)

Agreed. In that case the separate function is redundant.

This revision is now accepted and ready to land.May 26 2016, 7:44 AM
This revision was automatically updated to reflect the committed changes.