[AST] Avoid walking macro expanded bodies in non-expanded mode

Make sure we don't walk into the expansion of a body macro if the AST
walker is configured not to walk macro expansions.
This commit is contained in:
Hamish Knight
2025-12-10 14:58:44 +00:00
parent f0d4572a92
commit a9ad4e2cae
2 changed files with 11 additions and 1 deletions

View File

@@ -8065,6 +8065,11 @@ public:
/// type-checked.
BraceStmt *getMacroExpandedBody() const;
/// Whether the body of the function has been expanded from a body macro.
bool isBodyMacroExpanded() const {
return getBodyExpandedStatus() == BodyExpandedStatus::Expanded;
}
/// Retrieve the type-checked body of the given function, or \c nullptr if
/// there's no body available.
BraceStmt *getTypecheckedBody() const;