Skip to content

Expand minus includes#159

Merged
giulianobelinassi merged 2 commits intoSUSE:mainfrom
giulianobelinassi:expand_minus_includes
Oct 16, 2025
Merged

Expand minus includes#159
giulianobelinassi merged 2 commits intoSUSE:mainfrom
giulianobelinassi:expand_minus_includes

Conversation

@giulianobelinassi
Copy link
Collaborator

Add support to avoid header expansion

Previously, clang-extract only properly supported flags to expand
headers. Now the new flag:
```
-DCE_NOT_EXPAND_INCLUDES=header1.h,...,headern.h
```
can be used to instruct it to not expand certain headers.  To enable it,
the expansion must go through the -DCE_KEEP_INCLUDES engine, which
means it is only activated if a certain policy is enabled.

Furthermore, this commit also adds a new program: `ce-includetree`
which shows in stdout the IncludeTree of the input source file.
it can be invoked using the compilation flags of the original file.

Improves #139, Fixes #148 

The PrettyPrint class has some undesired global states dating back from
when clang-extract was a closed-source single-file prototype.  One of
these is the use of `Get_Source_Manager`, which is abused in other
parts of the software.  Remove it.

Signed-off-by: Giuliano Belinassi <[email protected]>
Previously, clang-extract only properly supported flags to expand
headers. Now the new flag:
```
-DCE_NOT_EXPAND_INCLUDES=header1.h,...,headern.h
```
can be used to instruct it to not expand certain headers.  To enable it,
the expansion must go through the -DCE_KEEP_INCLUDES engine, which
means it is only activated if a certain policy is enabled.

Furthermore, this commit also adds a new program: `ce-includetree`
which shows in stdout the IncludeTree of the input source file.
it can be invoked using the compilation flags of the original file.

Signed-off-by: Giuliano Belinassi <[email protected]>
@giulianobelinassi giulianobelinassi merged commit a481f57 into SUSE:main Oct 16, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant