Skip to content

[Toolchains] Document virtual methods #2134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions lib/Driver/ToolChains.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,48 @@ class LLVM_LIBRARY_VISIBILITY GenericUnix : public ToolChain {
InvocationInfo constructInvocation(const AutolinkExtractJobAction &job,
const JobContext &context) const override;

/// If provided, and if the user has not already explicitly specified a
/// linker to use via the "-fuse-ld=" option, this linker will be passed to
/// the compiler invocation via "-fuse-ld=". Return an empty string to not
/// specify any specific linker (the "-fuse-ld=" option will not be
/// specified).
///
/// The default behavior is to use the gold linker on ARM architectures,
/// and to not provide a specific linker otherwise.
virtual std::string getDefaultLinker() const;

/// Whether to specify a linker -rpath to the Swift runtime library path.
/// -rpath is not supported on all platforms, and subclasses may override
/// this method to return false on platforms that don't support it. The
/// default is to return true (and so specify an -rpath).
virtual bool shouldProvideRPathToLinker() const;

/// Whether to explicitly specify the target triple as the the linker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doubled "the" here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out! Fixed in bb20005 (and c0e1a7c, sorry for the additional typo!!).

/// '--target'. This is not desirable on all platforms, and subclasses may
/// override this method to return false in those cases.
virtual bool shouldSpecifyTargetTripleToLinker() const;

/// Provides a path to an object that should be linked first. On platforms
/// that use ELF binaries, an object that provides markers and sizes for
/// metadata sections must be linked first. Platforms that do not need this
/// object may return an empty string; no additional objects are linked in
/// this case.
///
/// \param RuntimeLibraryPath A path to the Swift resource directory, which
/// on ARM architectures will contain metadata "begin" and "end"
/// objects.
virtual std::string
getPreInputObjectPath(StringRef RuntimeLibraryPath) const;

/// Provides a path to an object that should be linked last. On platforms
/// that use ELF binaries, an object that provides markers and sizes for
/// metadata sections must be linked last. Platforms that do not need this
/// object may return an empty string; no additional objects are linked in
/// this case.
///
/// \param RuntimeLibraryPath A path to the Swift resource directory, which
/// on ARM architectures will contain metadata "begin" and "end"
/// objects.
virtual std::string
getPostInputObjectPath(StringRef RuntimeLibraryPath) const;

Expand Down