[llvm] ec235dd - [JITLink] Delete copy and move constructors for jitlink::Section.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 30 22:58:42 PDT 2021


Author: Lang Hames
Date: 2021-03-30T22:58:14-07:00
New Revision: ec235dd3556d9879b0ec58ebd6009904d0ef0d24

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

LOG: [JITLink] Delete copy and move constructors for jitlink::Section.

Sections are not movable or copyable.

Added: 
    

Modified: 
    llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
    llvm/unittests/ExecutionEngine/JITLink/LinkGraphTests.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
index 646cc4ce4a1f..f25bad6a3bfb 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
@@ -590,6 +590,12 @@ class Section {
 
   ~Section();
 
+  // Sections are not movable or copyable.
+  Section(const Section &) = delete;
+  Section &operator=(const Section &) = delete;
+  Section(Section &&) = delete;
+  Section &operator=(Section &&) = delete;
+
   /// Returns the name of this section.
   StringRef getName() const { return Name; }
 

diff  --git a/llvm/unittests/ExecutionEngine/JITLink/LinkGraphTests.cpp b/llvm/unittests/ExecutionEngine/JITLink/LinkGraphTests.cpp
index a60a04e9c910..4685193e53ea 100644
--- a/llvm/unittests/ExecutionEngine/JITLink/LinkGraphTests.cpp
+++ b/llvm/unittests/ExecutionEngine/JITLink/LinkGraphTests.cpp
@@ -42,7 +42,7 @@ TEST(LinkGraphTest, AddressAccess) {
   LinkGraph G("foo", Triple("x86_64-apple-darwin"), 8, support::little,
               getGenericEdgeKindName);
 
-  auto Sec1 = G.createSection("__data.1", RWFlags);
+  auto &Sec1 = G.createSection("__data.1", RWFlags);
   auto &B1 = G.createContentBlock(Sec1, BlockContent, 0x1000, 8, 0);
   auto &S1 = G.addDefinedSymbol(B1, 4, "S1", 4, Linkage::Strong, Scope::Default,
                                 false, false);


        


More information about the llvm-commits mailing list