aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-07-13 23:26:43 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-07-13 23:26:43 +0000
commit0bab9da90f1e087dabe3aaf4e32ab99297d11017 (patch)
tree2e4e431773ff7a47b7db9353f2cb83d8426fc7b7 /lib/AST/Decl.cpp
parent87d747b1fbf89aa0ba08cfc0e26655aa7739c77d (diff)
Move option test earlier in the function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160202 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r--lib/AST/Decl.cpp5
1 files 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<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();
}