Skip to content

Commit bbd2a48

Browse files
authored
Define Print_Canonical_Types for llvm 21 compatibility
1 parent 8c81b18 commit bbd2a48

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
@@ -1954,7 +1954,7 @@ static void GetDeclName(const clang::Decl* D, ASTContext& Context,
19541954
PrintingPolicy Policy(Context.getPrintingPolicy());
19551955
Policy.SuppressTagKeyword = true;
19561956
Policy.SuppressUnwrittenScope = true;
1957-
Policy.PrintCanonicalTypes = true;
1957+
Policy.Print_Canonical_Types = true;
19581958
if (const TypeDecl* TD = dyn_cast<TypeDecl>(D)) {
19591959
// This is a class, struct, or union member.
19601960
QualType QT;

0 commit comments

Comments
 (0)