summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Gräsman <kim.grasman@gmail.com>2022-08-28 15:10:56 +0200
committerKim Gräsman <kim.grasman@gmail.com>2022-08-28 16:16:04 +0200
commit0be9166fe6d3292af72bb2d888632fe0ce74ebad (patch)
tree23fa55be66e6310f773a14e2e3cf23b99c66d053
parent941fc197852d9f6ff82f4f0deafe97a08d7affd8 (diff)
Rename IsElaborationNode to IsElaboratedTypeSpecifier
'Elaborated type specifier' is the formal term for 'struct X', 'class Y' or 'union Z'. Use it to avoid potential confusion around what 'elaboration node' means. Clean up a comment that claimed 'MostElaboratedAncestor' used 'IsElaborationNode', where it actually doesn't. No functional change.
-rw-r--r--iwyu.cc2
-rw-r--r--iwyu_ast_util.cc2
-rw-r--r--iwyu_ast_util.h4
3 files changed, 4 insertions, 4 deletions
diff --git a/iwyu.cc b/iwyu.cc
index 52198f7..d7073fd 100644
--- a/iwyu.cc
+++ b/iwyu.cc
@@ -4063,7 +4063,7 @@ class IwyuAstConsumer
// Note that enums are never forward-declarable, so elaborated enums are
// already short-circuited in CanForwardDeclareType.
const ASTNode* parent = current_ast_node()->parent();
- if (!IsElaborationNode(parent) || IsQualifiedNameNode(parent))
+ if (!IsElaboratedTypeSpecifier(parent) || IsQualifiedNameNode(parent))
ReportDeclForwardDeclareUse(CurrentLoc(), type->getDecl());
} else {
// In C, all struct references are elaborated, so we really never need
diff --git a/iwyu_ast_util.cc b/iwyu_ast_util.cc
index b4ed844..fa0147f 100644
--- a/iwyu_ast_util.cc
+++ b/iwyu_ast_util.cc
@@ -233,7 +233,7 @@ bool ASTNode::FillLocationIfKnown(SourceLocation* loc) const {
// --- Utilities for ASTNode.
-bool IsElaborationNode(const ASTNode* ast_node) {
+bool IsElaboratedTypeSpecifier(const ASTNode* ast_node) {
if (ast_node == nullptr)
return false;
const ElaboratedType* elaborated_type = ast_node->GetAs<ElaboratedType>();
diff --git a/iwyu_ast_util.h b/iwyu_ast_util.h
index 164d7d2..9769618 100644
--- a/iwyu_ast_util.h
+++ b/iwyu_ast_util.h
@@ -368,10 +368,10 @@ class CurrentASTNodeUpdater {
// elaboration is 'class Foo myvar' instead of just 'Foo myvar'.)
// We avoid 'fake' elaborations that are caused because clang also
// uses ElaboratedType for namespaces ('ns::Foo myvar').
-bool IsElaborationNode(const ASTNode* ast_node);
+bool IsElaboratedTypeSpecifier(const ASTNode* ast_node);
// Walk up to parents of the given node so long as each parent is an
-// elaboration node (in the sense of IsElaborationNode).
+// elaborated type node.
// Can expand from a node representing 'X' to e.g. 'struct X' or 'mylib::X'.
const ASTNode* MostElaboratedAncestor(const ASTNode* ast_node);