diff options
author | hjk <[email protected]> | 2013-01-03 17:22:19 +0100 |
---|---|---|
committer | Erik Verbruggen <[email protected]> | 2013-01-11 11:38:11 +0100 |
commit | b934cc196cdf8d82cc71633cf13bf2e579940b56 (patch) | |
tree | 3f613e70435648ab647d072bb35a1bc24b84b8a2 /src/libs | |
parent | 40eecd87c94f7cf8aaaacf636b2efb8238ca4d31 (diff) |
C++: pass #include_next down to CppPreprocessor::tryIncludeFile
This does not yet resolve the file using the proper mechanism.
Change-Id: I04913e8b01ae0c3411961f0c1cffe07202f06a0a
Reviewed-by: Erik Verbruggen <[email protected]>
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/cplusplus/PreprocessorClient.h | 3 | ||||
-rw-r--r-- | src/libs/cplusplus/pp-engine.cpp | 11 | ||||
-rw-r--r-- | src/libs/cplusplus/pp-engine.h | 2 |
3 files changed, 10 insertions, 6 deletions
diff --git a/src/libs/cplusplus/PreprocessorClient.h b/src/libs/cplusplus/PreprocessorClient.h index 05727ee5f44..f7e9932dd2d 100644 --- a/src/libs/cplusplus/PreprocessorClient.h +++ b/src/libs/cplusplus/PreprocessorClient.h @@ -68,7 +68,8 @@ class CPLUSPLUS_EXPORT Client public: enum IncludeType { IncludeLocal, - IncludeGlobal + IncludeGlobal, + IncludeNext }; public: diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp index 551cd6e37ed..4866a8f1006 100644 --- a/src/libs/cplusplus/pp-engine.cpp +++ b/src/libs/cplusplus/pp-engine.cpp @@ -1407,9 +1407,10 @@ void Preprocessor::handlePreprocessorDirective(PPToken *tk) else if (!skipping() && directive == ppUndef) handleUndefDirective(tk); else if (!skipping() && (directive == ppInclude - || directive == ppIncludeNext || directive == ppImport)) - handleIncludeDirective(tk); + handleIncludeDirective(tk, false); + else if (!skipping() && directive == ppIncludeNext) + handleIncludeDirective(tk, true); else if (directive == ppIf) handleIfDirective(tk); else if (directive == ppIfDef) @@ -1428,7 +1429,7 @@ void Preprocessor::handlePreprocessorDirective(PPToken *tk) } -void Preprocessor::handleIncludeDirective(PPToken *tk) +void Preprocessor::handleIncludeDirective(PPToken *tk, bool includeNext) { m_state.m_lexer->setScanAngleStringLiteralTokens(true); lex(tk); // consume "include" token @@ -1451,7 +1452,9 @@ void Preprocessor::handleIncludeDirective(PPToken *tk) // qDebug("include [[%s]]", included.toUtf8().constData()); Client::IncludeType mode; - if (included.at(0) == '"') + if (includeNext) + mode = Client::IncludeNext; + else if (included.at(0) == '"') mode = Client::IncludeLocal; else if (included.at(0) == '<') mode = Client::IncludeGlobal; diff --git a/src/libs/cplusplus/pp-engine.h b/src/libs/cplusplus/pp-engine.h index a86b2b4f0a5..23ea7b84f9f 100644 --- a/src/libs/cplusplus/pp-engine.h +++ b/src/libs/cplusplus/pp-engine.h @@ -155,7 +155,7 @@ private: void scanActualArgument(PPToken *tk, QVector<PPToken> *tokens); void handlePreprocessorDirective(PPToken *tk); - void handleIncludeDirective(PPToken *tk); + void handleIncludeDirective(PPToken *tk, bool includeNext); void handleDefineDirective(PPToken *tk); QByteArray expand(PPToken *tk, PPToken *lastConditionToken = 0); const Internal::PPToken evalExpression(PPToken *tk, Value &result); |