Skip to content
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

Add -visibility support for ldmd2 #4568

Closed
wants to merge 1 commit into from
Closed
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
10 changes: 10 additions & 0 deletions driver/ldmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ Where:\n\
-version=<level> compile in version code >= level\n\
-version=<ident> compile in version code identified by ident\n\
-vgc list all gc allocations including hidden ones\n\
-visibility=[default|hidden|public]\n\
default visibility of symbols\n\
-vtemplates=[list-instances]\n\
list statistics on template instantiations\n\
-vtls list all variables going into thread local storage\n\
Expand Down Expand Up @@ -701,6 +703,14 @@ void translateArgs(const llvm::SmallVectorImpl<const char *> &ldmdArgs,
} else {
goto Lerror;
}
} else if (startsWith(p + 1, "visibility")) {
// Parse:
// -visibility=default|hidden|public
if (p[11] == '=') {
ldcArgs.push_back(concat("--fvisibility=", p + 10));
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this be +12 ?

} else {
goto Lerror;
}
} else if (strcmp(p + 1, "-b") == 0 || strcmp(p + 1, "-c") == 0 ||
strcmp(p + 1, "-f") == 0 || strcmp(p + 1, "-r") == 0 ||
strcmp(p + 1, "-x") == 0 || strcmp(p + 1, "-y") == 0) {
Expand Down
Loading