Skip to content

Commit

Permalink
Make skipping the parse_headers action also conditional on a crosstoo…
Browse files Browse the repository at this point in the history
…l feature.

Not all crosstools might sufficiently validate layering_check otherwise,
e.g. Clang needs a version that includes https://reviews.llvm.org/D132779.

PiperOrigin-RevId: 483907290
Change-Id: I5a9994258f2345ea390b028fb15859c6c9484794
  • Loading branch information
djasper authored and copybara-github committed Oct 26, 2022
1 parent c940bb2 commit 8ef60d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1566,6 +1566,7 @@ private CcCompilationOutputs createCcCompileActions() throws RuleErrorException
continue;
}
if (cppConfiguration.getParseHeadersSkippedIfCorrespondingSrcsFound()
&& featureConfiguration.isEnabled(CppRuleClasses.VALIDATES_LAYERING_CHECK_IN_TEXTUAL_HDRS)
&& compiledBasenames.contains(
Files.getNameWithoutExtension(artifact.getExecPathString()))) {
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,15 @@ public static ToolchainTypeRequirement ccToolchainTypeRequirement(RuleDefinition
/** A string constant for the layering_check feature. */
public static final String LAYERING_CHECK = "layering_check";

/**
* A string constant that signifies whether the crosstool validates layering_check in
* textual_hdrs. We use the compiler's definition of textual_hdrs also for all regular but
* non-modular headers. This in turn means that the compiler can check layering in headers of the
* same target, irrespective the PARSE_HEADERS feature and we can elide separate header actions.
*/
public static final String VALIDATES_LAYERING_CHECK_IN_TEXTUAL_HDRS =
"validates_layering_check_in_textual_hdrs";

/** A string constant for the header_modules feature. */
public static final String HEADER_MODULES = "header_modules";

Expand Down

0 comments on commit 8ef60d0

Please sign in to comment.