diff options
| author | Leandro Melo <[email protected]> | 2012-05-22 12:27:06 +0200 |
|---|---|---|
| committer | Leandro Melo <[email protected]> | 2012-05-23 17:40:05 +0200 |
| commit | bf9bc9914b6d546421a71da155b5e89ff326d9de (patch) | |
| tree | a96b47f85283fd1b230786d3c27afc5a6e253286 /src/libs/cplusplus/pp-engine.h | |
| parent | e1cab763441f4dff1ca9b4da1dc459a49ee01bc8 (diff) | |
C++: Fix argument tracking in macro expansion
Due to latest changes the macro arguments were no longer being tracked.
Then they were no available in the document's macro uses. The patch also
makes sure that the preprocessor condition to be expanded is spelled
exactly as in the source code (this guarantees that offsets will be
properly calculated).
Change-Id: I8aff0c3aca0c528ef2c4bcfa56ff1c3da2961060
Reviewed-by: Roberto Raggi <[email protected]>
Diffstat (limited to 'src/libs/cplusplus/pp-engine.h')
| -rw-r--r-- | src/libs/cplusplus/pp-engine.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libs/cplusplus/pp-engine.h b/src/libs/cplusplus/pp-engine.h index e4e60b9b45e..12afd1f9b83 100644 --- a/src/libs/cplusplus/pp-engine.h +++ b/src/libs/cplusplus/pp-engine.h @@ -91,7 +91,8 @@ public: private: void preprocess(const QString &filename, const QByteArray &source, - QByteArray *result, bool noLines, bool markGeneratedTokens, bool inCondition); + QByteArray *result, bool noLines, bool markGeneratedTokens, bool inCondition, + unsigned offset = 0); enum { MAX_LEVEL = 512 }; @@ -118,6 +119,8 @@ private: bool m_noLines; bool m_inCondition; bool m_inDefine; + + unsigned m_offsetRef; }; void handleDefined(PPToken *tk); @@ -125,7 +128,9 @@ private: void lex(PPToken *tk); void skipPreprocesorDirective(PPToken *tk); bool handleIdentifier(PPToken *tk); - bool handleFunctionLikeMacro(PPToken *tk, const Macro *macro, QVector<PPToken> &body, bool addWhitespaceMarker); + bool handleFunctionLikeMacro(PPToken *tk, const Macro *macro, QVector<PPToken> &body, + bool addWhitespaceMarker, + const QVector<QVector<PPToken> > &actuals); bool skipping() const { return m_state.m_skipping[m_state.m_ifLevel]; } |
