[llvm] 70b182e - [MCParser] Modernize IntelExpr (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 16 10:19:08 PDT 2023


Author: Kazu Hirata
Date: 2023-04-16T10:18:57-07:00
New Revision: 70b182e0d3f71bd1f9ac8b85e3983f7289150994

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

LOG: [MCParser] Modernize IntelExpr (NFC)

Identified with readability-redundant-member-init.

Added: 
    

Modified: 
    llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h b/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h
index 054669c9f45ed..4f3ce8c74d860 100644
--- a/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h
+++ b/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h
@@ -60,19 +60,17 @@ const char AsmRewritePrecedence [] = {
   2  // AOK_IntelExpr
 };
 
-// Represnt the various parts which makes up an intel expression,
+// Represent the various parts which make up an intel expression,
 // used for emitting compound intel expressions
 struct IntelExpr {
-  bool NeedBracs;
-  int64_t Imm;
+  bool NeedBracs = false;
+  int64_t Imm = 0;
   StringRef BaseReg;
   StringRef IndexReg;
   StringRef OffsetName;
-  unsigned Scale;
+  unsigned Scale = 1;
 
-  IntelExpr()
-      : NeedBracs(false), Imm(0), BaseReg(StringRef()), IndexReg(StringRef()),
-        OffsetName(StringRef()), Scale(1) {}
+  IntelExpr() = default;
   // [BaseReg + IndexReg * ScaleExpression + OFFSET name + ImmediateExpression]
   IntelExpr(StringRef baseReg, StringRef indexReg, unsigned scale,
             StringRef offsetName, int64_t imm, bool needBracs)


        


More information about the llvm-commits mailing list