From 8b68bbef2553431e3687205c9b4aff79a61fdc5c Mon Sep 17 00:00:00 2001 From: Luca Di Grazia Date: Sun, 4 Sep 2022 20:41:38 +0200 Subject: [PATCH] C++: Remove more CcLinkParams Tracking: https://github.com/bazelbuild/bazel/issues/4570 Fixes conversion bug from old API to new that was already present before the original CL but was only triggered with it. RELNOTES:none PiperOrigin-RevId: 229910560 --- .../build/lib/rules/cpp/CcBinary.java | 181 +++++++++++------- .../build/lib/rules/cpp/CcLinkingHelper.java | 7 + .../lib/rules/cpp/ExtraLinkTimeLibraries.java | 3 +- .../lib/rules/cpp/ExtraLinkTimeLibrary.java | 7 +- .../lib/rules/cpp/LibraryToLinkWrapper.java | 29 --- 5 files changed, 125 insertions(+), 102 deletions(-) diff --git a/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java b/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java index 0efc183f18f..60a56cfbd11 100644 --- a/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java +++ b/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java @@ -56,9 +56,11 @@ import com.google.devtools.build.lib.rules.apple.ApplePlatform; import com.google.devtools.build.lib.rules.cpp.CcCommon.CcFlagsSupplier; import com.google.devtools.build.lib.rules.cpp.CcCompilationHelper.CompilationInfo; +import com.google.devtools.build.lib.rules.cpp.CcLinkParams.LinkOptions; import com.google.devtools.build.lib.rules.cpp.CcToolchainFeatures.FeatureConfiguration; import com.google.devtools.build.lib.rules.cpp.CppConfiguration.DynamicMode; import com.google.devtools.build.lib.rules.cpp.CppConfiguration.Tool; +import com.google.devtools.build.lib.rules.cpp.LibraryToLinkWrapper.CcLinkingContext; import com.google.devtools.build.lib.rules.cpp.Link.LinkTargetType; import com.google.devtools.build.lib.rules.cpp.Link.LinkingMode; import com.google.devtools.build.lib.rules.cpp.LinkerInputs.LibraryToLink; @@ -112,12 +114,11 @@ public static class CcLauncherInfo extends NativeInfo { public static final Provider PROVIDER = new Provider(); private final CcCompilationOutputs ccCompilationOutputs; - private final CcLinkingInfo staticModeParamsForExecutable; + private final CcInfo ccInfo; - public CcLauncherInfo( - CcLinkingInfo staticModeParamsForExecutable, CcCompilationOutputs ccCompilationOutputs) { + public CcLauncherInfo(CcInfo ccInfo, CcCompilationOutputs ccCompilationOutputs) { super(PROVIDER); - this.staticModeParamsForExecutable = staticModeParamsForExecutable; + this.ccInfo = ccInfo; this.ccCompilationOutputs = ccCompilationOutputs; } @@ -126,9 +127,9 @@ public CcCompilationOutputs getCcCompilationOutputs(RuleContext ruleContext) { return ccCompilationOutputs; } - public CcLinkingInfo getStaticModeParamsForExecutable(RuleContext ruleContext) { + public CcInfo getCcInfo(RuleContext ruleContext) { checkRestrictedUsage(ruleContext); - return staticModeParamsForExecutable; + return ccInfo; } private void checkRestrictedUsage(RuleContext ruleContext) { @@ -358,9 +359,8 @@ public static ConfiguredTarget init(CppSemantics semantics, RuleContext ruleCont } boolean isStaticMode = linkingMode != LinkingMode.DYNAMIC; - boolean forDynamicLibrary = isLinkShared(ruleContext); - CcLinkingInfo depsCcLinkingInfo = collectCcLinkingInfo(ruleContext); + CcLinkingContext depsCcLinkingContext = collectCcLinkingContext(ruleContext); Artifact generatedDefFile = null; Artifact customDefFile = null; @@ -368,14 +368,22 @@ public static ConfiguredTarget init(CppSemantics semantics, RuleContext ruleCont if (featureConfiguration.isEnabled(CppRuleClasses.TARGETS_WINDOWS)) { ImmutableList.Builder objectFiles = ImmutableList.builder(); objectFiles.addAll(ccCompilationOutputs.getObjectFiles(false)); - for (LibraryToLink library : - depsCcLinkingInfo.getCcLinkParams(isStaticMode, forDynamicLibrary).getLibraries()) { - if (library.containsObjectFiles() - && library.getArtifactCategory() != ArtifactCategory.DYNAMIC_LIBRARY - && library.getArtifactCategory() != ArtifactCategory.INTERFACE_LIBRARY) { - objectFiles.addAll(library.getObjectFiles()); + + for (LibraryToLinkWrapper library : depsCcLinkingContext.getLibraries()) { + if (isStaticMode + || (library.getDynamicLibrary() == null && library.getInterfaceLibrary() == null)) { + if (library.getPicStaticLibrary() != null) { + if (library.getPicObjectFiles() != null) { + objectFiles.addAll(library.getPicObjectFiles()); + } + } else if (library.getStaticLibrary() != null) { + if (library.getObjectFiles() != null) { + objectFiles.addAll(library.getObjectFiles()); + } + } } } + generatedDefFile = CppHelper.createDefFileActions( ruleContext, @@ -395,13 +403,12 @@ public static ConfiguredTarget init(CppSemantics semantics, RuleContext ruleCont pdbFile = ruleContext.getRelatedArtifact(binary.getRootRelativePath(), ".pdb"); } - NestedSetBuilder extraLinkTimeLibrariesNestedSet = NestedSetBuilder.linkOrder(); + NestedSetBuilder extraLinkTimeLibrariesNestedSet = + NestedSetBuilder.linkOrder(); NestedSetBuilder extraLinkTimeRuntimeLibraries = NestedSetBuilder.linkOrder(); ExtraLinkTimeLibraries extraLinkTimeLibraries = - depsCcLinkingInfo - .getCcLinkParams(isStaticMode, forDynamicLibrary) - .getExtraLinkTimeLibraries(); + depsCcLinkingContext.getExtraLinkTimeLibraries(); if (extraLinkTimeLibraries != null) { ExtraLinkTimeLibrary.BuildLibraryOutput extraLinkBuildLibraryOutput = extraLinkTimeLibraries.buildLibraries( @@ -425,7 +432,7 @@ public static ConfiguredTarget init(CppSemantics semantics, RuleContext ruleCont ccCompilationContext, fake, binary, - depsCcLinkingInfo, + depsCcLinkingContext, extraLinkTimeLibrariesNestedSet.build(), linkCompileOutputSeparately, semantics, @@ -501,14 +508,23 @@ public static ConfiguredTarget init(CppSemantics semantics, RuleContext ruleCont // If the binary is linked dynamically and COPY_DYNAMIC_LIBRARIES_TO_BINARY is enabled, collect // all the dynamic libraries we need at runtime. Then copy these libraries next to the binary. if (featureConfiguration.isEnabled(CppRuleClasses.COPY_DYNAMIC_LIBRARIES_TO_BINARY)) { + ImmutableList.Builder runtimeLibraries = ImmutableList.builder(); + for (LibraryToLinkWrapper libraryToLinkWrapper : depsCcLinkingContext.getLibraries()) { + Artifact library = + libraryToLinkWrapper.getDynamicLibraryForRuntimeOrNull( + /* linkingStatically= */ isStaticMode); + if (library != null) { + runtimeLibraries.add(library); + } + } filesToBuild = NestedSetBuilder.fromNestedSet(filesToBuild) .addAll( createDynamicLibrariesCopyActions( ruleContext, - depsCcLinkingInfo - .getCcLinkParams(isStaticMode, forDynamicLibrary) - .getDynamicLibrariesForRuntime())) + NestedSetBuilder.linkOrder() + .addAll(runtimeLibraries.build()) + .build())) .build(); } @@ -598,8 +614,8 @@ public static Pair createTransitiveLinkingActi CcCompilationContext ccCompilationContext, boolean fake, Artifact binary, - CcLinkingInfo depsCcLinkingInfo, - NestedSet extraLinkTimeLibraries, + CcLinkingContext depsCcLinkingContext, + NestedSet extraLinkTimeLibraries, boolean linkCompileOutputSeparately, CppSemantics cppSemantics, LinkingMode linkingMode, @@ -624,15 +640,26 @@ public static Pair createTransitiveLinkingActi fdoContext, ruleContext.getConfiguration()); - CcLinkParams.Builder ccLinkParamsBuilder = CcLinkParams.builder(); - ccLinkParamsBuilder.addTransitiveArgs( - depsCcLinkingInfo.getCcLinkParams( - linkingMode != LinkingMode.DYNAMIC, isLinkShared(ruleContext))); + CcInfo depsCcInfo = CcInfo.builder().setCcLinkingContext(depsCcLinkingContext).build(); + + CcLinkingContext.Builder currentCcLinkingContextBuilder = CcLinkingContext.builder(); if (linkCompileOutputSeparately) { + ImmutableList.Builder localLibraries = ImmutableList.builder(); for (LibraryToLink library : ccLinkingOutputs.getDynamicLibrariesForLinking()) { - ccLinkParamsBuilder.addLibrary(library); + LibraryToLinkWrapper.Builder libraryToLinkWrapperBuilder = LibraryToLinkWrapper.builder(); + libraryToLinkWrapperBuilder.setLibraryIdentifier( + LibraryToLinkWrapper.setDynamicArtifactsAndReturnIdentifier( + libraryToLinkWrapperBuilder, + library, + library, + /* runtimeLibraryIterator= */ ImmutableList.of().listIterator())); + localLibraries.add(libraryToLinkWrapperBuilder.build()); } + currentCcLinkingContextBuilder.addLibraries( + NestedSetBuilder.linkOrder() + .addAll(localLibraries.build()) + .build()); ccCompilationOutputsWithOnlyObjects = new CcCompilationOutputs.Builder().build(); } @@ -640,62 +667,81 @@ public static Pair createTransitiveLinkingActi // First libraries from srcs. Shared library artifacts here are substituted with mangled symlink // artifacts generated by getDynamicLibraryLink(). This is done to minimize number of -rpath // entries during linking process. + ImmutableList.Builder precompiledLibraries = ImmutableList.builder(); for (Artifact library : precompiledFiles.getLibraries()) { if (Link.SHARED_LIBRARY_FILETYPES.matches(library.getFilename())) { - ccLinkParamsBuilder.addLibrary( - LinkerInputs.solibLibraryToLink( - common.getDynamicLibrarySymlink(library, true), - library, - CcLinkingOutputs.libraryIdentifierOf(library))); + LibraryToLinkWrapper libraryToLinkWrapper = + LibraryToLinkWrapper.builder() + .setLibraryIdentifier(CcLinkingOutputs.libraryIdentifierOf(library)) + .setDynamicLibrary( + common.getDynamicLibrarySymlink(library, /* preserveName= */ true)) + .setResolvedSymlinkDynamicLibrary(library) + .build(); + precompiledLibraries.add(libraryToLinkWrapper); } else if (Link.LINK_LIBRARY_FILETYPES.matches(library.getFilename())) { - ccLinkParamsBuilder.addLibrary( - LinkerInputs.precompiledLibraryToLink( - library, ArtifactCategory.ALWAYSLINK_STATIC_LIBRARY)); + LibraryToLinkWrapper libraryToLinkWrapper = + LibraryToLinkWrapper.builder() + .setLibraryIdentifier(CcLinkingOutputs.libraryIdentifierOf(library)) + .setStaticLibrary(library) + .setAlwayslink(true) + .build(); + precompiledLibraries.add(libraryToLinkWrapper); } else if (Link.ARCHIVE_FILETYPES.matches(library.getFilename())) { - ccLinkParamsBuilder.addLibrary( - LinkerInputs.precompiledLibraryToLink(library, ArtifactCategory.STATIC_LIBRARY)); + LibraryToLinkWrapper libraryToLinkWrapper = + LibraryToLinkWrapper.builder() + .setLibraryIdentifier(CcLinkingOutputs.libraryIdentifierOf(library)) + .setStaticLibrary(library) + .build(); + precompiledLibraries.add(libraryToLinkWrapper); } else { throw new IllegalStateException(); } } + currentCcLinkingContextBuilder.addLibraries( + NestedSetBuilder.wrap(Order.LINK_ORDER, precompiledLibraries.build())); + ImmutableList.Builder userLinkflags = ImmutableList.builder(); if (linkingMode != Link.LinkingMode.DYNAMIC && !cppConfiguration.disableEmittingStaticLibgcc()) { // Only force a static link of libgcc if static runtime linking is enabled (which // can't be true if runtimeInputs is empty). // TODO(bazel-team): Move this to CcToolchain. if (!ccToolchain.getStaticRuntimeLinkInputs(ruleContext, featureConfiguration).isEmpty()) { - ccLinkParamsBuilder.addLinkOpts(ImmutableList.of("-static-libgcc")); + userLinkflags.add("-static-libgcc"); } } - ccLinkParamsBuilder - .addNonCodeInputs(ccCompilationContext.getTransitiveCompilationPrerequisites()) - .addNonCodeInputs(common.getLinkerScripts()) - .addLinkOpts(common.getLinkopts()); - - CcLinkParams ccLinkParamsForLauncher = ccLinkParamsBuilder.build(); - CcLinkParams ccLinkParams = - CcLinkParams.builder() - .addTransitiveArgs(ccLinkParamsForLauncher) - .addLibraries(extraLinkTimeLibraries) - .addTransitiveArgs(CcLinkParams.builder().addLibraries(extraLinkTimeLibraries).build()) + userLinkflags.addAll(common.getLinkopts()); + currentCcLinkingContextBuilder + .addNonCodeInputs( + NestedSetBuilder.linkOrder() + .addAll(ccCompilationContext.getTransitiveCompilationPrerequisites()) + .addAll(common.getLinkerScripts()) + .build()) + .addUserLinkFlags( + NestedSetBuilder.linkOrder() + .add(new LinkOptions(userLinkflags.build())) + .build()); + + CcInfo ccInfoWithoutExtraLinkTimeLibraries = + CcInfo.merge( + ImmutableList.of( + CcInfo.builder() + .setCcLinkingContext(currentCcLinkingContextBuilder.build()) + .build(), + depsCcInfo)); + + CcInfo extraLinkTimeLibrariesCcInfo = + CcInfo.builder() + .setCcLinkingContext( + CcLinkingContext.builder().addLibraries(extraLinkTimeLibraries).build()) .build(); - - CcLinkingInfo.Builder ccLinkingInfo = CcLinkingInfo.Builder.create(); - ccLinkingInfo.setStaticModeParamsForDynamicLibrary(ccLinkParams); - ccLinkingInfo.setStaticModeParamsForExecutable(ccLinkParams); - ccLinkingInfo.setDynamicModeParamsForDynamicLibrary(ccLinkParams); - ccLinkingInfo.setDynamicModeParamsForExecutable(ccLinkParams); - - CcLinkingInfo.Builder ccLinkingInfoForLauncher = CcLinkingInfo.Builder.create(); - ccLinkingInfoForLauncher.setStaticModeParamsForDynamicLibrary(ccLinkParamsForLauncher); - ccLinkingInfoForLauncher.setStaticModeParamsForExecutable(ccLinkParamsForLauncher); - ccLinkingInfoForLauncher.setDynamicModeParamsForDynamicLibrary(ccLinkParamsForLauncher); - ccLinkingInfoForLauncher.setDynamicModeParamsForExecutable(ccLinkParamsForLauncher); + CcInfo ccInfo = + CcInfo.merge( + ImmutableList.of(ccInfoWithoutExtraLinkTimeLibraries, extraLinkTimeLibrariesCcInfo)); ccLinkingHelper - .addCcLinkingInfos(ImmutableList.of(ccLinkingInfo.build())) + .addCcLinkingContexts(ImmutableList.of(ccInfo.getCcLinkingContext())) .setUseTestOnlyFlags(ruleContext.isTestTarget()) .setShouldCreateStaticLibraries(false) .setLinkingMode(linkingMode) @@ -718,7 +764,8 @@ public static Pair createTransitiveLinkingActi return Pair.of( ccLinkingHelper.link(ccCompilationOutputsWithOnlyObjects), - new CcLauncherInfo(ccLinkingInfoForLauncher.build(), ccCompilationOutputsWithOnlyObjects)); + new CcLauncherInfo( + ccInfoWithoutExtraLinkTimeLibraries, ccCompilationOutputsWithOnlyObjects)); } /** @@ -938,7 +985,7 @@ private static Artifact getIntermediateDwpFile(RuleContext ruleContext, Artifact } /** Collect link parameters from the transitive closure. */ - private static CcLinkingInfo collectCcLinkingInfo(RuleContext context) { + private static CcLinkingContext collectCcLinkingContext(RuleContext context) { ImmutableList.Builder ccInfoListBuilder = ImmutableList.builder(); ccInfoListBuilder.addAll(context.getPrerequisites("deps", Mode.TARGET, CcInfo.PROVIDER)); @@ -948,7 +995,7 @@ private static CcLinkingInfo collectCcLinkingInfo(RuleContext context) { ccInfoListBuilder.add(ccInfo); } } - return CcInfo.merge(ccInfoListBuilder.build()).getCcLinkingInfo(); + return CcInfo.merge(ccInfoListBuilder.build()).getCcLinkingContext(); } private static void addTransitiveInfoProviders( diff --git a/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingHelper.java b/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingHelper.java index ed7e921f486..e6344ef89b7 100644 --- a/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingHelper.java +++ b/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingHelper.java @@ -211,6 +211,13 @@ public CcLinkingHelper addCcLinkingInfos(Iterable ccLinkingInfos) return this; } + public CcLinkingHelper addCcLinkingContexts(Iterable ccLinkingContexts) { + for (CcLinkingContext ccLinkingContext : ccLinkingContexts) { + ccLinkingInfos.add(ccLinkingContext.toCcLinkingInfo()); + } + return this; + } + /** * Adds the given linkstamps. Note that linkstamps are usually not compiled at the library level, * but only in the dependent binary rules. diff --git a/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/ExtraLinkTimeLibraries.java b/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/ExtraLinkTimeLibraries.java index 997ef10a8ac..9f53944b6eb 100644 --- a/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/ExtraLinkTimeLibraries.java +++ b/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/ExtraLinkTimeLibraries.java @@ -20,7 +20,6 @@ import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder; import com.google.devtools.build.lib.packages.RuleClass.ConfiguredTargetFactory.RuleErrorException; import com.google.devtools.build.lib.rules.cpp.ExtraLinkTimeLibrary.BuildLibraryOutput; -import com.google.devtools.build.lib.rules.cpp.LinkerInputs.LibraryToLink; import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec; import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec.VisibleForSerialization; import java.util.Collection; @@ -107,7 +106,7 @@ public final Builder add(ExtraLinkTimeLibrary b) { public BuildLibraryOutput buildLibraries( RuleContext ruleContext, boolean staticMode, boolean forDynamicLibrary) throws InterruptedException, RuleErrorException { - NestedSetBuilder librariesToLink = NestedSetBuilder.linkOrder(); + NestedSetBuilder librariesToLink = NestedSetBuilder.linkOrder(); NestedSetBuilder runtimeLibraries = NestedSetBuilder.linkOrder(); for (ExtraLinkTimeLibrary extraLibrary : getExtraLibraries()) { BuildLibraryOutput buildLibraryOutput = diff --git a/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/ExtraLinkTimeLibrary.java b/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/ExtraLinkTimeLibrary.java index fab76f856af..28722fb0334 100644 --- a/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/ExtraLinkTimeLibrary.java +++ b/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/ExtraLinkTimeLibrary.java @@ -18,7 +18,6 @@ import com.google.devtools.build.lib.analysis.RuleContext; import com.google.devtools.build.lib.collect.nestedset.NestedSet; import com.google.devtools.build.lib.packages.RuleClass.ConfiguredTargetFactory.RuleErrorException; -import com.google.devtools.build.lib.rules.cpp.LinkerInputs.LibraryToLink; /** * An extra library to include in a link. The actual library is built at link time. @@ -34,16 +33,16 @@ public interface ExtraLinkTimeLibrary { /** Output of {@link #buildLibraries}. Pair of libraries to link and runtime libraries. */ class BuildLibraryOutput { - public NestedSet librariesToLink; + public NestedSet librariesToLink; public NestedSet runtimeLibraries; public BuildLibraryOutput( - NestedSet librariesToLink, NestedSet runtimeLibraries) { + NestedSet librariesToLink, NestedSet runtimeLibraries) { this.librariesToLink = librariesToLink; this.runtimeLibraries = runtimeLibraries; } - public NestedSet getLibrariesToLink() { + public NestedSet getLibrariesToLink() { return librariesToLink; } diff --git a/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/LibraryToLinkWrapper.java b/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/LibraryToLinkWrapper.java index ba76a1acbaf..90e1950e332 100644 --- a/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/LibraryToLinkWrapper.java +++ b/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/LibraryToLinkWrapper.java @@ -177,23 +177,6 @@ public static List getStaticModeParamsForExecutableLibraries( return getStaticModeParamsForExecutableLibraries(fromCcLinkingInfo(ccLinkingInfo)); } - public static List getStaticModeParamsForDynamicLibraryLibraries( - CcLinkingContext ccLinkingContext) { - ImmutableList.Builder artifactListBuilder = ImmutableList.builder(); - for (LibraryToLinkWrapper library : ccLinkingContext.getLibraries()) { - if (library.getPicStaticLibrary() != null) { - artifactListBuilder.add(library.getPicStaticLibrary()); - } else if (library.getStaticLibrary() != null) { - artifactListBuilder.add(library.getStaticLibrary()); - } else if (library.getInterfaceLibrary() != null) { - artifactListBuilder.add(library.getInterfaceLibrary()); - } else { - artifactListBuilder.add(library.getDynamicLibrary()); - } - } - return artifactListBuilder.build(); - } - public NestedSet getLibraries() { return libraries; } @@ -398,28 +381,16 @@ public Artifact getDynamicLibrary() { return dynamicLibrary; } - public Artifact getResolvedSymlinkDynamicLibrary() { - return resolvedSymlinkDynamicLibrary; - } - @Override public Artifact getInterfaceLibrary() { return interfaceLibrary; } - public Artifact getResolvedSymlinkInterfaceLibrary() { - return resolvedSymlinkInterfaceLibrary; - } - @Override public boolean getAlwayslink() { return alwayslink; } - public boolean getMustKeepDebug() { - return mustKeepDebug; - } - public static Builder builder() { return new Builder(); }