Skip to content

Const suggestion check: build the Clang invocation in one function #249

Open

Description

@SizzleUnrlsd

Follow-up of #217 and #239 (plan Task 3.2, partly done).

The experimental const suggestion check (--experimental-const-suggestion-check) builds a Clang invocation from a unit's compile command in two places of src/analysis/ConstSuggestionFacts.cpp: the compilation that collects a unit's facts (inspect) and the identifier scan of the files of the compilation database. Both copy the arguments into argv, create the diagnostics and call clang::createInvocation with the same options; only the diagnostic consumer differs.

Build that invocation in one function used by both, reusing the existing path normalization of compile commands.

Not a cost fix: on the self-analysis the single construction was measured under 1 s, below the noise. The +10 % cost criterion of #217 is not met, and this follow-up does not change that.

Validation: outputs identical before and after (the suite, the T tests, the corpora with the option).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions