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.
Figuring out whether a given override should apply to a given
define
or
declare
in an LLVM module is not as easy as seeing if their namesmatch. For some C++ overrides, for example, checking if the override
should apply requires demangling the function name, which is an
expensive proposition.
For this reason, override matching happens in two "phases" in
Crucible-LLVM: first, there is an initial, fast, string-based
TemplateMatcher
that is used to filter out overrides that definitelydon't apply. Then, if any remain, there is a second phase that
inspects the declaration in more detail to see if the override matches.
Previously, this second phase consisted of a
RegOverrideM
(i.e.,OverrideSim
) action that would actually perform the registration.This is unnecessarily flexible. The second phase is only really supposed
to perform the inspection of the declaration, construct an override, and
register it. Therefore, it's been replaced by a pure function that
returns a
Maybe (SomeLLVMOverride ...)
, which can then be registeredby client code, if desired.
This more restrictive type should help clarify the intent of the
override matching code, and reduce the potential for superfluous use
of
OverrideSim
effects.