This repository has been archived by the owner on Mar 20, 2024. It is now read-only.
Wrap rttydesc module in a RttyContext; simplify; clean-up. #239
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 patch gives module
rttydesc
its own contextRttyContext
. The new context holds ubiquitously used values (e.g.,llvm::Context
,llvm::Module
) so that each can be easily referenced up and down the call stack. Previously these values were passed down (potentially) entire call chains and was becoming unwieldly. The various function parameter lists are now generally shorter as well. Parametertype_display_context
is now entirely absent, where it once was passed to nearly every function to gain access in a leaf routine.Move
ll_struct_name_from_raw_name
andstruct_raw_type_name
intoextensions::StructEnv::{ll_struct_name_from_raw_name, struct_raw_type_name}
. This breaks the dependece onModuleContext
but is also cleaner.This diffs appear large in rttydesc.rs, but that is largely just re-indentation that the auto-formatters did when the module was encapsulated in
RttyContext
.