mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-18 16:58:23 +00:00
[AST] hasAttr followed by getAttr isn't efficient
Just use getAttr because we are interested in the attribute's contents. llvm-svn: 237336
This commit is contained in:
parent
87b853c5f0
commit
dd0bed1b2d
@ -1915,10 +1915,13 @@ VarDecl::isThisDeclarationADefinition(ASTContext &C) const {
|
||||
if (hasInit())
|
||||
return Definition;
|
||||
|
||||
if (hasAttr<AliasAttr>() ||
|
||||
(hasAttr<SelectAnyAttr>() && !getAttr<SelectAnyAttr>()->isInherited()))
|
||||
if (hasAttr<AliasAttr>())
|
||||
return Definition;
|
||||
|
||||
if (const auto *SAA = getAttr<SelectAnyAttr>())
|
||||
if (!SAA->isInherited())
|
||||
return Definition;
|
||||
|
||||
// A variable template specialization (other than a static data member
|
||||
// template or an explicit specialization) is a declaration until we
|
||||
// instantiate its initializer.
|
||||
|
Loading…
x
Reference in New Issue
Block a user