aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/cplusplus/pp-engine.cpp
diff options
context:
space:
mode:
authorChristian Kamm <[email protected]>2012-08-06 15:28:00 +0200
committerChristian Kamm <[email protected]>2012-08-07 07:35:34 +0200
commit605acda9ae751f31b68f5416077410a22555c3c0 (patch)
tree67548ecf03b475f7566d47e69e163a538e04b847 /src/libs/cplusplus/pp-engine.cpp
parente0e430e1dc1951bdfadb9eb91e807708373245aa (diff)
C++: Expand object-like macros in fast preprocessing mode again.
Task-number: QTCREATORBUG-7512 Change-Id: I59898a0449f1f6997963e0f31c47293358a773f6 Reviewed-by: Leandro Melo <[email protected]>
Diffstat (limited to 'src/libs/cplusplus/pp-engine.cpp')
-rw-r--r--src/libs/cplusplus/pp-engine.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp
index e6ba93de810..a7e06000273 100644
--- a/src/libs/cplusplus/pp-engine.cpp
+++ b/src/libs/cplusplus/pp-engine.cpp
@@ -593,7 +593,7 @@ void Preprocessor::State::popTokenBuffer()
Preprocessor::Preprocessor(Client *client, Environment *env)
: m_client(client)
, m_env(env)
- , m_expandMacros(true)
+ , m_expandFunctionlikeMacros(true)
, m_keepComments(false)
{
}
@@ -615,14 +615,14 @@ QByteArray Preprocessor::run(const QString &fileName,
return preprocessed;
}
-bool Preprocessor::expandMacros() const
+bool Preprocessor::expandFunctionlikeMacros() const
{
- return m_expandMacros;
+ return m_expandFunctionlikeMacros;
}
-void Preprocessor::setExpandMacros(bool expandMacros)
+void Preprocessor::setExpandFunctionlikeMacros(bool expandMacros)
{
- m_expandMacros = expandMacros;
+ m_expandFunctionlikeMacros = expandMacros;
}
bool Preprocessor::keepComments() const
@@ -741,9 +741,6 @@ void Preprocessor::skipPreprocesorDirective(PPToken *tk)
bool Preprocessor::handleIdentifier(PPToken *tk)
{
- if (!expandMacros())
- return false;
-
ScopedBoolSwap s(m_state.m_inPreprocessorDirective, true);
static const QByteArray ppLine("__LINE__");
@@ -813,6 +810,9 @@ bool Preprocessor::handleIdentifier(PPToken *tk)
PPToken oldMarkerTk;
if (macro->isFunctionLike()) {
+ if (!expandFunctionlikeMacros())
+ return false;
+
// Collect individual tokens that form the macro arguments.
QVector<QVector<PPToken> > allArgTks;
bool hasArgs = collectActualArguments(tk, &allArgTks);