[PATCH] D151538: [CodeGen][NFC] Declare copy constructor & copy assignment as deleted for ScheduleDAG

Kan Shengchen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 26 18:36:30 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGa919a3a1e739: [CodeGen][NFC] Declare copy constructor & copy assignment as deleted for… (authored by skan).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151538/new/

https://reviews.llvm.org/D151538

Files:
  llvm/include/llvm/CodeGen/ScheduleDAG.h


Index: llvm/include/llvm/CodeGen/ScheduleDAG.h
===================================================================
--- llvm/include/llvm/CodeGen/ScheduleDAG.h
+++ llvm/include/llvm/CodeGen/ScheduleDAG.h
@@ -568,6 +568,15 @@
     bool StressSched;
 #endif
 
+    // This class is designed to be passed by reference only. Copy constructor
+    // is declared as deleted here to make the derived classes have deleted
+    // implicit-declared copy constructor, which suppresses the warnings from
+    // static analyzer when the derived classes own resources that are freed in
+    // their destructors, but don't have user-written copy constructors (rule
+    // of three).
+    ScheduleDAG(const ScheduleDAG &) = delete;
+    ScheduleDAG &operator=(const ScheduleDAG &) = delete;
+
     explicit ScheduleDAG(MachineFunction &mf);
 
     virtual ~ScheduleDAG();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151538.526232.patch
Type: text/x-patch
Size: 860 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230527/3b5272eb/attachment-0001.bin>


More information about the llvm-commits mailing list