-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execute ComponentPass
passes according to the dependencies between components
#2010
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KuechA
changed the title
Execeute
Execute Jan 30, 2025
ComponentPass
passes according to the dependencies between componentsComponentPass
passes according to the dependencies between components
oxisto
force-pushed
the
component-dependencies
branch
from
January 30, 2025 15:31
43fcc23
to
f8c0d16
Compare
KuechA
reviewed
Jan 31, 2025
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/Extensions.kt
Outdated
Show resolved
Hide resolved
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/ImportResolver.kt
Outdated
Show resolved
Hide resolved
oxisto
force-pushed
the
component-dependencies
branch
from
January 31, 2025 14:49
a4ad5d1
to
e22c6cf
Compare
KuechA
approved these changes
Jan 31, 2025
…ons.kt Co-authored-by: KuechA <[email protected]>
oxisto
force-pushed
the
component-dependencies
branch
from
January 31, 2025 15:11
e22c6cf
to
aff15bc
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes the same import-dependencies object that is currently available on a
Component
(between TUs) available on theTranslationResult
(between components). I decided to generalize theImportDependencies
class for this. This might sounds overkill but my feeling is that this might pay off at some point.To access that information, I added two new "strategies" (
TRANSLATION_UNITS_LEAST_IMPORTS
andCOMPONENTS_LEAST_IMPORTS
). I do not really like the UPPERCASE naming on these strategies, but we probably want to change that for all of them at some point. So they are named like this for consistency.Furthermore,
ComponentPass
passes are now executed according to theCOMPONENTS_LEAST_IMPORTS
strategy and aTranslationUnitPass
is executed according to first theCOMPONENTS_LEAST_IMPORTS
and then theTRANSLATION_UNITS_LEAST_IMPORTS
inside the component. This should make it harmonised for all passes.The most important pass to use that is the
SymbolResolver
, which now resolves symbols of components in the desired order as preparation needed for #2006.Because the
ImportResolver
populates this map, it cannot use this strategy and I had to promote this to aTranslationResultPass
, which I think is ok. It still gathers the information on a component level, just the entry point is the translation result.