[PATCH] D101155: [NFC] Delete the redundant member 'shouldEmitMoves' from DwarfCFIException class

Venkata Ramanaiah Nalamothu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 23 04:22:36 PDT 2021


RamNalamothu created this revision.
Herald added a subscriber: hiraditya.
RamNalamothu requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The data member 'shouldEmitMoves' is only used in DwarfCFIException::beginFunction()
and making it local to that function is sufficient.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101155

Files:
  llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfException.h


Index: llvm/lib/CodeGen/AsmPrinter/DwarfException.h
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/DwarfException.h
+++ llvm/lib/CodeGen/AsmPrinter/DwarfException.h
@@ -44,9 +44,6 @@
   /// Per-function flag to indicate if .cfi_lsda should be emitted.
   bool shouldEmitLSDA;
 
-  /// Per-function flag to indicate if frame moves info should be emitted.
-  bool shouldEmitMoves;
-
 public:
   //===--------------------------------------------------------------------===//
   // Main entry points.
Index: llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
+++ llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
@@ -53,8 +53,7 @@
 
 DwarfCFIException::DwarfCFIException(AsmPrinter *A)
     : DwarfCFIExceptionBase(A), shouldEmitPersonality(false),
-      forceEmitPersonality(false), shouldEmitLSDA(false),
-      shouldEmitMoves(false) {}
+      forceEmitPersonality(false), shouldEmitLSDA(false) {}
 
 DwarfCFIException::~DwarfCFIException() {}
 
@@ -87,7 +86,7 @@
 }
 
 void DwarfCFIException::beginFunction(const MachineFunction *MF) {
-  shouldEmitMoves = shouldEmitPersonality = shouldEmitLSDA = false;
+  shouldEmitPersonality = shouldEmitLSDA = false;
   const Function &F = MF->getFunction();
 
   // If any landing pads survive, we need an EH table.
@@ -96,7 +95,7 @@
   // See if we need frame move info.
   AsmPrinter::CFIMoveType MoveType = Asm->needsCFIMoves();
 
-  shouldEmitMoves = MoveType != AsmPrinter::CFI_M_None;
+  bool shouldEmitMoves = MoveType != AsmPrinter::CFI_M_None;
 
   const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
   unsigned PerEncoding = TLOF.getPersonalityEncoding();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101155.339979.patch
Type: text/x-patch
Size: 1796 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210423/5dc6fc5a/attachment.bin>


More information about the llvm-commits mailing list