r284782 - [clang] Remove FileEntry copy-constructor

Alexander Shaposhnikov via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 20 14:20:35 PDT 2016


Author: alexshap
Date: Thu Oct 20 16:20:35 2016
New Revision: 284782

URL: http://llvm.org/viewvc/llvm-project?rev=284782&view=rev
Log:
[clang] Remove FileEntry copy-constructor

Code cleanup: address FIXME in the file
include/clang/Basic/FileManager.h and remove 
copy-constructor of the class FileEntry.

Test plan: make check-clang

Differential revision: https://reviews.llvm.org/D22712

Modified:
    cfe/trunk/include/clang/Basic/FileManager.h

Modified: cfe/trunk/include/clang/Basic/FileManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/FileManager.h?rev=284782&r1=284781&r2=284782&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/FileManager.h (original)
+++ cfe/trunk/include/clang/Basic/FileManager.h Thu Oct 20 16:20:35 2016
@@ -65,6 +65,7 @@ class FileEntry {
   mutable std::unique_ptr<vfs::File> File;
   friend class FileManager;
 
+  FileEntry(const FileEntry &) = delete;
   void operator=(const FileEntry &) = delete;
 
 public:
@@ -72,15 +73,6 @@ public:
       : UniqueID(0, 0), IsNamedPipe(false), InPCH(false), IsValid(false)
   {}
 
-  // FIXME: this is here to allow putting FileEntry in std::map.  Once we have
-  // emplace, we shouldn't need a copy constructor anymore.
-  /// Intentionally does not copy fields that are not set in an uninitialized
-  /// \c FileEntry.
-  FileEntry(const FileEntry &FE) : UniqueID(FE.UniqueID),
-      IsNamedPipe(FE.IsNamedPipe), InPCH(FE.InPCH), IsValid(FE.IsValid) {
-    assert(!isValid() && "Cannot copy an initialized FileEntry");
-  }
-
   StringRef getName() const { return Name; }
   StringRef tryGetRealPathName() const { return RealPathName; }
   bool isValid() const { return IsValid; }




More information about the cfe-commits mailing list