[llvm] 0812cde - NFC: Make isPPC64 const and use member initializer

Hubert Tong via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 1 17:41:30 PDT 2024


Author: Hubert Tong
Date: 2024-11-01T20:41:25-04:00
New Revision: 0812cde3bfa3ec5cde213a3de8fd36d3afab4049

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

LOG: NFC: Make isPPC64 const and use member initializer

Added: 
    

Modified: 
    llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp b/llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
index bf512481cf6460..abb6bd31c9c599 100644
--- a/llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
+++ b/llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
@@ -97,7 +97,7 @@ namespace {
 struct PPCOperand;
 
 class PPCAsmParser : public MCTargetAsmParser {
-  bool IsPPC64;
+  const bool IsPPC64;
 
   void Warning(SMLoc L, const Twine &Msg) { getParser().Warning(L, Msg); }
 
@@ -142,10 +142,8 @@ class PPCAsmParser : public MCTargetAsmParser {
 public:
   PPCAsmParser(const MCSubtargetInfo &STI, MCAsmParser &,
                const MCInstrInfo &MII, const MCTargetOptions &Options)
-    : MCTargetAsmParser(Options, STI, MII) {
-    // Check for 64-bit vs. 32-bit pointer mode.
-    const Triple &TheTriple = STI.getTargetTriple();
-    IsPPC64 = TheTriple.isPPC64();
+      : MCTargetAsmParser(Options, STI, MII),
+        IsPPC64(STI.getTargetTriple().isPPC64()) {
     // Initialize the set of available features.
     setAvailableFeatures(ComputeAvailableFeatures(STI.getFeatureBits()));
   }


        


More information about the llvm-commits mailing list