-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang][CodeGen] The
eh_typeid_for
intrinsic needs special care too (…
…#65699) This change is symmetric with the one reviewed in <https://reviews.llvm.org/D157452> and handles the exception handling specific intrinsic, which slipped through the cracks, in the same way, by inserting an address-space cast iff RTTI is in a non-default AS.
- Loading branch information
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// RUN: %clang_cc1 %s -triple=amdgcn-amd-amdhsa -emit-llvm -o - -fcxx-exceptions -fexceptions | FileCheck %s | ||
|
||
struct X { }; | ||
|
||
const X g(); | ||
|
||
void f() { | ||
try { | ||
throw g(); | ||
// CHECK: ptr addrspace(1) @_ZTI1X | ||
} catch (const X x) { | ||
// CHECK: catch ptr addrspace(1) @_ZTI1X | ||
// CHECK: call i32 @llvm.eh.typeid.for(ptr addrspacecast (ptr addrspace(1) @_ZTI1X to ptr)) | ||
} | ||
} | ||
|
||
void h() { | ||
try { | ||
throw "ABC"; | ||
// CHECK: ptr addrspace(1) @_ZTIPKc | ||
} catch (char const(&)[4]) { | ||
// CHECK: catch ptr addrspace(1) @_ZTIA4_c | ||
// CHECK: call i32 @llvm.eh.typeid.for(ptr addrspacecast (ptr addrspace(1) @_ZTIA4_c to ptr)) | ||
} | ||
} |