diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-07-13 23:26:43 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-07-13 23:26:43 +0000 |
commit | 5cc7890cac8d468bda21e8332143af283fc7521d (patch) | |
tree | 83276a56d438af4ceb8a7f1fe4834be7b1d72050 /clang/lib/AST/Decl.cpp | |
parent | 3e00e9d5c1a9a46c8c2a51b93c610e7d8a3edcbb (diff) | |
download | bcm5719-llvm-5cc7890cac8d468bda21e8332143af283fc7521d.tar.gz bcm5719-llvm-5cc7890cac8d468bda21e8332143af283fc7521d.zip |
Move option test earlier in the function.
llvm-svn: 160202
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r-- | clang/lib/AST/Decl.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
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<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(); } |