r202896 - Revert "FileEntry: Remove unused and half-broken copy ctor."
Benjamin Kramer
benny.kra at googlemail.com
Tue Mar 4 13:49:45 PST 2014
Author: d0k
Date: Tue Mar 4 15:49:45 2014
New Revision: 202896
URL: http://llvm.org/viewvc/llvm-project?rev=202896&view=rev
Log:
Revert "FileEntry: Remove unused and half-broken copy ctor."
Looks like libstdc++ 4.7 still needs it.
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=202896&r1=202895&r2=202896&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/FileManager.h (original)
+++ cfe/trunk/include/clang/Basic/FileManager.h Tue Mar 4 15:49:45 2014
@@ -77,7 +77,6 @@ class FileEntry {
File.reset(0); // rely on destructor to close File
}
- FileEntry(const FileEntry &FE) LLVM_DELETED_FUNCTION;
void operator=(const FileEntry &) LLVM_DELETED_FUNCTION;
public:
@@ -85,6 +84,15 @@ 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");
+ }
+
const char *getName() const { return Name.c_str(); }
bool isValid() const { return IsValid; }
off_t getSize() const { return Size; }
More information about the cfe-commits
mailing list