Ensure that Xref does not see Debugger as a dependency for Kernel #4554
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.
The
error_handler
module in the Kernel application has a call to theint
module in the Debugger application. That call is only there tomake the Debugger work. To avoid that Xref sees Debugger as a
dependency for Kernel, the call to the
int
module is obfuscated inthe following way:
That is, the call will show up as a call to an unknown module in
Xref.
With the improved whole-module type analysis introduced in
294d66a (#2100), the compiler sees through the obfuscation
and rewrites the code to:
It would be fun to solve this issue by introducing further obfuscations,
but such tricks could stop working in the future when the compiler is
improved. Instead, turn off whole-module type analysis by compiling
the module with the
no_module_opt
option.Resolves #4546