Skip to content
Snippets Groups Projects
Commit 575c8ea6 authored by David Majnemer's avatar David Majnemer
Browse files

[AST] hasAttr followed by getAttr isn't efficient

Just use getAttr because we are interested in the attribute's contents.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237336 91177308-0d34-0410-b5e6-96231b3b80d8
parent 6943bc7d
No related branches found
No related tags found
No related merge requests found
...@@ -1915,10 +1915,13 @@ VarDecl::isThisDeclarationADefinition(ASTContext &C) const { ...@@ -1915,10 +1915,13 @@ VarDecl::isThisDeclarationADefinition(ASTContext &C) const {
if (hasInit()) if (hasInit())
return Definition; return Definition;
if (hasAttr<AliasAttr>() || if (hasAttr<AliasAttr>())
(hasAttr<SelectAnyAttr>() && !getAttr<SelectAnyAttr>()->isInherited()))
return Definition; return Definition;
if (const auto *SAA = getAttr<SelectAnyAttr>())
if (!SAA->isInherited())
return Definition;
// A variable template specialization (other than a static data member // A variable template specialization (other than a static data member
// template or an explicit specialization) is a declaration until we // template or an explicit specialization) is a declaration until we
// instantiate its initializer. // instantiate its initializer.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment