[llvm] Set ObjectFile's assignment operator to also be deleted like its copy constructor (PR #92942)

Thomas Fransham via llvm-commits llvm-commits at lists.llvm.org
Tue May 21 10:41:05 PDT 2024


https://github.com/fsfod created https://github.com/llvm/llvm-project/pull/92942

This will also fix a warning when ObjectFile is dllexport'ed on Windows for my GSOC project for adding support Clang plugins on windows with @vgvassilev and @compnerd.

>From ea6d97295a3ff34091bd696bcc344f761bd18cc6 Mon Sep 17 00:00:00 2001
From: Thomas Fransham <tfransham at gmail.com>
Date: Tue, 21 May 2024 17:29:31 +0100
Subject: [PATCH] Set ObjectFile's assignment operator to also be deleted like
 its copy ctor

This will also fix a warning when ObjectFile is dllexport'ed on Windows.
---
 llvm/include/llvm/Object/ObjectFile.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm/include/llvm/Object/ObjectFile.h b/llvm/include/llvm/Object/ObjectFile.h
index 8c868c7643edc..645829d944d9f 100644
--- a/llvm/include/llvm/Object/ObjectFile.h
+++ b/llvm/include/llvm/Object/ObjectFile.h
@@ -302,6 +302,7 @@ class ObjectFile : public SymbolicFile {
 public:
   ObjectFile() = delete;
   ObjectFile(const ObjectFile &other) = delete;
+  ObjectFile operator=(const ObjectFile &other) = delete;
 
   uint64_t getCommonSymbolSize(DataRefImpl Symb) const {
     Expected<uint32_t> SymbolFlagsOrErr = getSymbolFlags(Symb);



More information about the llvm-commits mailing list