diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationContext.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationContext.java index b2f1e4e2a31278..83fe985bdd21fb 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationContext.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationContext.java @@ -438,12 +438,6 @@ public IncludeScanningHeaderData.Builder createIncludeScanningHeaderData( treeArtifacts, isModule, modularHeaders); - handleHeadersForIncludeScanning( - transitiveHeaderInfo.separateModuleHeaders, - pathToLegalArtifact, - treeArtifacts, - isModule, - modularHeaders); handleHeadersForIncludeScanning( transitiveHeaderInfo.textualHeaders, pathToLegalArtifact, @@ -458,7 +452,6 @@ public IncludeScanningHeaderData.Builder createIncludeScanningHeaderData( transitiveHeaderCount.compareAndSet(-1, pathToLegalArtifact.size()); removeArtifactsFromSet(modularHeaders, headerInfo.modularHeaders); removeArtifactsFromSet(modularHeaders, headerInfo.textualHeaders); - removeArtifactsFromSet(modularHeaders, headerInfo.separateModuleHeaders); return new IncludeScanningHeaderData.Builder(pathToLegalArtifact, modularHeaders); } @@ -467,13 +460,11 @@ public IncludeScanningHeaderData.Builder createIncludeScanningHeaderData( * the modules that they are in. */ public Collection computeUsedModules( - boolean usePic, Set includes, boolean separate) { + boolean usePic, Set includes) { CompactHashSet modules = CompactHashSet.create(); for (HeaderInfo transitiveHeaderInfo : headerInfo.getTransitiveCollection()) { Artifact.DerivedArtifact module = transitiveHeaderInfo.getModule(usePic); if (module == null) { - // If we don't have a main module, there is also not going to be a separate module. This is - // verified when constructing HeaderInfo instances. continue; } // Not using range-based for loops here as often there is exactly one element in this list @@ -485,18 +476,11 @@ public Collection computeUsedModules( break; } } - for (int i = 0; i < transitiveHeaderInfo.separateModuleHeaders.size(); i++) { - Artifact header = transitiveHeaderInfo.separateModuleHeaders.get(i); - if (includes.contains(header)) { - modules.add(transitiveHeaderInfo.getSeparateModule(usePic)); - break; - } - } } // Do not add the module of the current rule for both: // 1. the module compile itself // 2. compiles of other translation units of the same rule. - modules.remove(separate ? headerInfo.getSeparateModule(usePic) : headerInfo.getModule(usePic)); + modules.remove(headerInfo.getModule(usePic)); return modules; } @@ -537,28 +521,15 @@ public Iterable getDirectModuleMaps() { return directModuleMaps; } - Artifact.DerivedArtifact getHeaderModule(boolean usePic) { - return headerInfo.getModule(usePic); - } - - Artifact.DerivedArtifact getSeparateHeaderModule(boolean usePic) { - return headerInfo.getSeparateModule(usePic); - } - /** * @return all declared headers of the current module if the current target is compiled as a * module. */ - ImmutableList getHeaderModuleSrcs(boolean separateModule) { - if (separateModule) { - return headerInfo.separateModuleHeaders; - } + ImmutableSet getHeaderModuleSrcs() { return new ImmutableSet.Builder() .addAll(headerInfo.modularHeaders) .addAll(headerInfo.textualHeaders) - .addAll(headerInfo.separateModuleHeaders) - .build() - .asList(); + .build(); } /** @@ -752,14 +723,14 @@ public Builder mergeDependentCcCompilationContext( looseHdrsDirs.addTransitive(otherCcCompilationContext.getLooseHdrsDirs()); declaredIncludeSrcs.addTransitive(otherCcCompilationContext.getDeclaredIncludeSrcs()); headerInfoBuilder.addDep(otherCcCompilationContext.headerInfo); - transitiveModules.addTransitive(otherCcCompilationContext.transitiveModules); - addIfNotNull(transitiveModules, otherCcCompilationContext.headerInfo.headerModule); - addIfNotNull(transitiveModules, otherCcCompilationContext.headerInfo.separateModule); - + if (otherCcCompilationContext.headerInfo.headerModule != null) { + transitiveModules.add(otherCcCompilationContext.headerInfo.headerModule); + } transitivePicModules.addTransitive(otherCcCompilationContext.transitivePicModules); - addIfNotNull(transitivePicModules, otherCcCompilationContext.headerInfo.picHeaderModule); - addIfNotNull(transitivePicModules, otherCcCompilationContext.headerInfo.separatePicModule); + if (otherCcCompilationContext.headerInfo.picHeaderModule != null) { + transitivePicModules.add(otherCcCompilationContext.headerInfo.picHeaderModule); + } nonCodeInputs.addTransitive(otherCcCompilationContext.nonCodeInputs); @@ -779,13 +750,6 @@ public Builder mergeDependentCcCompilationContext( return this; } - private static void addIfNotNull( - NestedSetBuilder builder, @Nullable Artifact artifact) { - if (artifact != null) { - builder.add(artifact); - } - } - /** * Merges the given {@code CcCompilationContext}s into this one by adding the contents of their * attributes. @@ -927,14 +891,6 @@ public Builder addTextualHdrs(Collection headers) { return this; } - public Builder setSeparateModuleHdrs( - Collection headers, - Artifact.DerivedArtifact separateModule, - Artifact.DerivedArtifact separatePicModule) { - this.headerInfoBuilder.setSeparateModuleHdrs(headers, separateModule, separatePicModule); - return this; - } - /** Add a set of required non-code compilation input. */ public Builder addNonCodeInputs(Iterable inputs) { nonCodeInputs.addAll(inputs); @@ -1150,12 +1106,6 @@ public static final class HeaderInfo { /** All textual header files that are contained in this module. */ private final ImmutableList textualHeaders; - /** Headers that can be compiled into a separate, smaller module for performance reasons. */ - private final ImmutableList separateModuleHeaders; - - private final Artifact.DerivedArtifact separateModule; - private final Artifact.DerivedArtifact separatePicModule; - /** HeaderInfos of direct dependencies of C++ target represented by this context. */ private final ImmutableList deps; @@ -1168,9 +1118,6 @@ public static final class HeaderInfo { ImmutableList modularPublicHeaders, ImmutableList modularPrivateHeaders, ImmutableList textualHeaders, - ImmutableList separateModuleHeaders, - Artifact.DerivedArtifact separateModule, - Artifact.DerivedArtifact separatePicModule, ImmutableList deps) { this.headerModule = headerModule; this.picHeaderModule = picHeaderModule; @@ -1179,9 +1126,6 @@ public static final class HeaderInfo { this.modularHeaders = ImmutableList.copyOf(Iterables.concat(modularPublicHeaders, modularPrivateHeaders)); this.textualHeaders = textualHeaders; - this.separateModuleHeaders = separateModuleHeaders; - this.separateModule = separateModule; - this.separatePicModule = separatePicModule; this.deps = deps; } @@ -1189,10 +1133,6 @@ Artifact.DerivedArtifact getModule(boolean pic) { return pic ? picHeaderModule : headerModule; } - Artifact.DerivedArtifact getSeparateModule(boolean pic) { - return pic ? separatePicModule : separateModule; - } - public Collection getTransitiveCollection() { if (deps.isEmpty()) { return ImmutableList.of(this); @@ -1292,9 +1232,6 @@ public static class Builder { private final Set modularPublicHeaders = new HashSet<>(); private final Set modularPrivateHeaders = new HashSet<>(); private final Set textualHeaders = new HashSet<>(); - private Collection separateModuleHeaders = ImmutableList.of(); - private Artifact.DerivedArtifact separateModule = null; - private Artifact.DerivedArtifact separatePicModule = null; private final List deps = new ArrayList<>(); Builder setHeaderModule(Artifact.DerivedArtifact headerModule) { @@ -1343,16 +1280,6 @@ public Builder addTextualHeaders(Collection headers) { return this; } - public Builder setSeparateModuleHdrs( - Collection headers, - Artifact.DerivedArtifact separateModule, - Artifact.DerivedArtifact separatePicModule) { - this.separateModuleHeaders = headers; - this.separateModule = separateModule; - this.separatePicModule = separatePicModule; - return this; - } - /** Adds the headers of the given {@code HeaderInfo} into the one being built. */ public Builder mergeHeaderInfo(HeaderInfo otherHeaderInfo) { this.modularPublicHeaders.addAll(otherHeaderInfo.modularPublicHeaders); @@ -1362,21 +1289,12 @@ public Builder mergeHeaderInfo(HeaderInfo otherHeaderInfo) { } public HeaderInfo build() { - Preconditions.checkState( - (separateModule == null || headerModule != null) - && (separatePicModule == null || picHeaderModule != null), - "Separate module cannot be used without main module", - separateModule, - separatePicModule); return new HeaderInfo( headerModule, picHeaderModule, ImmutableList.copyOf(modularPublicHeaders), ImmutableList.copyOf(modularPrivateHeaders), ImmutableList.copyOf(textualHeaders), - ImmutableList.copyOf(separateModuleHeaders), - separateModule, - separatePicModule, ImmutableList.copyOf(deps)); } } diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java index 9f43505ac28c2a..d290da8d145680 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java @@ -50,7 +50,6 @@ import com.google.devtools.build.lib.util.Pair; import com.google.devtools.build.lib.vfs.FileSystemUtils; import com.google.devtools.build.lib.vfs.PathFragment; -import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -243,7 +242,6 @@ public CcCompilationContext getCcCompilationContext() { private final boolean shouldProcessHeaders; private final List publicHeaders = new ArrayList<>(); - private final List separateModuleHeaders = new ArrayList<>(); private final List nonModuleMapHeaders = new ArrayList<>(); private final List publicTextualHeaders = new ArrayList<>(); private final List privateHeaders = new ArrayList<>(); @@ -381,21 +379,6 @@ public CcCompilationHelper addPublicHeaders(Collection headers) { return this; } - /** - * Adds headers that are compiled into a separate module (when using C++ modules). The idea here - * is that a single (generated) library might want to create headers of very different transitive - * dependency size. In this case, building headers with very few transitive dependencies into a - * separate module can drastrically improve build performance of that module and its users. - * - *

Headers in this separate module must not include any of the regular headers. - * - *

THIS IS AN EXPERIMENTAL FACILITY THAT MIGHT GO AWAY. - */ - public CcCompilationHelper addSeparateModuleHeaders(Collection headers) { - separateModuleHeaders.addAll(headers); - return this; - } - /** * Adds {@code headers} as public header files. These files will be made visible to dependent * rules. They may be parsed/preprocessed or compiled into a header module depending on the @@ -1048,7 +1031,6 @@ private CcCompilationContext initializeCcCompilationContext(RuleContext ruleCont // There are no ordering constraints for declared include dirs/srcs. ccCompilationContextBuilder.addDeclaredIncludeSrcs(publicHeaders.getHeaders()); ccCompilationContextBuilder.addDeclaredIncludeSrcs(publicTextualHeaders); - ccCompilationContextBuilder.addDeclaredIncludeSrcs(separateModuleHeaders); ccCompilationContextBuilder.addDeclaredIncludeSrcs(privateHeaders); ccCompilationContextBuilder.addDeclaredIncludeSrcs(additionalInputs); ccCompilationContextBuilder.addNonCodeInputs(additionalInputs); @@ -1095,20 +1077,12 @@ private CcCompilationContext initializeCcCompilationContext(RuleContext ruleCont actionRegistry.registerAction( createModuleMapAction(cppModuleMap, publicHeaders, dependentModuleMaps, compiled)); } - Artifact mapArtifact = cppModuleMap.getArtifact(); if (getGeneratesPicHeaderModule()) { - ccCompilationContextBuilder.setPicHeaderModule(getPicHeaderModule(mapArtifact, "")); + ccCompilationContextBuilder.setPicHeaderModule( + getPicHeaderModule(cppModuleMap.getArtifact())); } if (getGeneratesNoPicHeaderModule()) { - ccCompilationContextBuilder.setHeaderModule(getHeaderModule(mapArtifact, "")); - } - if (!separateModuleHeaders.isEmpty() - && (getGeneratesPicHeaderModule() || getGeneratesNoPicHeaderModule())) { - String suffix = CppModuleMap.SEPARATE_MODULE_SUFFIX; - ccCompilationContextBuilder.setSeparateModuleHdrs( - separateModuleHeaders, - getGeneratesNoPicHeaderModule() ? getHeaderModule(mapArtifact, suffix) : null, - getGeneratesPicHeaderModule() ? getPicHeaderModule(mapArtifact, suffix) : null); + ccCompilationContextBuilder.setHeaderModule(getHeaderModule(cppModuleMap.getArtifact())); } } ccCompilationContextBuilder.setPurpose(purpose); @@ -1183,7 +1157,6 @@ private CppModuleMapAction createModuleMapAction( : publicHeaders.getModuleMapHeaders(), dependentModuleMaps, additionalExportedHeaders, - separateModuleHeaders, compiledModule, featureConfiguration.isEnabled(CppRuleClasses.MODULE_MAP_HOME_CWD), featureConfiguration.isEnabled(CppRuleClasses.GENERATE_SUBMODULES), @@ -1247,21 +1220,21 @@ private boolean shouldProvideHeaderModules() { } /** @return the no-PIC header module artifact for the current target. */ - private Artifact.DerivedArtifact getHeaderModule(Artifact moduleMapArtifact, String suffix) { + private Artifact.DerivedArtifact getHeaderModule(Artifact moduleMapArtifact) { PathFragment objectDir = CppHelper.getObjDirectory(label, configuration.isSiblingRepositoryLayout()); PathFragment outputName = objectDir.getRelative(moduleMapArtifact.getRootRelativePath().getBaseName()); - return actionConstructionContext.getRelatedArtifact(outputName, suffix + ".pcm"); + return actionConstructionContext.getRelatedArtifact(outputName, ".pcm"); } /** @return the pic header module artifact for the current target. */ - private Artifact.DerivedArtifact getPicHeaderModule(Artifact moduleMapArtifact, String suffix) { + private Artifact.DerivedArtifact getPicHeaderModule(Artifact moduleMapArtifact) { PathFragment objectDir = CppHelper.getObjDirectory(label, configuration.isSiblingRepositoryLayout()); PathFragment outputName = objectDir.getRelative(moduleMapArtifact.getRootRelativePath().getBaseName()); - return actionConstructionContext.getRelatedArtifact(outputName, suffix + ".pic.pcm"); + return actionConstructionContext.getRelatedArtifact(outputName, ".pic.pcm"); } /** @@ -1354,19 +1327,12 @@ private CcCompilationOutputs createCcCompileActions() throws RuleErrorException Preconditions.checkNotNull(ccCompilationContext); if (shouldProvideHeaderModules()) { - CppModuleMap cppModuleMap = ccCompilationContext.getCppModuleMap(); - Label moduleMapLabel = Label.parseAbsoluteUnchecked(cppModuleMap.getName()); - Collection modules = createModuleAction(result, cppModuleMap); - Collection separateModules = ImmutableList.of(); - if (!separateModuleHeaders.isEmpty()) { - CppModuleMap separateMap = - new CppModuleMap( - cppModuleMap.getArtifact(), - cppModuleMap.getName() + CppModuleMap.SEPARATE_MODULE_SUFFIX); - separateModules = createModuleAction(result, separateMap); - } + Label moduleMapLabel = + Label.parseAbsoluteUnchecked(ccCompilationContext.getCppModuleMap().getName()); + Collection modules = + createModuleAction(result, ccCompilationContext.getCppModuleMap()); if (featureConfiguration.isEnabled(CppRuleClasses.HEADER_MODULE_CODEGEN)) { - for (Artifact module : Iterables.concat(modules, separateModules)) { + for (Artifact module : modules) { // TODO(djasper): Investigate whether we need to use a label separate from that of the // module map. It is used for per-file-copts. createModuleCodegenAction(result, moduleMapLabel, module); @@ -1804,20 +1770,19 @@ private void createHeaderAction( result.addHeaderTokenFile(tokenFile); } - private ImmutableList createModuleAction( + private Collection createModuleAction( CcCompilationOutputs.Builder result, CppModuleMap cppModuleMap) throws RuleErrorException { Artifact moduleMapArtifact = cppModuleMap.getArtifact(); CppCompileActionBuilder builder = initializeCompileAction(moduleMapArtifact); builder.setSemantics(semantics); - Label label = Label.parseAbsoluteUnchecked(cppModuleMap.getName()); // A header module compile action is just like a normal compile action, but: // - the compiled source file is the module map // - it creates a header module (.pcm file). return createSourceAction( - label, - Paths.get(label.getName()).getFileName().toString(), + Label.parseAbsoluteUnchecked(cppModuleMap.getName()), + FileSystemUtils.removeExtension(moduleMapArtifact.getRootRelativePath()).getBaseName(), result, moduleMapArtifact, builder, @@ -1829,7 +1794,7 @@ private ImmutableList createModuleAction( /* bitcodeOutput= */ false); } - private ImmutableList createSourceAction( + private Collection createSourceAction( Label sourceLabel, String outputName, CcCompilationOutputs.Builder result, @@ -1871,7 +1836,7 @@ private ImmutableList createSourceAction( sourceLabel, /* usePic= */ true, /* needsFdoBuildVariables= */ ccRelativeName != null, - cppModuleMap, + ccCompilationContext.getCppModuleMap(), gcnoFile, generateDwo, dwoFile, diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java index fdedc638ee420e..a04c4bcc200865 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java @@ -493,9 +493,7 @@ public NestedSet discoverInputs(ActionExecutionContext actionExecution } if (useHeaderModules) { - boolean separate = outputFile.equals(ccCompilationContext.getSeparateHeaderModule(usePic)); - usedModules = - ccCompilationContext.computeUsedModules(usePic, additionalInputs.toSet(), separate); + usedModules = ccCompilationContext.computeUsedModules(usePic, additionalInputs.toSet()); } } @@ -796,23 +794,17 @@ private List getCmdlineIncludes(List args) { @Override public Artifact getMainIncludeScannerSource() { - // getIncludeScannerSources() needs to return the main file first. This is used for determining - // what file command line includes should be interpreted relative to. - return getIncludeScannerSources().get(0); + return getSourceFile().isFileType(CppFileTypes.CPP_MODULE_MAP) + ? Iterables.getFirst(ccCompilationContext.getHeaderModuleSrcs(), null) + : getSourceFile(); } @Override - public ImmutableList getIncludeScannerSources() { + public Collection getIncludeScannerSources() { if (getSourceFile().isFileType(CppFileTypes.CPP_MODULE_MAP)) { - boolean isSeparate = outputFile.equals(ccCompilationContext.getSeparateHeaderModule(usePic)); - Preconditions.checkState( - outputFile.equals(ccCompilationContext.getHeaderModule(usePic)) || isSeparate, - "Trying to build unknown module", - outputFile); - // If this is an action that compiles the header module itself, the source we build is the // module map, and we need to include-scan all headers that are referenced in the module map. - return ccCompilationContext.getHeaderModuleSrcs(isSeparate); + return ccCompilationContext.getHeaderModuleSrcs(); } ImmutableList.Builder builder = ImmutableList.builder(); builder.add(getSourceFile()); diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppModuleMap.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppModuleMap.java index a40bca5dcc5bc0..e98338505c5022 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppModuleMap.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppModuleMap.java @@ -26,8 +26,6 @@ @Immutable @AutoCodec public final class CppModuleMap implements CppModuleMapApi { - public static final String SEPARATE_MODULE_SUFFIX = ".sep"; - // NOTE: If you add a field here, you'll likely need to update CppModuleMapAction.computeKey(). private final Artifact artifact; private final String name; diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppModuleMapAction.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppModuleMapAction.java index 85e428b7d6050a..6e0e2edcb7bb05 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppModuleMapAction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppModuleMapAction.java @@ -65,7 +65,6 @@ public final class CppModuleMapAction extends AbstractFileWriteAction { private final ImmutableList publicHeaders; private final ImmutableList dependencies; private final ImmutableList additionalExportedHeaders; - private final ImmutableList separateModuleHeaders; private final boolean compiledModule; private final boolean generateSubmodules; private final boolean externDependencies; @@ -77,7 +76,6 @@ public CppModuleMapAction( Iterable publicHeaders, Iterable dependencies, Iterable additionalExportedHeaders, - Iterable separateModuleHeaders, boolean compiledModule, boolean moduleMapHomeIsCwd, boolean generateSubmodules, @@ -99,7 +97,6 @@ public CppModuleMapAction( this.publicHeaders = ImmutableList.copyOf(publicHeaders); this.dependencies = ImmutableList.copyOf(dependencies); this.additionalExportedHeaders = ImmutableList.copyOf(additionalExportedHeaders); - this.separateModuleHeaders = ImmutableList.copyOf(separateModuleHeaders); this.compiledModule = compiledModule; this.generateSubmodules = generateSubmodules; this.externDependencies = externDependencies; @@ -115,13 +112,10 @@ public void writeOutputFile(OutputStream out) throws IOException { PathFragment fragment = cppModuleMap.getArtifact().getExecPath(); int segmentsToExecPath = fragment.segmentCount() - 1; Optional umbrellaHeader = cppModuleMap.getUmbrellaHeader(); - String leadingPeriods = moduleMapHomeIsCwd ? "" : Strings.repeat("../", segmentsToExecPath); - - Iterable separateModuleHdrs = - expandedHeaders(artifactExpander, separateModuleHeaders); // For details about the different header types, see: // http://clang.llvm.org/docs/Modules.html#header-declaration + String leadingPeriods = moduleMapHomeIsCwd ? "" : Strings.repeat("../", segmentsToExecPath); content.append("module \"").append(cppModuleMap.getName()).append("\" {\n"); content.append(" export *\n"); @@ -156,16 +150,6 @@ public void writeOutputFile(OutputStream out) throws IOException { deduper, /*isUmbrellaHeader*/ false); } - for (Artifact artifact : separateModuleHdrs) { - appendHeader( - content, - "", - artifact.getExecPath(), - leadingPeriods, - /*canCompile=*/ false, - deduper, - /*isUmbrellaHeader*/ false); - } for (PathFragment additionalExportedHeader : additionalExportedHeaders) { appendHeader( content, @@ -180,30 +164,7 @@ public void writeOutputFile(OutputStream out) throws IOException { for (CppModuleMap dep : dependencies) { content.append(" use \"").append(dep.getName()).append("\"\n"); } - - if (!Iterables.isEmpty(separateModuleHdrs)) { - String separateName = cppModuleMap.getName() + CppModuleMap.SEPARATE_MODULE_SUFFIX; - content.append(" use \"").append(separateName).append("\"\n"); - content.append("}\n"); - content.append("module \"").append(separateName).append("\" {\n"); - content.append(" export *\n"); - deduper = new HashSet<>(); - for (Artifact artifact : separateModuleHdrs) { - appendHeader( - content, - "", - artifact.getExecPath(), - leadingPeriods, - /*canCompile=*/ true, - deduper, - /*isUmbrellaHeader*/ false); - } - for (CppModuleMap dep : dependencies) { - content.append(" use \"").append(dep.getName()).append("\"\n"); - } - } content.append("}"); - if (externDependencies) { for (CppModuleMap dep : dependencies) { content @@ -286,10 +247,6 @@ protected void computeKey( for (Artifact artifact : publicHeaders) { fp.addPath(artifact.getExecPath()); } - fp.addInt(separateModuleHeaders.size()); - for (Artifact artifact : separateModuleHeaders) { - fp.addPath(artifact.getExecPath()); - } fp.addInt(dependencies.size()); for (CppModuleMap dep : dependencies) { fp.addPath(dep.getArtifact().getExecPath()); @@ -316,12 +273,12 @@ public CppModuleMap getCppModuleMap() { } @VisibleForTesting - public ImmutableList getPublicHeaders() { + public Collection getPublicHeaders() { return publicHeaders; } @VisibleForTesting - public ImmutableList getPrivateHeaders() { + public Collection getPrivateHeaders() { return privateHeaders; } @@ -330,11 +287,6 @@ public ImmutableList getAdditionalExportedHeaders() { return additionalExportedHeaders; } - @VisibleForTesting - public ImmutableList getSeparateModuleHeaders() { - return separateModuleHeaders; - } - @VisibleForTesting public Collection getDependencyArtifacts() { List artifacts = new ArrayList<>(); diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java index 5a394fd01b1b74..a2632d11a9c2f0 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java @@ -1671,11 +1671,10 @@ public CompilationSupport registerGenerateModuleMapAction( new CppModuleMapAction( ruleContext.getActionOwner(), moduleMap, - ImmutableList.of(), + ImmutableList.of(), publicHeaders, attributes.moduleMapsForDirectDeps().toList(), - ImmutableList.of(), - ImmutableList.of(), + ImmutableList.of(), /* compiledModule= */ true, /* moduleMapHomeIsCwd= */ false, /* generateSubmodules= */ false,