'Exclude directives that are not loaded into the configuration.'

def _exclude_dirs(self, matches):

    filters = [('ifmodule', self.modules), ('ifdefine', self.variables)]
    valid_matches = []
    for match in matches:
        for filter_ in filters:
            if (not self._pass_filter(match, filter_)):
                break
        else:
            valid_matches.append(match)
    return valid_matches
