alexshap created this revision. alexshap added reviewers: bkramer, jdennett. alexshap added subscribers: compnerd, cfe-commits. alexshap changed the visibility of this Differential Revision from "Public (No Login Required)" to "All Users".
Code cleanup: address FIXME in llvm/tools/clang/include/clang/Basic/FileManager.h. Remove FileEntry copy-constructor. Build of llvm, clang succeeded, make check-all succeeded. https://reviews.llvm.org/D22712 Files: include/clang/Basic/FileManager.h Index: include/clang/Basic/FileManager.h =================================================================== --- include/clang/Basic/FileManager.h +++ include/clang/Basic/FileManager.h @@ -66,6 +66,7 @@ mutable std::unique_ptr<vfs::File> File; friend class FileManager; + FileEntry(const FileEntry &) = delete; void operator=(const FileEntry &) = delete; public: @@ -73,15 +74,6 @@ : 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"); - } - const char *getName() const { return Name; } StringRef tryGetRealPathName() const { return RealPathName; } bool isValid() const { return IsValid; }
Index: include/clang/Basic/FileManager.h =================================================================== --- include/clang/Basic/FileManager.h +++ include/clang/Basic/FileManager.h @@ -66,6 +66,7 @@ mutable std::unique_ptr<vfs::File> File; friend class FileManager; + FileEntry(const FileEntry &) = delete; void operator=(const FileEntry &) = delete; public: @@ -73,15 +74,6 @@ : 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"); - } - const char *getName() const { return Name; } StringRef tryGetRealPathName() const { return RealPathName; } bool isValid() const { return IsValid; }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits