Author: Fangrui Song Date: 2022-11-23T22:53:23-08:00 New Revision: e690a346454958372de0ec1c762544864e9f5406
URL: https://github.com/llvm/llvm-project/commit/e690a346454958372de0ec1c762544864e9f5406 DIFF: https://github.com/llvm/llvm-project/commit/e690a346454958372de0ec1c762544864e9f5406.diff LOG: AST: Internalize functions after D111283 Added: Modified: clang/lib/AST/ASTContext.cpp Removed: ################################################################################ diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index e887f44b3ca0b..08f5b1a59d46d 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -12277,14 +12277,14 @@ static Decl *getCommonDecl(Decl *X, Decl *Y) { } template <class T, std::enable_if_t<std::is_base_of_v<Decl, T>, bool> = true> -T *getCommonDecl(T *X, T *Y) { +static T *getCommonDecl(T *X, T *Y) { return cast_or_null<T>( getCommonDecl(const_cast<Decl *>(cast_or_null<Decl>(X)), const_cast<Decl *>(cast_or_null<Decl>(Y)))); } template <class T, std::enable_if_t<std::is_base_of_v<Decl, T>, bool> = true> -T *getCommonDeclChecked(T *X, T *Y) { +static T *getCommonDeclChecked(T *X, T *Y) { return cast<T>(getCommonDecl(const_cast<Decl *>(cast<Decl>(X)), const_cast<Decl *>(cast<Decl>(Y)))); } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits