diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-08-25 18:04:15 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-08-25 18:04:15 +0000 |
commit | 8e817b6a3af3948ae3b9fcfa61b92f1ec7e3e1ab (patch) | |
tree | 3365c58f8e2db4d9f91ab4403bca2f89f4891589 /clang/lib/Frontend/ASTUnit.cpp | |
parent | 8850aa3f67b7ef119cf22df548f1ebf3c3781ef9 (diff) | |
download | bcm5719-llvm-8e817b6a3af3948ae3b9fcfa61b92f1ec7e3e1ab.tar.gz bcm5719-llvm-8e817b6a3af3948ae3b9fcfa61b92f1ec7e3e1ab.zip |
Fix an off-by-one error when computing the precompiled preamble for
code completion. We were allowing the preamble to include the line
that we're code-completing on. Again, testcase is forthcoming.
llvm-svn: 112064
Diffstat (limited to 'clang/lib/Frontend/ASTUnit.cpp')
-rw-r--r-- | clang/lib/Frontend/ASTUnit.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index 16aa6e3cc01..fe460bb6443 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -1797,7 +1797,8 @@ void ASTUnit::CodeComplete(llvm::StringRef File, unsigned Line, unsigned Column, if (const FileStatus *MainStatus = MainPath.getFileStatus()) if (CompleteFileStatus->getUniqueID() == MainStatus->getUniqueID()) OverrideMainBuffer - = getMainBufferWithPrecompiledPreamble(CCInvocation, false, Line); + = getMainBufferWithPrecompiledPreamble(CCInvocation, false, + Line - 1); } // If the main file has been overridden due to the use of a preamble, |