From 5cc7890cac8d468bda21e8332143af283fc7521d Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 13 Jul 2012 23:26:43 +0000 Subject: Move option test earlier in the function. llvm-svn: 160202 --- clang/lib/AST/Decl.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'clang/lib/AST/Decl.cpp') diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 7ca8d397f1f..fa7b066ce65 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/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(); } -- cgit v1.2.3