From 0bab9da90f1e087dabe3aaf4e32ab99297d11017 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 13 Jul 2012 23:26:43 +0000 Subject: [PATCH] Move option test earlier in the function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160202 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/Decl.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 7ca8d397f1..fa7b066ce6 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -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(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(); } -- 2.40.0