forked from OSchip/llvm-project
Move option test earlier in the function.
llvm-svn: 160202
This commit is contained in:
parent
3e00e9d5c1
commit
5cc7890cac
|
@ -170,8 +170,8 @@ shouldConsiderTemplateVis(const ClassTemplateSpecializationDecl *d) {
|
|||
|
||||
static bool useInlineVisibilityHidden(const NamedDecl *D) {
|
||||
// FIXME: we should warn if -fvisibility-inlines-hidden is used with c.
|
||||
ASTContext &Context = D->getASTContext();
|
||||
if (!Context.getLangOpts().CPlusPlus)
|
||||
const LangOptions &Opts = D->getASTContext().getLangOpts();
|
||||
if (!Opts.CPlusPlus || !Opts.InlineVisibilityHidden)
|
||||
return false;
|
||||
|
||||
const FunctionDecl *FD = dyn_cast<FunctionDecl>(D);
|
||||
|
@ -193,7 +193,6 @@ static bool useInlineVisibilityHidden(const NamedDecl *D) {
|
|||
// anyway.
|
||||
return TSK != TSK_ExplicitInstantiationDeclaration &&
|
||||
TSK != TSK_ExplicitInstantiationDefinition &&
|
||||
FD->getASTContext().getLangOpts().InlineVisibilityHidden &&
|
||||
FD->hasBody(Def) && Def->isInlined();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue