summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-23 08:35:12 +0000
committerChris Lattner <sabre@nondot.org>2010-11-23 08:35:12 +0000
commit5159f6162e894deedb0be1ab53e3e0f823c9db5d (patch)
tree6ad37aa5c3f6564eb01bc7a75e0749e9b7829204 /clang/lib/Serialization
parent5c1d4e3b1ea05949052737e5cdf11ef228231543 (diff)
downloadbcm5719-llvm-5159f6162e894deedb0be1ab53e3e0f823c9db5d.tar.gz
bcm5719-llvm-5159f6162e894deedb0be1ab53e3e0f823c9db5d.zip
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/Serialization')
-rw-r--r--clang/lib/Serialization/ASTReader.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 9e3e0773bfd..9673081f0a6 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -1234,7 +1234,7 @@ ASTReader::ASTReadResult ASTReader::ReadSLocEntryRecord(unsigned ID) {
case SM_SLOC_FILE_ENTRY: {
std::string Filename(BlobStart, BlobStart + BlobLen);
MaybeAddSystemRootToFilename(Filename);
- const FileEntry *File = FileMgr.getFile(Filename, FileSystemOpts);
+ const FileEntry *File = FileMgr.getFile(Filename);
if (File == 0) {
std::string ErrorStr = "could not find file '";
ErrorStr += Filename;
@@ -1549,8 +1549,7 @@ void ASTReader::ReadMacroRecord(PerFileData &F, uint64_t Offset) {
const char *FullFileNameStart = BlobStart + Record[3];
const FileEntry *File
= PP->getFileManager().getFile(llvm::StringRef(FullFileNameStart,
- BlobLen - Record[3]),
- FileSystemOpts);
+ BlobLen - Record[3]));
// FIXME: Stable encoding
InclusionDirective::InclusionKind Kind
@@ -2273,7 +2272,7 @@ ASTReader::ASTReadResult ASTReader::ReadASTCore(llvm::StringRef FileName,
if (FileName == "-")
F.Buffer.reset(llvm::MemoryBuffer::getSTDIN(&ErrStr));
else
- F.Buffer.reset(FileMgr.getBufferForFile(FileName, FileSystemOpts, &ErrStr));
+ F.Buffer.reset(FileMgr.getBufferForFile(FileName, &ErrStr));
if (!F.Buffer) {
Error(ErrStr.c_str());
return IgnorePCH;
@@ -2478,12 +2477,11 @@ void ASTReader::InitializeContext(ASTContext &Ctx) {
/// file.
std::string ASTReader::getOriginalSourceFile(const std::string &ASTFileName,
FileManager &FileMgr,
- const FileSystemOptions &FSOpts,
Diagnostic &Diags) {
// Open the AST file.
std::string ErrStr;
llvm::OwningPtr<llvm::MemoryBuffer> Buffer;
- Buffer.reset(FileMgr.getBufferForFile(ASTFileName, FSOpts, &ErrStr));
+ Buffer.reset(FileMgr.getBufferForFile(ASTFileName, &ErrStr));
if (!Buffer) {
Diags.Report(diag::err_fe_unable_to_read_pch_file) << ErrStr;
return std::string();
@@ -4503,7 +4501,6 @@ ASTReader::ASTReader(Preprocessor &PP, ASTContext *Context,
const char *isysroot, bool DisableValidation)
: Listener(new PCHValidator(PP, *this)), DeserializationListener(0),
SourceMgr(PP.getSourceManager()), FileMgr(PP.getFileManager()),
- FileSystemOpts(PP.getFileSystemOpts()),
Diags(PP.getDiagnostics()), SemaObj(0), PP(&PP), Context(Context),
Consumer(0), isysroot(isysroot), DisableValidation(DisableValidation),
NumStatHits(0), NumStatMisses(0), NumSLocEntriesRead(0),
@@ -4517,11 +4514,9 @@ ASTReader::ASTReader(Preprocessor &PP, ASTContext *Context,
}
ASTReader::ASTReader(SourceManager &SourceMgr, FileManager &FileMgr,
- const FileSystemOptions &FileSystemOpts,
Diagnostic &Diags, const char *isysroot,
bool DisableValidation)
: DeserializationListener(0), SourceMgr(SourceMgr), FileMgr(FileMgr),
- FileSystemOpts(FileSystemOpts),
Diags(Diags), SemaObj(0), PP(0), Context(0), Consumer(0),
isysroot(isysroot), DisableValidation(DisableValidation), NumStatHits(0),
NumStatMisses(0), NumSLocEntriesRead(0), TotalNumSLocEntries(0),
OpenPOWER on IntegriCloud