Skip to content

Commit f193bcc

Browse files
committed
Revert D105169 due to the two-stage failure in ASAN
This reverts the following commits: 37ca7a7 9aa6c72 705387c 8ca4b3e 80dba72
1 parent 616a3cc commit f193bcc

File tree

1,108 files changed

+51256
-51079
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,108 files changed

+51256
-51079
lines changed

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ CODEGENOPT(DisableLifetimeMarkers, 1, 0) ///< Don't emit any lifetime markers
6464
CODEGENOPT(DisableO0ImplyOptNone , 1, 0) ///< Don't annonate function with optnone at O0
6565
CODEGENOPT(ExperimentalStrictFloatingPoint, 1, 0) ///< Enables the new, experimental
6666
///< strict floating point.
67-
CODEGENOPT(DisableNoundefAttrs, 1, 0) ///< Disable emitting `noundef` attributes on IR call arguments and return values
67+
CODEGENOPT(EnableNoundefAttrs, 1, 0) ///< Enable emitting `noundef` attributes on IR call arguments and return values
6868
CODEGENOPT(LegacyPassManager, 1, 0) ///< Use the legacy pass manager.
6969
CODEGENOPT(DebugPassManager, 1, 0) ///< Prints debug information for the new
7070
///< pass manager.

clang/include/clang/Driver/Options.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5314,9 +5314,9 @@ def disable_free : Flag<["-"], "disable-free">,
53145314
def clear_ast_before_backend : Flag<["-"], "clear-ast-before-backend">,
53155315
HelpText<"Clear the Clang AST before running backend code generation">,
53165316
MarshallingInfoFlag<CodeGenOpts<"ClearASTBeforeBackend">>;
5317-
def disable_noundef_analysis : Flag<["-"], "disable-noundef-analysis">, Group<f_Group>,
5318-
HelpText<"Disable analyzing function argument and return types for mandatory definedness">,
5319-
MarshallingInfoFlag<CodeGenOpts<"DisableNoundefAttrs">>;
5317+
def enable_noundef_analysis : Flag<["-"], "enable-noundef-analysis">, Group<f_Group>,
5318+
HelpText<"Enable analyzing function argument and return types for mandatory definedness">,
5319+
MarshallingInfoFlag<CodeGenOpts<"EnableNoundefAttrs">>;
53205320
def discard_value_names : Flag<["-"], "discard-value-names">,
53215321
HelpText<"Discard value names in LLVM IR">,
53225322
MarshallingInfoFlag<CodeGenOpts<"DiscardValueNames">>;

