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 | c9c29a8d7a0f78ddf2b393dd92f77c7f2046179c (patch) | |
tree | 23794cbcd3625033161f96e469d0b10cfe4d40bb /lib | |
parent | 4125c37c71c6c8475019497de837204f0ee4370f (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112064 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Frontend/ASTUnit.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index 16aa6e3cc0..fe460bb644 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/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, |