aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGException.cpp
diff options
context:
space:
mode:
authorantonrydahl <rydahl2610@gmail.com>2023-08-29 15:59:47 -0700
committerantonrydahl <rydahl2610@gmail.com>2023-08-29 15:59:47 -0700
commit7af0eff5405bb88dc96c0b19892da0fbb44db433 (patch)
tree5afa712a538f8a546022520daf48571d91984696 /clang/lib/CodeGen/CGException.cpp
parent5a902312f1965cf84016b71add38c212c3cf4168 (diff)
downloadllvm-7af0eff5405bb88dc96c0b19892da0fbb44db433.zip
llvm-7af0eff5405bb88dc96c0b19892da0fbb44db433.tar.gz
llvm-7af0eff5405bb88dc96c0b19892da0fbb44db433.tar.bz2
Revert "[OpenMP] Allow exceptions in target regions when offloading to GPUs"
This reverts commit 4c62e943b7178127861ca39163a0ed4caeb14943.
Diffstat (limited to 'clang/lib/CodeGen/CGException.cpp')
-rw-r--r--clang/lib/CodeGen/CGException.cpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp
index 3996f29..9cb7d4c 100644
--- a/clang/lib/CodeGen/CGException.cpp
+++ b/clang/lib/CodeGen/CGException.cpp
@@ -440,15 +440,6 @@ llvm::Value *CodeGenFunction::getSelectorFromSlot() {
void CodeGenFunction::EmitCXXThrowExpr(const CXXThrowExpr *E,
bool KeepInsertionPoint) {
- // If the exception is being emitted in an OpenMP target region,
- // and the target is a GPU, we do not support exception handling.
- // Therefore, we emit a trap which will abort the program, and
- // prompt a warning indicating that a trap will be emitted.
- const llvm::Triple &T = Target.getTriple();
- if (CGM.getLangOpts().OpenMPIsTargetDevice && (T.isNVPTX() || T.isAMDGCN())) {
- EmitTrapCall(llvm::Intrinsic::trap);
- return;
- }
if (const Expr *SubExpr = E->getSubExpr()) {
QualType ThrowType = SubExpr->getType();
if (ThrowType->isObjCObjectPointerType()) {
@@ -618,16 +609,9 @@ void CodeGenFunction::EmitEndEHSpec(const Decl *D) {
}
void CodeGenFunction::EmitCXXTryStmt(const CXXTryStmt &S) {
- const llvm::Triple &T = Target.getTriple();
- // If we encounter a try statement on in an OpenMP target region offloaded to
- // a GPU, we treat it as a basic block.
- const bool IsTargetDevice =
- (CGM.getLangOpts().OpenMPIsTargetDevice && (T.isNVPTX() || T.isAMDGCN()));
- if (!IsTargetDevice)
- EnterCXXTryStmt(S);
+ EnterCXXTryStmt(S);
EmitStmt(S.getTryBlock());
- if (!IsTargetDevice)
- ExitCXXTryStmt(S);
+ ExitCXXTryStmt(S);
}
void CodeGenFunction::EnterCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock) {