Skip to content

Commit 66dbc49

Browse files
committed
Limit changes to Driver
1 parent 346adc1 commit 66dbc49

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

clang/lib/CodeGen/CGExpr.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3602,7 +3602,6 @@ void CodeGenFunction::EmitCheck(
36023602
llvm::Value *RecoverableCond = nullptr;
36033603
llvm::Value *TrapCond = nullptr;
36043604
bool NoMerge = false;
3605-
bool SanitizeGuardChecks = ClSanitizeGuardChecks;
36063605
for (int i = 0, n = Checked.size(); i < n; ++i) {
36073606
llvm::Value *Check = Checked[i].first;
36083607
// -fsanitize-trap= overrides -fsanitize-recover=.
@@ -3616,12 +3615,9 @@ void CodeGenFunction::EmitCheck(
36163615

36173616
if (!CGM.getCodeGenOpts().SanitizeMergeHandlers.has(Checked[i].second))
36183617
NoMerge = true;
3619-
3620-
if (!CGM.getCodeGenOpts().NoSanitizeTopHot.has(Checked[i].second))
3621-
SanitizeGuardChecks = true;
36223618
}
36233619

3624-
if (SanitizeGuardChecks) {
3620+
if (ClSanitizeGuardChecks) {
36253621
llvm::Value *Allow =
36263622
Builder.CreateCall(CGM.getIntrinsic(llvm::Intrinsic::allow_ubsan_check),
36273623
llvm::ConstantInt::get(CGM.Int8Ty, CheckHandler));

clang/test/CodeGen/allow-ubsan-check.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -o - %s -fsanitize=signed-integer-overflow,integer-divide-by-zero,null -mllvm -ubsan-guard-checks -fsanitize-trap=signed-integer-overflow,integer-divide-by-zero,null | FileCheck %s --check-prefixes=TRAP
44
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -o - %s -fsanitize=signed-integer-overflow,integer-divide-by-zero,null -mllvm -ubsan-guard-checks -fsanitize-recover=signed-integer-overflow,integer-divide-by-zero,null | FileCheck %s --check-prefixes=RECOVER
55

6-
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -o - %s -fsanitize=signed-integer-overflow,integer-divide-by-zero,null -fno-sanitize-top-hot=signed-integer-overflow=1,integer-divide-by-zero=1,null=1 | FileCheck %s
7-
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -o - %s -fsanitize=signed-integer-overflow,integer-divide-by-zero,null -fno-sanitize-top-hot=signed-integer-overflow=1,integer-divide-by-zero=1,null=1 -fsanitize-trap=signed-integer-overflow,integer-divide-by-zero,null | FileCheck %s --check-prefixes=TRAP
8-
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -o - %s -fsanitize=signed-integer-overflow,integer-divide-by-zero,null -fno-sanitize-top-hot=signed-integer-overflow=1,integer-divide-by-zero=1,null=1 -fsanitize-recover=signed-integer-overflow,integer-divide-by-zero,null | FileCheck %s --check-prefixes=RECOVER
9-
10-
116
// CHECK-LABEL: define dso_local i32 @div(
127
// CHECK-SAME: i32 noundef [[X:%.*]], i32 noundef [[Y:%.*]]) #[[ATTR0:[0-9]+]] {
138
// CHECK-NEXT: entry:

0 commit comments

Comments
 (0)