diff options
author | John McCall <rjmccall@apple.com> | 2010-10-22 21:05:15 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-10-22 21:05:15 +0000 |
commit | 457a04e3ce5c0925850bb30ec152c89dd68d3ab4 (patch) | |
tree | aa1051ba12082b33a35f7909a0b32468faf25f61 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 0196aa28ecf3a289c11548490848db40149075aa (diff) | |
download | llvm-457a04e3ce5c0925850bb30ec152c89dd68d3ab4.zip llvm-457a04e3ce5c0925850bb30ec152c89dd68d3ab4.tar.gz llvm-457a04e3ce5c0925850bb30ec152c89dd68d3ab4.tar.bz2 |
Substantially revise how clang computes the visibility of a declaration to
more closely parallel the computation of linkage. This gets us to a state
much closer to what gcc emits, modulo bugs, which will undoubtedly arise in
abundance.
llvm-svn: 117147
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 3ed859a..561555a 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -624,12 +624,12 @@ static void LangOptsToArgs(const LangOptions &Opts, Res.push_back("-fobjc-gc-only"); } } - if (Opts.getVisibilityMode() != LangOptions::Default) { + if (Opts.getVisibilityMode() != DefaultVisibility) { Res.push_back("-fvisibility"); - if (Opts.getVisibilityMode() == LangOptions::Hidden) { + if (Opts.getVisibilityMode() == HiddenVisibility) { Res.push_back("hidden"); } else { - assert(Opts.getVisibilityMode() == LangOptions::Protected && + assert(Opts.getVisibilityMode() == ProtectedVisibility && "Invalid visibility!"); Res.push_back("protected"); } @@ -1304,11 +1304,11 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, llvm::StringRef Vis = Args.getLastArgValue(OPT_fvisibility, "default"); if (Vis == "default") - Opts.setVisibilityMode(LangOptions::Default); + Opts.setVisibilityMode(DefaultVisibility); else if (Vis == "hidden") - Opts.setVisibilityMode(LangOptions::Hidden); + Opts.setVisibilityMode(HiddenVisibility); else if (Vis == "protected") - Opts.setVisibilityMode(LangOptions::Protected); + Opts.setVisibilityMode(ProtectedVisibility); else Diags.Report(diag::err_drv_invalid_value) << Args.getLastArg(OPT_fvisibility)->getAsString(Args) << Vis; |