Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flatpak-qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
2780999d
Commit
2780999d
authored
Mar 09, 2009
by
Roberto Raggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved the way we merge environments.
parent
7a9536c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
src/plugins/cpptools/cppmodelmanager.cpp
src/plugins/cpptools/cppmodelmanager.cpp
+8
-11
No files found.
src/plugins/cpptools/cppmodelmanager.cpp
View file @
2780999d
...
...
@@ -187,7 +187,6 @@ protected:
QByteArray
tryIncludeFile
(
QString
&
fileName
,
IncludeType
type
);
void
mergeEnvironment
(
CPlusPlus
::
Document
::
Ptr
doc
);
void
mergeEnvironment
(
CPlusPlus
::
Document
::
Ptr
doc
,
QSet
<
QString
>
*
processed
);
virtual
void
macroAdded
(
const
Macro
&
macro
);
virtual
void
startExpandingMacro
(
unsigned
offset
,
...
...
@@ -212,6 +211,7 @@ private:
QSet
<
QString
>
m_included
;
Document
::
Ptr
m_currentDoc
;
QSet
<
QString
>
m_todo
;
QSet
<
QString
>
m_processed
;
};
}
// namespace Internal
...
...
@@ -270,7 +270,10 @@ void CppPreprocessor::run(const QString &fileName)
}
void
CppPreprocessor
::
resetEnvironment
()
{
env
.
reset
();
}
{
env
.
reset
();
m_processed
.
clear
();
}
bool
CppPreprocessor
::
includeFile
(
const
QString
&
absoluteFilePath
,
QByteArray
*
result
)
{
...
...
@@ -413,28 +416,22 @@ void CppPreprocessor::stopExpandingMacro(unsigned, const Macro &)
}
void
CppPreprocessor
::
mergeEnvironment
(
Document
::
Ptr
doc
)
{
QSet
<
QString
>
processed
;
mergeEnvironment
(
doc
,
&
processed
);
}
void
CppPreprocessor
::
mergeEnvironment
(
Document
::
Ptr
doc
,
QSet
<
QString
>
*
processed
)
{
if
(
!
doc
)
return
;
const
QString
fn
=
doc
->
fileName
();
if
(
processed
->
contains
(
fn
))
if
(
m_processed
.
contains
(
fn
))
return
;
processed
->
insert
(
fn
);
m_processed
.
insert
(
fn
);
foreach
(
const
Document
::
Include
&
incl
,
doc
->
includes
())
{
QString
includedFile
=
incl
.
fileName
();
if
(
Document
::
Ptr
includedDoc
=
snapshot
.
value
(
includedFile
))
mergeEnvironment
(
includedDoc
,
processed
);
mergeEnvironment
(
includedDoc
);
else
run
(
includedFile
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment