aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Lex/Preprocessor.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-01 22:52:33 +0000
committerChris Lattner <sabre@nondot.org>2009-12-01 22:52:33 +0000
commit39d9841ed4c0568d4b44dfbc12ac04491f60a374 (patch)
tree8e85395573cf9e3854b100995521f7195fe2d0f2 /include/clang/Lex/Preprocessor.h
parent2b56b9cf7429919e1df011d8d6bee2e04f5bc22c (diff)
pass the reason for failure up from MemoryBuffer and report it
in diagnostics when we fail to open a file. This allows us to report things like: $ clang test.c -I. test.c:2:10: fatal error: error opening file './foo.h': Permission denied #include "foo.h" ^ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90276 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/Preprocessor.h')
-rw-r--r--include/clang/Lex/Preprocessor.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h
index edd34b7189..c8e4a0f209 100644
--- a/include/clang/Lex/Preprocessor.h
+++ b/include/clang/Lex/Preprocessor.h
@@ -330,8 +330,9 @@ public:
/// EnterSourceFile - Add a source file to the top of the include stack and
/// start lexing tokens from it instead of the current buffer. Return true
- /// on failure.
- bool EnterSourceFile(FileID CurFileID, const DirectoryLookup *Dir);
+ /// and fill in ErrorStr with the error information on failure.
+ bool EnterSourceFile(FileID CurFileID, const DirectoryLookup *Dir,
+ std::string *ErrorStr = 0);
/// EnterMacro - Add a Macro to the top of the include stack and start lexing
/// tokens from it instead of the current buffer. Args specifies the