[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:07:14 PDT 2016
atanasyan 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"
----------------
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;
}
```
================
Comment at: lib/Basic/Targets.cpp:7006
@@ +7005,3 @@
+ MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32;
+ } else if (getTriple().getArch() == llvm::Triple::mips64 ||
+ getTriple().getArch() == llvm::Triple::mips64el) {
----------------
Can we use just `else` here?
http://reviews.llvm.org/D20678
More information about the cfe-commits
mailing list