diff options
author | Chris Lattner <sabre@nondot.org> | 2010-11-23 08:35:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-11-23 08:35:12 +0000 |
commit | 5159f6162e894deedb0be1ab53e3e0f823c9db5d (patch) | |
tree | 6ad37aa5c3f6564eb01bc7a75e0749e9b7829204 /clang/lib/Lex/HeaderMap.cpp | |
parent | 5c1d4e3b1ea05949052737e5cdf11ef228231543 (diff) | |
download | llvm-5159f6162e894deedb0be1ab53e3e0f823c9db5d.zip llvm-5159f6162e894deedb0be1ab53e3e0f823c9db5d.tar.gz llvm-5159f6162e894deedb0be1ab53e3e0f823c9db5d.tar.bz2 |
now the FileManager has a FileSystemOpts ivar, stop threading
FileSystemOpts through a ton of apis, simplifying a lot of code.
This also fixes a latent bug in ASTUnit where it would invoke
methods on FileManager without creating one in some code paths
in cindextext.
llvm-svn: 120010
Diffstat (limited to 'clang/lib/Lex/HeaderMap.cpp')
-rw-r--r-- | clang/lib/Lex/HeaderMap.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/clang/lib/Lex/HeaderMap.cpp b/clang/lib/Lex/HeaderMap.cpp index d5d7e4b..81a58d4 100644 --- a/clang/lib/Lex/HeaderMap.cpp +++ b/clang/lib/Lex/HeaderMap.cpp @@ -75,14 +75,12 @@ static inline unsigned HashHMapKey(llvm::StringRef Str) { /// map. If it doesn't look like a HeaderMap, it gives up and returns null. /// If it looks like a HeaderMap but is obviously corrupted, it puts a reason /// into the string error argument and returns null. -const HeaderMap *HeaderMap::Create(const FileEntry *FE, FileManager &FM, - const FileSystemOptions &FSOpts) { +const HeaderMap *HeaderMap::Create(const FileEntry *FE, FileManager &FM) { // If the file is too small to be a header map, ignore it. unsigned FileSize = FE->getSize(); if (FileSize <= sizeof(HMapHeader)) return 0; - llvm::OwningPtr<const llvm::MemoryBuffer> FileBuffer( - FM.getBufferForFile(FE, FSOpts)); + llvm::OwningPtr<const llvm::MemoryBuffer> FileBuffer(FM.getBufferForFile(FE)); if (FileBuffer == 0) return 0; // Unreadable file? const char *FileStart = FileBuffer->getBufferStart(); @@ -201,8 +199,7 @@ void HeaderMap::dump() const { /// LookupFile - Check to see if the specified relative filename is located in /// this HeaderMap. If so, open it and return its FileEntry. const FileEntry *HeaderMap::LookupFile(llvm::StringRef Filename, - FileManager &FM, - const FileSystemOptions &FileSystemOpts) const { + FileManager &FM) const { const HMapHeader &Hdr = getHeader(); unsigned NumBuckets = getEndianAdjustedWord(Hdr.NumBuckets); @@ -225,6 +222,6 @@ const FileEntry *HeaderMap::LookupFile(llvm::StringRef Filename, llvm::SmallString<1024> DestPath; DestPath += getString(B.Prefix); DestPath += getString(B.Suffix); - return FM.getFile(DestPath.str(), FileSystemOpts); + return FM.getFile(DestPath.str()); } } |