aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/cplusplus/FastPreprocessor.cpp
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@qt.io>2025-04-28 10:09:35 +0200
committerChristian Stenger <christian.stenger@qt.io>2025-04-30 03:57:52 +0000
commit969b3dd1b206aa85299e788f064cd9595a2cdf37 (patch)
treea8f65109dac140e31a15b979376153b3b8c4a356 /src/libs/cplusplus/FastPreprocessor.cpp
parentfba96aa7709bbf2a97c126d916fb50b16dbec96d (diff)
CPlusPlus: Paddle back a bit for fast pre-processing
There are code paths that expect unexpanded function-like macros. Amends b419f638ecdec1e39f94c632065d73eddf3399dc. Change-Id: I28e8dedbf30c2a06bb29f61cfa0f69fc68012b03 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/libs/cplusplus/FastPreprocessor.cpp')
-rw-r--r--src/libs/cplusplus/FastPreprocessor.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libs/cplusplus/FastPreprocessor.cpp b/src/libs/cplusplus/FastPreprocessor.cpp
index c3660c606f1..b2fb0bfc58f 100644
--- a/src/libs/cplusplus/FastPreprocessor.cpp
+++ b/src/libs/cplusplus/FastPreprocessor.cpp
@@ -13,10 +13,9 @@
using namespace Utils;
using namespace CPlusPlus;
-FastPreprocessor::FastPreprocessor(const Snapshot &snapshot)
+FastPreprocessor::FastPreprocessor(const Snapshot &snapshot, bool expandFunctionLikeMacros)
: _snapshot(snapshot)
- , _preproc(this, &_env)
- , _addIncludesToCurrentDoc(false)
+ , _expandFunctionLikeMacros(expandFunctionLikeMacros)
{ }
QByteArray FastPreprocessor::run(Document::Ptr newDoc,
@@ -28,6 +27,7 @@ QByteArray FastPreprocessor::run(Document::Ptr newDoc,
&& _currentDoc->unresolvedIncludes().isEmpty();
const FilePath filePath = _currentDoc->filePath();
_preproc.setKeepComments(true);
+ _preproc.setExpandFunctionlikeMacros(_expandFunctionLikeMacros);
if (Document::Ptr doc = _snapshot.document(filePath)) {
_merged.insert(filePath);