Skip to content

Merge getRuntimeLibraryPath and getRuntimeStaticLibraryPath #15388

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 1 commit into from
Mar 22, 2018
Merged

Merge getRuntimeLibraryPath and getRuntimeStaticLibraryPath #15388

merged 1 commit into from
Mar 22, 2018

Conversation

lanza
Copy link
Contributor

@lanza lanza commented Mar 21, 2018

These two functions are duplicates except for one string. Merge them and
add an argument for whether we want static or shared.

@lanza
Copy link
Contributor Author

lanza commented Mar 21, 2018

@compnerd smoke test and merge please

llvm::sys::path::append(runtimeLibPath, "lib", "swift");
} else {
llvm::sys::path::append(runtimeLibPath, "lib", "swift_static");
}
Copy link
Member

Choose a reason for hiding this comment

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

I think this is better as a ternary:

llvm::sys::path::append(runtimeLibpath, "lib", shared ? "swift" : "swift_static");

@@ -1047,43 +1052,21 @@ static void getClangLibraryPath(const ToolChain &TC, const ArgList &Args,
SmallString<128> &LibPath) {
const llvm::Triple &T = TC.getTriple();

getRuntimeLibraryPath(LibPath, Args, TC);
getRuntimeLibraryPath(LibPath, Args, TC, true);
Copy link
Member

Choose a reason for hiding this comment

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

Please add a comment:

getRuntimeLibraryPath(LibPath, Args, TC, /*Shared=*/true);

Similar throughout.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gross, if only there was a language with functions with named arguments.

These two functions are duplicates except for one string. Merge them and
add an argument for whether we want static or shared.
@compnerd
Copy link
Member

@swift-ci please test and merge

@swift-ci swift-ci merged commit b8b3144 into swiftlang:master Mar 22, 2018
@lanza lanza deleted the merge-grlp branch March 23, 2018 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants