Skip to content

Commit

Permalink
Make gcno-files available in CcCompilationOutputs
Browse files Browse the repository at this point in the history
This is needed to do custom code coverage rules.
  • Loading branch information
torgil committed Jan 23, 2023
1 parent 761b280 commit 362dc09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1960,10 +1960,8 @@ private ImmutableList<Artifact> createSourceAction(
CppHelper.getArtifactNameForCategory(
ccToolchain, ArtifactCategory.COVERAGE_DATA_FILE, picOutputBase);
Artifact gcnoFile =
enableCoverage
? CppHelper.getCompileOutputArtifact(
actionConstructionContext, label, gcnoFileName, configuration)
: null;
CppHelper.getCompileOutputArtifact(
actionConstructionContext, label, gcnoFileName, configuration);
Artifact dwoFile =
generateDwo && !bitcodeOutput ? getDwoFile(picBuilder.getOutputFile()) : null;
Artifact ltoIndexingFile =
Expand Down Expand Up @@ -2032,10 +2030,8 @@ private ImmutableList<Artifact> createSourceAction(

// Create no-PIC compile actions
Artifact gcnoFile =
enableCoverage
? CppHelper.getCompileOutputArtifact(
actionConstructionContext, label, gcnoFileName, configuration)
: null;
CppHelper.getCompileOutputArtifact(
actionConstructionContext, label, gcnoFileName, configuration);

Artifact noPicDwoFile = generateDwo && !bitcodeOutput ? getDwoFile(noPicOutputFile) : null;
Artifact ltoIndexingFile = bitcodeOutput ? getLtoIndexingFile(builder.getOutputFile()) : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,11 @@ public ImmutableList<Artifact> getPicDwoFiles() {

@Override
public Sequence<Artifact> getStarlarkGcnoFiles(StarlarkThread thread) throws EvalException {
CcModule.checkPrivateStarlarkificationAllowlist(thread);
return StarlarkList.immutableCopyOf(getGcnoFiles());
}

@Override
public Sequence<Artifact> getStarlarkPicGcnoFiles(StarlarkThread thread) throws EvalException {
CcModule.checkPrivateStarlarkificationAllowlist(thread);
return StarlarkList.immutableCopyOf(getPicGcnoFiles());
}

Expand Down

0 comments on commit 362dc09

Please sign in to comment.