Skip to content

Commit a49b832

Browse files
committed
[Toolchains] Document virtual methods
Adds documentation for the methods added in swiftlang#1908.
1 parent abed7b6 commit a49b832

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

lib/Driver/ToolChains.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,48 @@ class LLVM_LIBRARY_VISIBILITY GenericUnix : public ToolChain {
4343
InvocationInfo constructInvocation(const AutolinkExtractJobAction &job,
4444
const JobContext &context) const override;
4545

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

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

62+
/// Whether to explicitly specify the target triple as the the linker
63+
/// '--target'. This is not desirable on all platforms, and subclasses may
64+
/// override this method to return false in those cases.
5065
virtual bool shouldSpecifyTargetTripleToLinker() const;
5166

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

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

0 commit comments

Comments
 (0)