Skip to content

Commit e5b3536

Browse files
Googlercopybara-github
authored andcommitted
Delete non-interning, non-singleton @AutoCodec.
PiperOrigin-RevId: 410130440
1 parent 9e9d7bf commit e5b3536

File tree

4 files changed

+23
-85
lines changed

4 files changed

+23
-85
lines changed

src/main/java/com/google/devtools/build/lib/actions/FileArtifactValue.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import com.google.common.io.BaseEncoding;
2323
import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
2424
import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
25-
import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec;
25+
import com.google.devtools.build.lib.skyframe.serialization.autocodec.SerializationConstant;
2626
import com.google.devtools.build.lib.util.Fingerprint;
2727
import com.google.devtools.build.lib.vfs.DigestUtils;
2828
import com.google.devtools.build.lib.vfs.FileStatus;
@@ -177,14 +177,17 @@ protected boolean couldBeModifiedByMetadata(FileArtifactValue lastKnown) {
177177
*/
178178
interface Singleton {}
179179

180-
@AutoCodec public static final FileArtifactValue DEFAULT_MIDDLEMAN = new SingletonMarkerValue();
180+
@SerializationConstant
181+
public static final FileArtifactValue DEFAULT_MIDDLEMAN = new SingletonMarkerValue();
181182
/** Data that marks that a file is not present on the filesystem. */
182-
@AutoCodec public static final FileArtifactValue MISSING_FILE_MARKER = new SingletonMarkerValue();
183+
@SerializationConstant
184+
public static final FileArtifactValue MISSING_FILE_MARKER = new SingletonMarkerValue();
183185
/**
184186
* Represents an omitted file -- we are aware of it but it doesn't exist. All access methods are
185187
* unsupported.
186188
*/
187-
@AutoCodec public static final FileArtifactValue OMITTED_FILE_MARKER = new OmittedFileValue();
189+
@SerializationConstant
190+
public static final FileArtifactValue OMITTED_FILE_MARKER = new OmittedFileValue();
188191

189192
public static FileArtifactValue createForSourceArtifact(Artifact artifact, FileValue fileValue)
190193
throws IOException {

src/main/java/com/google/devtools/build/lib/actions/FilesetTraversalParamsFactory.java

Lines changed: 10 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import com.google.devtools.build.lib.cmdline.Label;
2626
import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
2727
import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
28-
import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec;
2928
import com.google.devtools.build.lib.util.Fingerprint;
3029
import com.google.devtools.build.lib.vfs.PathFragment;
3130
import java.util.Locale;
@@ -175,7 +174,6 @@ private static ImmutableSortedSet<String> getOrderedExcludes(@Nullable Set<Strin
175174
: ImmutableSortedSet.copyOf(Ordering.natural(), excludes);
176175
}
177176

178-
@AutoCodec
179177
@AutoValue
180178
abstract static class DirectoryTraversalParams implements FilesetTraversalParams {
181179
@Override
@@ -208,7 +206,8 @@ public void fingerprint(Fingerprint fp) {
208206
fp.addBytes(getFingerprint());
209207
}
210208

211-
static DirectoryTraversalParams getDirectoryTraversalParams(Label ownerLabel,
209+
static DirectoryTraversalParams getDirectoryTraversalParams(
210+
Label ownerLabelForErrorMessages,
212211
DirectTraversalRoot root,
213212
boolean isPackage,
214213
PathFragment destPath,
@@ -221,22 +220,14 @@ static DirectoryTraversalParams getDirectoryTraversalParams(Label ownerLabel,
221220
DirectTraversal traversal = DirectTraversal.getDirectTraversal(root, isPackage,
222221
symlinkBehaviorMode == SymlinkBehavior.DEREFERENCE, pkgBoundaryMode, strictFilesetOutput,
223222
isRecursive, isGenerated);
224-
return create(ownerLabel, destPath, getOrderedExcludes(excludes), Optional.of(traversal));
225-
}
226-
227-
@AutoCodec.VisibleForSerialization
228-
@AutoCodec.Instantiator
229-
static DirectoryTraversalParams create(
230-
Label ownerLabelForErrorMessages,
231-
PathFragment destPath,
232-
ImmutableSortedSet<String> excludedFiles,
233-
Optional<DirectTraversal> directTraversal) {
234223
return new AutoValue_FilesetTraversalParamsFactory_DirectoryTraversalParams(
235-
ownerLabelForErrorMessages, destPath, excludedFiles, directTraversal);
224+
ownerLabelForErrorMessages,
225+
destPath,
226+
getOrderedExcludes(excludes),
227+
Optional.of(traversal));
236228
}
237229
}
238230

239-
@AutoCodec
240231
@AutoValue
241232
abstract static class NestedTraversalParams implements FilesetTraversalParams {
242233
@Override
@@ -270,26 +261,15 @@ public void fingerprint(Fingerprint fp) {
270261
}
271262

272263
static NestedTraversalParams getNestedTraversal(
273-
Label ownerLabel,
264+
Label ownerLabelForErrorMessages,
274265
Artifact nestedArtifact,
275266
PathFragment destPath,
276267
@Nullable Set<String> excludes) {
277-
return create(ownerLabel, destPath, getOrderedExcludes(excludes), nestedArtifact);
278-
}
279-
280-
@AutoCodec.VisibleForSerialization
281-
@AutoCodec.Instantiator
282-
static NestedTraversalParams create(
283-
Label ownerLabelForErrorMessages,
284-
PathFragment destPath,
285-
ImmutableSortedSet<String> excludedFiles,
286-
Artifact nestedArtifact) {
287268
return new AutoValue_FilesetTraversalParamsFactory_NestedTraversalParams(
288-
ownerLabelForErrorMessages, destPath, excludedFiles, nestedArtifact);
269+
ownerLabelForErrorMessages, destPath, getOrderedExcludes(excludes), nestedArtifact);
289270
}
290271
}
291272

292-
@AutoCodec
293273
@AutoValue
294274
abstract static class KnownLinksTraversalParams implements FilesetTraversalParams {
295275
@Override
@@ -323,22 +303,12 @@ public void fingerprint(Fingerprint fp) {
323303
}
324304

325305
static KnownLinksTraversalParams getKnownLinksTraversal(
326-
Label ownerLabel,
306+
Label ownerLabelForErrorMessages,
327307
LinkSupplier additionalLinks,
328308
PathFragment destPath,
329309
@Nullable Set<String> excludes) {
330-
return create(ownerLabel, destPath, getOrderedExcludes(excludes), additionalLinks);
331-
}
332-
333-
@AutoCodec.VisibleForSerialization
334-
@AutoCodec.Instantiator
335-
static KnownLinksTraversalParams create(
336-
Label ownerLabelForErrorMessages,
337-
PathFragment destPath,
338-
ImmutableSortedSet<String> excludedFiles,
339-
LinkSupplier additionalLinks) {
340310
return new AutoValue_FilesetTraversalParamsFactory_KnownLinksTraversalParams(
341-
ownerLabelForErrorMessages, destPath, excludedFiles, additionalLinks);
311+
ownerLabelForErrorMessages, destPath, getOrderedExcludes(excludes), additionalLinks);
342312
}
343313
}
344314
}

