aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Frontend
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-08-20 00:59:43 +0000
committerDouglas Gregor <dgregor@apple.com>2010-08-20 00:59:43 +0000
commit2283d79155a3e82442fce124ce5fd704ca138801 (patch)
tree2bcc8745f5052aad44acdacbd1b96a7f473bc89e /include/clang/Frontend
parent6dbce19fdae4cfae4eb5f826284978e723a04e61 (diff)
When performing code-completion in the presence of a preamble, make
sure to (1) actually use the remapped files we were given rather than old data, and (2) keep the remapped files alive until the code-completion results are destroyed. Big thanks to Daniel for the test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111597 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend')
-rw-r--r--include/clang/Frontend/ASTUnit.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h
index 8f3b4d40f1..e323170b08 100644
--- a/include/clang/Frontend/ASTUnit.h
+++ b/include/clang/Frontend/ASTUnit.h
@@ -311,6 +311,7 @@ private:
unsigned MaxLines, bool &CreatedBuffer);
llvm::MemoryBuffer *getMainBufferWithPrecompiledPreamble(
+ CompilerInvocation PreambleInvocation,
bool AllowRebuild = true,
unsigned MaxLines = 0);
void RealizeTopLevelDeclsFromPreamble();
@@ -546,16 +547,16 @@ public:
/// \param IncludeCodePatterns Whether to include code patterns (such as a
/// for loop) in the code-completion results.
///
- /// FIXME: The Diag, LangOpts, SourceMgr, FileMgr, and
- /// StoredDiagnostics parameters are all disgusting hacks. They will
- /// go away.
+ /// FIXME: The Diag, LangOpts, SourceMgr, FileMgr, StoredDiagnostics, and
+ /// OwnedBuffers parameters are all disgusting hacks. They will go away.
void CodeComplete(llvm::StringRef File, unsigned Line, unsigned Column,
RemappedFile *RemappedFiles, unsigned NumRemappedFiles,
bool IncludeMacros, bool IncludeCodePatterns,
CodeCompleteConsumer &Consumer,
Diagnostic &Diag, LangOptions &LangOpts,
SourceManager &SourceMgr, FileManager &FileMgr,
- llvm::SmallVectorImpl<StoredDiagnostic> &StoredDiagnostics);
+ llvm::SmallVectorImpl<StoredDiagnostic> &StoredDiagnostics,
+ llvm::SmallVectorImpl<const llvm::MemoryBuffer *> &OwnedBuffers);
/// \brief Save this translation unit to a file with the given name.
///