llvm-project
90374e03 - [Clang][NFC] Use const ASTContext reference in Decl Create methods

Commit
38 days ago
[Clang][NFC] Use const ASTContext reference in Decl Create methods Update Create() static factory methods, CreateDeserialized() methods, and constructors in Decl.h to accept const ASTContext& instead of ASTContext&. This change makes ASTContext parameters const-correct for declaration creation and deserialization, affecting all Decl subclasses declared in Decl.h. Special mention: - TranslationUnitDecl::Create() and constructor: Now accept const ASTContext& and store it as a const reference. The getASTContext() method uses const_cast to maintain API compatibility with code that expects a non-const reference. This is safe since the ASTContext is always created as non-const. Assisted-By: Claude Sonnet 4.5
Author
Committer
Parents
Loading