[llvm-branch-commits] [clang] c103f9e - [RISCV] Use default member initializers for the feature flags in RISCVTargetInfo. NFC

Craig Topper via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Dec 15 12:42:16 PST 2020


Author: Craig Topper
Date: 2020-12-15T12:37:47-08:00
New Revision: c103f9ef5a0e3180db8c9e94f9cd0b0e2a65375f

URL: https://github.com/llvm/llvm-project/commit/c103f9ef5a0e3180db8c9e94f9cd0b0e2a65375f
DIFF: https://github.com/llvm/llvm-project/commit/c103f9ef5a0e3180db8c9e94f9cd0b0e2a65375f.diff

LOG: [RISCV] Use default member initializers for the feature flags in RISCVTargetInfo. NFC

This avoids having to repeat all the flags in the constructor's
initializer list in the same order. This style is already used by
several other targets.

Added: 
    

Modified: 
    clang/lib/Basic/Targets/RISCV.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/Basic/Targets/RISCV.h b/clang/lib/Basic/Targets/RISCV.h
index 8430407b041e..8407798eb149 100644
--- a/clang/lib/Basic/Targets/RISCV.h
+++ b/clang/lib/Basic/Targets/RISCV.h
@@ -25,19 +25,18 @@ namespace targets {
 class RISCVTargetInfo : public TargetInfo {
 protected:
   std::string ABI, CPU;
-  bool HasM;
-  bool HasA;
-  bool HasF;
-  bool HasD;
-  bool HasC;
-  bool HasB;
-  bool HasV;
-  bool HasZfh;
+  bool HasM = false;
+  bool HasA = false;
+  bool HasF = false;
+  bool HasD = false;
+  bool HasC = false;
+  bool HasB = false;
+  bool HasV = false;
+  bool HasZfh = false;
 
 public:
   RISCVTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
-      : TargetInfo(Triple), HasM(false), HasA(false), HasF(false), HasD(false),
-        HasC(false), HasB(false), HasV(false), HasZfh(false) {
+      : TargetInfo(Triple) {
     LongDoubleWidth = 128;
     LongDoubleAlign = 128;
     LongDoubleFormat = &llvm::APFloat::IEEEquad();


        


More information about the llvm-branch-commits mailing list