From c72643c91cc21615c128500f8776dd53df1f7346 Mon Sep 17 00:00:00 2001 From: Googler Date: Fri, 5 May 2023 01:49:19 -0700 Subject: [PATCH] Automatic code cleanup. PiperOrigin-RevId: 529653758 Change-Id: Iea7197c3251a87f91205948637bf9e0cea25f18a --- .../build/lib/rules/cpp/ArtifactCategory.java | 4 ---- .../lib/rules/cpp/CcCompilationOutputs.java | 7 ------- .../build/lib/rules/cpp/CcLinkingContext.java | 13 ------------- .../build/lib/rules/cpp/CcLinkingOutputs.java | 17 ----------------- .../lib/rules/cpp/CcToolchainVariables.java | 5 ----- 5 files changed, 46 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/ArtifactCategory.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/ArtifactCategory.java index e726c63b59e5bd..a278c938642f9a 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/ArtifactCategory.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/ArtifactCategory.java @@ -63,10 +63,6 @@ public enum ArtifactCategory { this.starlarkName = toString().toLowerCase(); } - public String getStarlarkName() { - return starlarkName; - } - /** Returns the name of the category. */ public String getCategoryName() { return this.toString().toLowerCase(); diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationOutputs.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationOutputs.java index 0f050f4b314ebe..5df5b73319532c 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationOutputs.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationOutputs.java @@ -97,13 +97,6 @@ private CcCompilationOutputs( this.headerTokenFiles = headerTokenFiles; } - /** - * Returns whether this set of outputs has any object or .pic object files. - */ - public boolean isEmpty() { - return picObjectFiles.isEmpty() && objectFiles.isEmpty(); - } - /** * Returns an unmodifiable view of the .o or .pic.o files set. * diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingContext.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingContext.java index d8c6fae57a5a88..423fd026ce5746 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingContext.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingContext.java @@ -303,12 +303,6 @@ public static class Builder { private final ImmutableList.Builder nonCodeInputs = ImmutableList.builder(); private final ImmutableList.Builder linkstamps = ImmutableList.builder(); - @CanIgnoreReturnValue - public Builder addLibrary(LibraryToLink library) { - this.libraries.add(library); - return this; - } - @CanIgnoreReturnValue public Builder addLibraries(List libraries) { this.libraries.addAll(libraries); @@ -557,13 +551,6 @@ public Builder setOwner(Label owner) { return this; } - @CanIgnoreReturnValue - public Builder addLibrary(LibraryToLink library) { - hasDirectLinkerInput = true; - linkerInputBuilder.addLibrary(library); - return this; - } - @CanIgnoreReturnValue public Builder addLibraries(List libraries) { hasDirectLinkerInput = true; diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingOutputs.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingOutputs.java index e4d8a7070334c8..c7e704df458d23 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingOutputs.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingOutputs.java @@ -14,9 +14,7 @@ package com.google.devtools.build.lib.rules.cpp; -import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableSetMultimap; import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.starlarkbuildapi.cpp.CcLinkingOutputsApi; import com.google.devtools.build.lib.vfs.FileSystemUtils; @@ -73,21 +71,6 @@ public boolean isEmpty() { return libraryToLink == null; } - /** - * Gathers up a map from library identifiers to sets of LibraryToLink which share that library - * identifier. - */ - public static ImmutableSetMultimap getLibrariesByIdentifier( - Iterable inputs) { - ImmutableSetMultimap.Builder result = - new ImmutableSetMultimap.Builder<>(); - for (LinkerInputs.LibraryToLink library : inputs) { - Preconditions.checkNotNull(library.getLibraryIdentifier()); - result.put(library.getLibraryIdentifier(), library); - } - return result.build(); - } - private static final ImmutableList PIC_SUFFIXES = ImmutableList.of(".pic.a", ".nopic.a", ".pic.lo"); diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainVariables.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainVariables.java index 924a0fc371162a..95cb7f2597f1be 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainVariables.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainVariables.java @@ -186,11 +186,6 @@ public ImmutableList getChunks() { return chunks.build(); } - /** @return all variable names needed to expand this string. */ - ImmutableSet getUsedVariables() { - return usedVariables.build(); - } - /** * Parses the string. *