clang/lib/CodeGen/CGCall.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2255,7 +2255,7 @@ void CodeGenModule::ConstructAttributeList(
22552255
getLangOpts().Sanitize.has(SanitizerKind::Return);
22562256

22572257
// Determine if the return type could be partially undef
2258-
if (!CodeGenOpts.DisableNoundefAttrs && HasStrictReturn) {
2258+
if (CodeGenOpts.EnableNoundefAttrs && HasStrictReturn) {
22592259
if (!RetTy->isVoidType() && RetAI.getKind() != ABIArgInfo::Indirect &&
22602260
DetermineNoUndef(RetTy, getTypes(), DL, RetAI))
22612261
RetAttrs.addAttribute(llvm::Attribute::NoUndef);
@@ -2390,7 +2390,7 @@ void CodeGenModule::ConstructAttributeList(
23902390

23912391
// Decide whether the argument we're handling could be partially undef
23922392
bool ArgNoUndef = DetermineNoUndef(ParamType, getTypes(), DL, AI);
2393-
if (!CodeGenOpts.DisableNoundefAttrs && ArgNoUndef)
2393+
if (CodeGenOpts.EnableNoundefAttrs && ArgNoUndef)
23942394
Attrs.addAttribute(llvm::Attribute::NoUndef);
23952395

23962396
// 'restrict' -> 'noalias' is done in EmitFunctionProlog when we

clang/test/CXX/except/except.spec/p14-ir.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ struct X4 {
2626
struct X5 : X0, X4 { };
2727

2828
void test(X2 x2, X3 x3, X5 x5) {
29-
// CHECK: define linkonce_odr void @_ZN2X2C1ERKS_(%struct.X2* {{[^,]*}} %this, %struct.X2* noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0) unnamed_addr
29+
// CHECK: define linkonce_odr void @_ZN2X2C1ERKS_(%struct.X2* {{[^,]*}} %this, %struct.X2* nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0) unnamed_addr
3030
// CHECK: call void @_ZN2X2C2ERKS_({{.*}}) [[NUW:#[0-9]+]]
3131
// CHECK-NEXT: ret void
3232
// CHECK-NEXT: }
3333
X2 x2a(x2);
34-
// CHECK: define linkonce_odr void @_ZN2X3C1ERKS_(%struct.X3* {{[^,]*}} %this, %struct.X3* noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0) unnamed_addr
34+
// CHECK: define linkonce_odr void @_ZN2X3C1ERKS_(%struct.X3* {{[^,]*}} %this, %struct.X3* nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0) unnamed_addr
3535
// CHECK: call void @_ZN2X3C2ERKS_({{.*}}) [[NUW]]
3636
// CHECK-NEXT: ret void
3737
// CHECK-NEXT: }

clang/test/CXX/expr/expr.prim/expr.prim.lambda/blocks-irgen.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ bool f1(int *x) {
1313
return outer();
1414
}
1515

16-
// CHECK: define internal noundef zeroext i1 @___ZN7PR127462f1EPi_block_invoke
17-
// CHECK: call noundef zeroext i1 @"_ZZZN7PR127462f1EPiEUb_ENK3$_0clEv"
16+
// CHECK: define internal zeroext i1 @___ZN7PR127462f1EPi_block_invoke
17+
// CHECK: call zeroext i1 @"_ZZZN7PR127462f1EPiEUb_ENK3$_0clEv"
1818

1919
bool f2(int *x) {
2020
auto outer = [&]() -> bool {

clang/test/CodeGen/2005-01-02-ConstantInits.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,21 @@ int i = (int) &( ((struct X *)0) -> a[1]);
2929
int Arr[100];
3030

3131
// CHECK-LABEL: define {{[^@]+}}@foo
32-
// CHECK-SAME: (i32 noundef [[I:%.*]]) #[[ATTR0]] {
32+
// CHECK-SAME: (i32 [[I:%.*]]) #[[ATTR0]] {
3333
// CHECK-NEXT: entry:
3434
// CHECK-NEXT: [[I_ADDR:%.*]] = alloca i32, align 4
3535
// CHECK-NEXT: store i32 [[I]], i32* [[I_ADDR]], align 4
36-
// CHECK-NEXT: [[CALL:%.*]] = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* noundef getelementptr inbounds ([100 x i32], [100 x i32]* @Arr, i64 0, i64 49))
36+
// CHECK-NEXT: [[CALL:%.*]] = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* getelementptr inbounds ([100 x i32], [100 x i32]* @Arr, i64 0, i64 49))
3737
// CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[I_ADDR]], align 4
3838
// CHECK-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP0]] to i64
3939
// CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [100 x i32], [100 x i32]* @Arr, i64 0, i64 [[IDXPROM]]
40-
// CHECK-NEXT: [[CALL1:%.*]] = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* noundef [[ARRAYIDX]])
40+
// CHECK-NEXT: [[CALL1:%.*]] = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* [[ARRAYIDX]])
4141
// CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[CALL]], [[CALL1]]
4242
// CHECK-NEXT: ret i32 [[ADD]]
4343
//
4444
int foo(int i) { return bar(&Arr[49])+bar(&Arr[i]); }
4545
// CHECK-LABEL: define {{[^@]+}}@foo2
46-
// CHECK-SAME: (i32 noundef [[I:%.*]]) #[[ATTR0]] {
46+
// CHECK-SAME: (i32 [[I:%.*]]) #[[ATTR0]] {
4747
// CHECK-NEXT: entry:
4848
// CHECK-NEXT: [[I_ADDR:%.*]] = alloca i32, align 4
4949
// CHECK-NEXT: [[P:%.*]] = alloca i32*, align 8
@@ -55,7 +55,7 @@ int foo(int i) { return bar(&Arr[49])+bar(&Arr[i]); }
5555
// CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[I_ADDR]], align 4
5656
// CHECK-NEXT: [[IDX_EXT:%.*]] = sext i32 [[TMP1]] to i64
5757
// CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @Arr, i64 0, i64 0), i64 [[IDX_EXT]]
58-
// CHECK-NEXT: [[CALL:%.*]] = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* noundef [[ADD_PTR]])
58+
// CHECK-NEXT: [[CALL:%.*]] = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* [[ADD_PTR]])
5959
// CHECK-NEXT: ret i32 [[CALL]]
6060
//
6161
int foo2(int i) {

clang/test/CodeGen/2006-05-19-SingleEltReturn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct Y bar() {
2323
}
2424

2525

26-
// X86_32: define{{.*}} void @foo(%struct.Y* noundef %P)
26+
// X86_32: define{{.*}} void @foo(%struct.Y* %P)
2727
// X86_32: call void @bar(%struct.Y* sret(%struct.Y) align 4 %{{[^),]*}})
2828

2929
// X86_32: define{{.*}} void @bar(%struct.Y* noalias sret(%struct.Y) align 4 %{{[^,)]*}})

clang/test/CodeGen/2007-06-18-SextAttrAggregate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -disable-noundef-analysis %s -o - -emit-llvm | FileCheck %s
1+
// RUN: %clang_cc1 %s -o - -emit-llvm | FileCheck %s
22
// XFAIL: aarch64, arm64, x86_64-pc-windows-msvc, x86_64-w64-windows-gnu, x86_64-pc-windows-gnu
33

44
// PR1513

clang/test/CodeGen/2009-02-13-zerosize-union-field.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 %s -disable-noundef-analysis -triple i686-apple-darwin -emit-llvm -o - | FileCheck %s
1+
// RUN: %clang_cc1 %s -triple i686-apple-darwin -emit-llvm -o - | FileCheck %s
22
// Every printf has 'i32 0' for the GEP of the string; no point counting those.
33
typedef unsigned int Foo __attribute__((aligned(32)));
44
typedef union{Foo:0;}a;

clang/test/CodeGen/2009-05-04-EnumInreg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -disable-noundef-analysis -emit-llvm -triple i686-apple-darwin -mregparm 3 %s -o - | FileCheck %s
1+
// RUN: %clang_cc1 -emit-llvm -triple i686-apple-darwin -mregparm 3 %s -o - | FileCheck %s
22
// PR3967
33

44
enum kobject_action {

0 commit comments

Comments
 (0)