src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
import net.starlark.java.syntax.Location;
6060

6161
/** Supports ctx.actions.args() from Starlark. */
62-
@AutoCodec
6362
public class StarlarkCustomCommandLine extends CommandLine {
6463

6564
protected final ImmutableList<Object> arguments;
@@ -680,9 +679,7 @@ StarlarkCustomCommandLine build(boolean flagPerLine) {
680679
}
681680
}
682681

683-
@AutoCodec.VisibleForSerialization
684-
@AutoCodec.Instantiator
685-
StarlarkCustomCommandLine(ImmutableList<Object> arguments) {
682+
private StarlarkCustomCommandLine(ImmutableList<Object> arguments) {
686683
this.arguments = arguments;
687684
}
688685

@@ -718,9 +715,7 @@ private static class StarlarkCustomCommandLineWithIndexes extends StarlarkCustom
718715
*/
719716
private final ImmutableList<Integer> argStartIndexes;
720717

721-
@AutoCodec.VisibleForSerialization
722-
@AutoCodec.Instantiator
723-
public StarlarkCustomCommandLineWithIndexes(
718+
StarlarkCustomCommandLineWithIndexes(
724719
ImmutableList<Object> arguments, ImmutableList<Integer> argStartIndexes) {
725720
super(arguments);
726721
this.argStartIndexes = argStartIndexes;

src/main/java/com/google/devtools/build/lib/rules/cpp/LinkerInputs.java

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
import com.google.devtools.build.lib.actions.Artifact;
2222
import com.google.devtools.build.lib.collect.CollectionUtils;
2323
import com.google.devtools.build.lib.concurrent.ThreadSafety;
24-
import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec;
25-
import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec.VisibleForSerialization;
2624

2725
/** Factory for creating new {@link LinkerInput} objects. */
2826
public abstract class LinkerInputs {
@@ -31,15 +29,13 @@ public abstract class LinkerInputs {
3129
* object file.
3230
*/
3331
@ThreadSafety.Immutable
34-
@AutoCodec
35-
public static class SimpleLinkerInput implements LinkerInput {
32+
private static class SimpleLinkerInput implements LinkerInput {
3633
private final Artifact artifact;
3734
private final ArtifactCategory category;
3835
private final boolean disableWholeArchive;
3936
private final String libraryIdentifier;
4037

41-
@AutoCodec.Instantiator
42-
public SimpleLinkerInput(
38+
SimpleLinkerInput(
4339
Artifact artifact,
4440
ArtifactCategory category,
4541
boolean disableWholeArchive,
@@ -175,14 +171,11 @@ public interface LibraryToLink extends LinkerInput {
175171
* library that it links to.
176172
*/
177173
@ThreadSafety.Immutable
178-
@AutoCodec
179-
public static class SolibLibraryToLink implements LibraryToLink {
174+
private static class SolibLibraryToLink implements LibraryToLink {
180175
private final Artifact solibSymlinkArtifact;
181176
private final Artifact libraryArtifact;
182177
private final String libraryIdentifier;
183178

184-
@AutoCodec.Instantiator
185-
@VisibleForSerialization
186179
SolibLibraryToLink(
187180
Artifact solibSymlinkArtifact, Artifact libraryArtifact, String libraryIdentifier) {
188181
Preconditions.checkArgument(
@@ -272,9 +265,7 @@ public boolean disableWholeArchive() {
272265

273266
/** This class represents a library that may contain object files. */
274267
@ThreadSafety.Immutable
275-
@AutoCodec
276-
@VisibleForSerialization
277-
static class CompoundLibraryToLink implements LibraryToLink {
268+
private static class CompoundLibraryToLink implements LibraryToLink {
278269
private final Artifact libraryArtifact;
279270
private final ArtifactCategory category;
280271
private final String libraryIdentifier;
@@ -284,28 +275,7 @@ static class CompoundLibraryToLink implements LibraryToLink {
284275
private final boolean mustKeepDebug;
285276
private final boolean disableWholeArchive;
286277

287-
@AutoCodec.Instantiator
288-
@VisibleForSerialization
289278
CompoundLibraryToLink(
290-
Artifact libraryArtifact,
291-
ArtifactCategory category,
292-
String libraryIdentifier,
293-
Iterable<Artifact> objectFiles,
294-
LtoCompilationContext ltoCompilationContext,
295-
ImmutableMap<Artifact, LtoBackendArtifacts> sharedNonLtoBackends,
296-
boolean mustKeepDebug,
297-
boolean disableWholeArchive) {
298-
this.libraryArtifact = libraryArtifact;
299-
this.category = category;
300-
this.libraryIdentifier = libraryIdentifier;
301-
this.objectFiles = objectFiles;
302-
this.ltoCompilationContext = ltoCompilationContext;
303-
this.sharedNonLtoBackends = sharedNonLtoBackends;
304-
this.mustKeepDebug = mustKeepDebug;
305-
this.disableWholeArchive = disableWholeArchive;
306-
}
307-
308-
private CompoundLibraryToLink(
309279
Artifact libraryArtifact,
310280
ArtifactCategory category,
311281
String libraryIdentifier,

0 commit comments

Comments
 (0)