[cfe-commits] r112064 - /cfe/trunk/lib/Frontend/ASTUnit.cpp

Douglas Gregor dgregor at apple.com
Wed Aug 25 11:04:16 PDT 2010


Author: dgregor
Date: Wed Aug 25 13:04:15 2010
New Revision: 112064

URL: http://llvm.org/viewvc/llvm-project?rev=112064&view=rev
Log:
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.

Modified:
    cfe/trunk/lib/Frontend/ASTUnit.cpp

Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=112064&r1=112063&r2=112064&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Wed Aug 25 13:04:15 2010
@@ -1797,7 +1797,8 @@
       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,





More information about the cfe-commits mailing list