[cfe-commits] r38634 - /cfe/cfe/trunk/Lex/Preprocessor.cpp

sabre at cs.uiuc.edu sabre at cs.uiuc.edu
Wed Jul 11 09:23:23 PDT 2007


Author: sabre
Date: Wed Jul 11 11:23:23 2007
New Revision: 38634

URL: http://llvm.org/viewvc/llvm-project?rev=38634&view=rev
Log:
Fix test/Preprocessor/_Pragma-syshdr2.c.

Modified:
    cfe/cfe/trunk/Lex/Preprocessor.cpp

Modified: cfe/cfe/trunk/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/Preprocessor.cpp?rev=38634&r1=38633&r2=38634&view=diff

==============================================================================
--- cfe/cfe/trunk/Lex/Preprocessor.cpp (original)
+++ cfe/cfe/trunk/Lex/Preprocessor.cpp Wed Jul 11 11:23:23 2007
@@ -302,8 +302,8 @@
   // Step #0, unless disabled, check to see if the file is in the #includer's
   // directory.  This search is not done for <> headers.
   if (!isAngled && !FromDir && !NoCurDirSearch) {
-    const FileEntry *CurFE = 
-      SourceMgr.getFileEntryForFileID(CurLexer->getCurFileID());
+    unsigned TheFileID = getCurrentFileLexer()->getCurFileID();
+    const FileEntry *CurFE = SourceMgr.getFileEntryForFileID(TheFileID);
     if (CurFE) {
       // Concatenate the requested file onto the directory.
       // FIXME: Portability.  Should be in sys::Path.
@@ -370,7 +370,7 @@
   
   // Look for a stacked lexer.
   for (unsigned i = IncludeMacroStack.size(); i != 0; --i) {
-    Lexer *L = IncludeMacroStack[i].TheLexer;
+    Lexer *L = IncludeMacroStack[i-1].TheLexer;
     if (L && !L->Is_PragmaLexer) // Ignore macro & _Pragma expansions.
       return L;
   }





More information about the cfe-commits mailing list