diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2014-02-07 15:00:22 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2014-02-07 15:00:22 +0000 |
commit | 2febd212d3528b4bdebd545e7d5883bfaa1d8d89 (patch) | |
tree | aa2cd6b81770d2d644f699551eeb325d2f207c66 /clang/lib/Frontend/ASTUnit.cpp | |
parent | 649899685bfbfeea8c9ae10a3420eef016ea1ede (diff) | |
download | llvm-2febd212d3528b4bdebd545e7d5883bfaa1d8d89.zip llvm-2febd212d3528b4bdebd545e7d5883bfaa1d8d89.tar.gz llvm-2febd212d3528b4bdebd545e7d5883bfaa1d8d89.tar.bz2 |
ASTUnit: ArrayRef'ize RemappedFiles
llvm-svn: 200975
Diffstat (limited to 'clang/lib/Frontend/ASTUnit.cpp')
-rw-r--r-- | clang/lib/Frontend/ASTUnit.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index 1ee8383..f57a4bc 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -680,8 +680,7 @@ ASTUnit *ASTUnit::LoadFromASTFile(const std::string &Filename, IntrusiveRefCntPtr<DiagnosticsEngine> Diags, const FileSystemOptions &FileSystemOpts, bool OnlyLocalDecls, - RemappedFile *RemappedFiles, - unsigned NumRemappedFiles, + ArrayRef<RemappedFile> RemappedFiles, bool CaptureDiagnostics, bool AllowPCHWithCompilerErrors, bool UserFilesAreVolatile) { @@ -712,7 +711,7 @@ ASTUnit *ASTUnit::LoadFromASTFile(const std::string &Filename, AST->ASTFileLangOpts, /*Target=*/0)); - for (unsigned I = 0; I != NumRemappedFiles; ++I) { + for (unsigned I = 0, N = RemappedFiles.size(); I != N; ++I) { FilenameOrMemBuf fileOrBuf = RemappedFiles[I].second; if (const llvm::MemoryBuffer * memBuf = fileOrBuf.dyn_cast<const llvm::MemoryBuffer *>()) { @@ -2021,8 +2020,7 @@ ASTUnit *ASTUnit::LoadFromCommandLine(const char **ArgBegin, StringRef ResourceFilesPath, bool OnlyLocalDecls, bool CaptureDiagnostics, - RemappedFile *RemappedFiles, - unsigned NumRemappedFiles, + ArrayRef<RemappedFile> RemappedFiles, bool RemappedFilesKeepOriginalName, bool PrecompilePreamble, TranslationUnitKind TUKind, @@ -2056,7 +2054,7 @@ ASTUnit *ASTUnit::LoadFromCommandLine(const char **ArgBegin, } // Override any files that need remapping - for (unsigned I = 0; I != NumRemappedFiles; ++I) { + for (unsigned I = 0, N = RemappedFiles.size(); I != N; ++I) { FilenameOrMemBuf fileOrBuf = RemappedFiles[I].second; if (const llvm::MemoryBuffer * memBuf = fileOrBuf.dyn_cast<const llvm::MemoryBuffer *>()) { @@ -2114,7 +2112,7 @@ ASTUnit *ASTUnit::LoadFromCommandLine(const char **ArgBegin, return AST.take(); } -bool ASTUnit::Reparse(RemappedFile *RemappedFiles, unsigned NumRemappedFiles) { +bool ASTUnit::Reparse(ArrayRef<RemappedFile> RemappedFiles) { if (!Invocation) return true; @@ -2133,7 +2131,7 @@ bool ASTUnit::Reparse(RemappedFile *RemappedFiles, unsigned NumRemappedFiles) { delete R->second; } Invocation->getPreprocessorOpts().clearRemappedFiles(); - for (unsigned I = 0; I != NumRemappedFiles; ++I) { + for (unsigned I = 0, N = RemappedFiles.size(); I != N; ++I) { FilenameOrMemBuf fileOrBuf = RemappedFiles[I].second; if (const llvm::MemoryBuffer * memBuf = fileOrBuf.dyn_cast<const llvm::MemoryBuffer *>()) { @@ -2415,8 +2413,7 @@ void AugmentedCodeCompleteConsumer::ProcessCodeCompleteResults(Sema &S, void ASTUnit::CodeComplete(StringRef File, unsigned Line, unsigned Column, - RemappedFile *RemappedFiles, - unsigned NumRemappedFiles, + ArrayRef<RemappedFile> RemappedFiles, bool IncludeMacros, bool IncludeCodePatterns, bool IncludeBriefComments, @@ -2499,7 +2496,7 @@ void ASTUnit::CodeComplete(StringRef File, unsigned Line, unsigned Column, // Remap files. PreprocessorOpts.clearRemappedFiles(); PreprocessorOpts.RetainRemappedFileBuffers = true; - for (unsigned I = 0; I != NumRemappedFiles; ++I) { + for (unsigned I = 0, N = RemappedFiles.size(); I != N; ++I) { FilenameOrMemBuf fileOrBuf = RemappedFiles[I].second; if (const llvm::MemoryBuffer * memBuf = fileOrBuf.dyn_cast<const llvm::MemoryBuffer *>()) { |