[PATCH] D32573: [Driver] Rename GetNamedOutputPath() to addNamedOutputPath()
Jorge Gorbe via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 26 17:19:18 PDT 2017
jgorbe created this revision.
The current name is confusing: it looks like it should just compute the path and return it but it has the side effect of appending it to the compilation's list of result files. This change changes the verb in the method name from "get" to "add" to emphasize this side effect.
https://reviews.llvm.org/D32573
Files:
include/clang/Driver/Driver.h
lib/Driver/Driver.cpp
Index: lib/Driver/Driver.cpp
===================================================================
--- lib/Driver/Driver.cpp
+++ lib/Driver/Driver.cpp
@@ -3308,7 +3308,7 @@
UI.DependentToolChain->getTriple().normalize(),
/*CreatePrefixForHost=*/true);
auto CurI = InputInfo(
- UA, GetNamedOutputPath(C, *UA, BaseInput, UI.DependentBoundArch,
+ UA, addNamedOutputPath(C, *UA, BaseInput, UI.DependentBoundArch,
/*AtTopLevel=*/false, MultipleArchs,
OffloadingPrefix),
BaseInput);
@@ -3338,7 +3338,7 @@
A->getOffloadingDeviceKind(), TC->getTriple().normalize(),
/*CreatePrefixForHost=*/!!A->getOffloadingHostActiveKinds() &&
!AtTopLevel);
- Result = InputInfo(A, GetNamedOutputPath(C, *JA, BaseInput, BoundArch,
+ Result = InputInfo(A, addNamedOutputPath(C, *JA, BaseInput, BoundArch,
AtTopLevel, MultipleArchs,
OffloadingPrefix),
BaseInput);
@@ -3416,7 +3416,7 @@
return Args.MakeArgString(Filename.c_str());
}
-const char *Driver::GetNamedOutputPath(Compilation &C, const JobAction &JA,
+const char *Driver::addNamedOutputPath(Compilation &C, const JobAction &JA,
const char *BaseInput,
StringRef BoundArch, bool AtTopLevel,
bool MultipleArchs,
Index: include/clang/Driver/Driver.h
===================================================================
--- include/clang/Driver/Driver.h
+++ include/clang/Driver/Driver.h
@@ -449,19 +449,20 @@
/// Returns the default name for linked images (e.g., "a.out").
const char *getDefaultImageName() const;
- /// GetNamedOutputPath - Return the name to use for the output of
- /// the action \p JA. The result is appended to the compilation's
- /// list of temporary or result files, as appropriate.
+ /// Computes the name to use for the output of the action \p JA and appends it
+ /// to the compilation's list of temporary or result files, as appropriate.
///
/// \param C - The compilation.
/// \param JA - The action of interest.
/// \param BaseInput - The original input file that this action was
/// triggered by.
- /// \param BoundArch - The bound architecture.
+ /// \param BoundArch - The bound architecture.
/// \param AtTopLevel - Whether this is a "top-level" action.
/// \param MultipleArchs - Whether multiple -arch options were supplied.
/// \param NormalizedTriple - The normalized triple of the relevant target.
- const char *GetNamedOutputPath(Compilation &C, const JobAction &JA,
+ //
+ // \return The name to use for the output of the action \p JA.
+ const char *addNamedOutputPath(Compilation &C, const JobAction &JA,
const char *BaseInput, StringRef BoundArch,
bool AtTopLevel, bool MultipleArchs,
StringRef NormalizedTriple) const;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32573.96852.patch
Type: text/x-patch
Size: 3142 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170427/5e41eb1c/attachment.bin>
More information about the cfe-commits
mailing list