llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang Author: eleviant <details> <summary>Changes</summary> This reverts commit a4ddeba8daff36c8e6285fa3603185b4c9b41718, which raised concerns, see: https://github.com/llvm/llvm-project/pull/193800 --- Full diff: https://github.com/llvm/llvm-project/pull/196307.diff 3 Files Affected: - (modified) clang/docs/ReleaseNotes.rst (-2) - (modified) clang/include/clang/Options/Options.td (+2-2) - (removed) clang/test/CodeGen/MSKernel/null-deref.c (-16) ``````````diff diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index cb19b80b7e994..ba235afffe20f 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -291,8 +291,6 @@ Modified Compiler Flags - The `-mno-outline` and `-moutline` compiler flags are now allowed on RISC-V and X86, which both support the machine outliner. - The `-mno-outline` flag will now add the `nooutline` IR attribute, so that `-mno-outline` and `-moutline` objects can be mixed correctly during LTO. -- The `-fms-kernel` flag will now implicitly add -fno-delete-null-pointer-checks. - Still -fdelete-null-pointer-checks can be used to override this behavior. Removed Compiler Flags ---------------------- diff --git a/clang/include/clang/Options/Options.td b/clang/include/clang/Options/Options.td index 863e6b3d0871f..e21ea8a6529a1 100644 --- a/clang/include/clang/Options/Options.td +++ b/clang/include/clang/Options/Options.td @@ -3037,10 +3037,10 @@ defm rewrite_includes : BoolFOption<"rewrite-includes", defm directives_only : OptInCC1FFlag<"directives-only", "">; defm delete_null_pointer_checks : BoolFOption<"delete-null-pointer-checks", - CodeGenOpts<"NullPointerIsValid">, Default<"LangOpts->Kernel">, + CodeGenOpts<"NullPointerIsValid">, DefaultFalse, NegFlag<SetTrue, [], [ClangOption, CC1Option], "Do not treat usage of null pointers as undefined behavior">, - PosFlag<SetFalse, [], [ClangOption, CC1Option], "Treat usage of null pointers as undefined behavior (default)">, + PosFlag<SetFalse, [], [ClangOption], "Treat usage of null pointers as undefined behavior (default)">, BothFlags<[], [ClangOption, CLOption]>>, DocBrief<[{When enabled, treat null pointer dereference, creation of a reference to null, or passing a null pointer to a function parameter annotated with the "nonnull" diff --git a/clang/test/CodeGen/MSKernel/null-deref.c b/clang/test/CodeGen/MSKernel/null-deref.c deleted file mode 100644 index f23409115f50d..0000000000000 --- a/clang/test/CodeGen/MSKernel/null-deref.c +++ /dev/null @@ -1,16 +0,0 @@ -// Check that null pointer checks are not omited in kernel mode compilations -// RUN: %clang_cc1 -fms-kernel -fms-extensions -triple x86_64-pc-windows-msvc %s -emit-llvm -o - | FileCheck %s -// RUN: %clang_cc1 -fms-kernel -fms-extensions -triple x86_64-pc-windows-msvc -fdelete-null-pointer-checks %s -emit-llvm -o - | FileCheck %s --check-prefix=NOCHECK - -// CHECK: define dso_local i32 @process(ptr noundef %p) #0 -// CHECK: attributes #0 = {{.*}} null_pointer_is_valid -// NOCHECK-NOT: null_pointer_is_valid - -struct Obj { int value; int extra; }; - -int process(struct Obj* p) { - int v = p->value; - if (!p) - return -1; - return v + p->extra; -} `````````` </details> https://github.com/llvm/llvm-project/pull/196307 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
