diff options
author | Ben Langmuir <blangmuir@apple.com> | 2014-02-28 21:16:07 +0000 |
---|---|---|
committer | Ben Langmuir <blangmuir@apple.com> | 2014-02-28 21:16:07 +0000 |
commit | d066fe94b043330d26e29f3911aca79e52ebb0a9 (patch) | |
tree | c7b22596537631ed47aedefc29d7450e9b2b0430 /unittests/Basic/FileManagerTest.cpp | |
parent | d353a18fca89468898520e8df3e25852531e70b3 (diff) | |
download | clang-d066fe94b043330d26e29f3911aca79e52ebb0a9.tar.gz |
Reapply fixed "Honour 'use-external-names' in FileManager"
Was r202442
There were two issues with the original patch that have now been fixed.
1. We were memset'ing over a FileEntry in a test case. After adding a
std::string to FileEntry, this still happened to not break for me.
2. I didn't pass the FileManager into the new compiler instance in
compileModule. This was hidden in some cases by the fact I didn't
clear the module cache in the test.
Also, I changed the copy constructor for FileEntry, which was memcpy'ing
in a (now) unsafe way.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202539 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Basic/FileManagerTest.cpp')
-rw-r--r-- | unittests/Basic/FileManagerTest.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/unittests/Basic/FileManagerTest.cpp b/unittests/Basic/FileManagerTest.cpp index 5b35e68735..a9fd466a02 100644 --- a/unittests/Basic/FileManagerTest.cpp +++ b/unittests/Basic/FileManagerTest.cpp @@ -28,10 +28,13 @@ private: void InjectFileOrDirectory(const char *Path, ino_t INode, bool IsFile) { FileData Data; - memset(&Data, 0, sizeof(FileData)); - llvm::sys::fs::UniqueID ID(1, INode); - Data.UniqueID = ID; + Data.Name = Path; + Data.Size = 0; + Data.ModTime = 0; + Data.UniqueID = llvm::sys::fs::UniqueID(1, INode); Data.IsDirectory = !IsFile; + Data.IsNamedPipe = false; + Data.InPCH = false; StatCalls[Path] = Data; } |