Skip to content

Commit ed5b80c

Browse files
mcbartonVipul-Cariappa
authored andcommitted
Define Print_Canonical_Types for llvm 21 compatibility
1 parent 113b7a6 commit ed5b80c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/CppInterOp/Compatibility.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ static inline char* GetEnv(const char* Var_Name) {
3131
#endif
3232
}
3333

34+
#if CLANG_VERSION_MAJOR < 21
35+
#define Print_Canonical_Types PrintCanonicalTypes
36+
#else
37+
#define Print_Canonical_Types PrintAsCanonical
38+
#endif
39+
3440
#if CLANG_VERSION_MAJOR < 21
3541
#define clang_LookupResult_Found clang::LookupResult::Found
3642
#define clang_LookupResult_Not_Found clang::LookupResult::NotFound

lib/CppInterOp/CppInterOp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2108,7 +2108,7 @@ static void GetDeclName(const clang::Decl* D, ASTContext& Context,
21082108
PrintingPolicy Policy(Context.getPrintingPolicy());
21092109
Policy.SuppressTagKeyword = true;
21102110
Policy.SuppressUnwrittenScope = true;
2111-
Policy.PrintCanonicalTypes = true;
2111+
Policy.Print_Canonical_Types = true;
21122112
if (const TypeDecl* TD = dyn_cast<TypeDecl>(D)) {
21132113
// This is a class, struct, or union member.
21142114
QualType QT;

0 commit comments

Comments
 (0)