https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/109760
None >From decabdb5b12f11a72cc1d63507ced2c1e1def792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbae...@redhat.com> Date: Tue, 24 Sep 2024 09:12:43 +0200 Subject: [PATCH] [clang][bytecode] Ignore CPointerToObjCPointerCasts --- clang/lib/AST/ByteCode/Compiler.cpp | 1 + clang/test/AST/ByteCode/codegen.m | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp index e89863a231bed4..939a3aa43ff8dd 100644 --- a/clang/lib/AST/ByteCode/Compiler.cpp +++ b/clang/lib/AST/ByteCode/Compiler.cpp @@ -431,6 +431,7 @@ bool Compiler<Emitter>::VisitCastExpr(const CastExpr *CE) { case CK_NoOp: case CK_UserDefinedConversion: case CK_AddressSpaceConversion: + case CK_CPointerToObjCPointerCast: return this->delegate(SubExpr); case CK_BitCast: { diff --git a/clang/test/AST/ByteCode/codegen.m b/clang/test/AST/ByteCode/codegen.m index 08c3d9a70b36d7..6139596c6337a2 100644 --- a/clang/test/AST/ByteCode/codegen.m +++ b/clang/test/AST/ByteCode/codegen.m @@ -10,3 +10,8 @@ // // CHECK-NEXT: @.str = {{.*}}constant [13 x i8] c"Hello World!\00", section "__TEXT,__cstring,cstring_literals", align 1 id a = @"Hello World!"; + +extern void OBJC_CLASS_$_f; +Class c = (Class)&OBJC_CLASS_$_f; +// CHECK: @c ={{.*}} global ptr @"OBJC_CLASS_$_f" +// CHECK: @"OBJC_CLASS_$_f" ={{.*}} global %struct._class_t _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits