Author: dgregor
Date: Tue Mar 16 14:49:24 2010
New Revision: 98664

URL: http://llvm.org/viewvc/llvm-project?rev=98664&view=rev
Log:
Teach the one caller of SourceManager::getMemoryBufferForFile() to cope with 
errors

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

Modified: cfe/trunk/lib/Lex/Preprocessor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Preprocessor.cpp?rev=98664&r1=98663&r2=98664&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Preprocessor.cpp (original)
+++ cfe/trunk/lib/Lex/Preprocessor.cpp Tue Mar 16 14:49:24 2010
@@ -232,8 +232,9 @@
     return false;
 
   // Load the actual file's contents.
-  const MemoryBuffer *Buffer = SourceMgr.getMemoryBufferForFile(File);
-  if (!Buffer)
+  bool Invalid = false;
+  const MemoryBuffer *Buffer = SourceMgr.getMemoryBufferForFile(File, 
&Invalid);
+  if (Invalid)
     return true;
 
   // Find the byte position of the truncation point.


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to