summaryrefslogtreecommitdiff
path: root/src/regex_set.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-04-10 13:10:22 -0500
committerGitHub <noreply@github.com>2017-04-10 13:10:22 -0500
commita22ddba19a16cd1abb59c2cce73cabb459ff9b46 (patch)
treee51fc04c8acccca2e52a558d128eff5c06e7fbff /src/regex_set.rs
parent26eeb6db16a0c91f753063a720f4dde5be4ca565 (diff)
parentc8a206adad0fc333b5f9aba410b7f4cccae77a22 (diff)
Auto merge of #623 - fitzgen:issue-584-stylo-blacklisting-in-template-analysis, r=emilio
Correctly handle blacklisted items in the template analysis The template analysis operates on whitelisted items, and uses our tracing infrastructure to move between them. Usually, that means we can only reach other whitelisted items by tracing, because the set of whitelisted items is the transitive closure of all the items explicitly whitelisted. The exception is when some type is explicitly blacklisted. It could still be reachable via tracing from a whitelisted item, but is not considered whitelisted due to the blacklisting. The easy fix is to run the template analysis on the whole IR graph rather than just the whitelisted set. This is an approximately one line change in the analysis, however is not desirable due to performance concerns. The whole point of whitelisting is that there may be *many* types in a header, but only a *few* the user cares about, or there might be types that aren't explicitly needed and that are too complicated for bindgen to handle generally (often in `<type_traits>`). In these situations, we don't want to waste cycles or even confuse ourselves by considering such types! Instead, we keep the whitelisted item set around and check by hand whether any given item is in it during the template type parameter analysis. Additionally, we make the decision that blacklisted template definitions use all of their type parameters. This seems like a reasonable choice because the type will likely be ported to Rust manually by the bindgen user, and they will be looking at the C++ definition with all of its type parameters. They can always insert `PhantomData`s manually, so it also gives the most flexibility. Fixes #584 r? @emilio
Diffstat (limited to 'src/regex_set.rs')
0 files changed, 0 insertions, 0 deletions