diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-10-11 07:31:29 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-10-11 07:31:29 +0000 |
commit | 0df59d8c029db83a6ca7de2186fcd556c7d7ab29 (patch) | |
tree | e21b3bd819c916b40cffe64333c3662fc0d184a8 /clang/lib/Frontend/CacheTokens.cpp | |
parent | cbf2e67461cee2193317dee77f819b0dc891faba (diff) | |
download | bcm5719-llvm-0df59d8c029db83a6ca7de2186fcd556c7d7ab29.tar.gz bcm5719-llvm-0df59d8c029db83a6ca7de2186fcd556c7d7ab29.zip |
Turn FileManager DirectoryEntry::Name from raw pointer to StringRef (NFC)
llvm-svn: 283856
Diffstat (limited to 'clang/lib/Frontend/CacheTokens.cpp')
-rw-r--r-- | clang/lib/Frontend/CacheTokens.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/clang/lib/Frontend/CacheTokens.cpp b/clang/lib/Frontend/CacheTokens.cpp index d502e626bf2..91dd492a80e 100644 --- a/clang/lib/Frontend/CacheTokens.cpp +++ b/clang/lib/Frontend/CacheTokens.cpp @@ -58,18 +58,21 @@ public: class PTHEntryKeyVariant { - union { const FileEntry* FE; const char* Path; }; + union { + const FileEntry *FE; + StringRef Path; + }; enum { IsFE = 0x1, IsDE = 0x2, IsNoExist = 0x0 } Kind; FileData *Data; public: PTHEntryKeyVariant(const FileEntry *fe) : FE(fe), Kind(IsFE), Data(nullptr) {} - PTHEntryKeyVariant(FileData *Data, const char *path) - : Path(path), Kind(IsDE), Data(new FileData(*Data)) {} + PTHEntryKeyVariant(FileData *Data, StringRef Path) + : Path(Path), Kind(IsDE), Data(new FileData(*Data)) {} - explicit PTHEntryKeyVariant(const char *path) - : Path(path), Kind(IsNoExist), Data(nullptr) {} + explicit PTHEntryKeyVariant(StringRef Path) + : Path(Path), Kind(IsNoExist), Data(nullptr) {} bool isFile() const { return Kind == IsFE; } @@ -549,7 +552,7 @@ public: StatListener(PTHMap &pm) : PM(pm) {} ~StatListener() override {} - LookupResult getStat(const char *Path, FileData &Data, bool isFile, + LookupResult getStat(StringRef Path, FileData &Data, bool isFile, std::unique_ptr<vfs::File> *F, vfs::FileSystem &FS) override { LookupResult Result = statChained(Path, Data, isFile, F, FS); |