[PATCH] D64506: clang-cl: Remove -O0 option

2019-07-10 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL365724: clang-cl: Remove -O0 option (authored by nico, 
committed by ).
Herald added a subscriber: delcypher.

Changed prior to commit:
  https://reviews.llvm.org/D64506?vs=209092=209111#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64506/new/

https://reviews.llvm.org/D64506

Files:
  cfe/trunk/include/clang/Driver/CLCompatOptions.td
  compiler-rt/trunk/test/asan/TestCases/Windows/aligned_mallocs.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/allocators_sanity.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/beginthreadex.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/bitfield.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/bitfield_uaf.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/calloc_left_oob.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/calloc_right_oob.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/calloc_uaf.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/coverage-dll-stdio.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/crt_initializers.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/demangled_names.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/dll_aligned_mallocs.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/dll_allocators_sanity.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/dll_cerr.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/dll_control_c.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/dll_global_dead_strip.c
  compiler-rt/trunk/test/asan/TestCases/Windows/dll_host.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/dll_intercept_memchr.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/dll_intercept_memcpy.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/dll_intercept_memcpy_indirect.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/dll_intercept_memset.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/dll_intercept_strlen.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/dll_malloc_left_oob.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/dll_malloc_uaf.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/dll_noreturn.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/dll_null_deref.cc
  
compiler-rt/trunk/test/asan/TestCases/Windows/dll_operator_array_new_left_oob.cc
  
compiler-rt/trunk/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/dll_poison_unpoison.cc
  
compiler-rt/trunk/test/asan/TestCases/Windows/dll_report_globals_symbolization_at_startup.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/dll_seh.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/dll_stack_use_after_return.cc
  
compiler-rt/trunk/test/asan/TestCases/Windows/dll_thread_stack_array_left_oob.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/double_free.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/double_operator_delete.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/global_const_string.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/global_const_string_oob.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/heapalloc.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/heapalloc_doublefree.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/heapalloc_flags_fallback.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/heapalloc_huge.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/heapalloc_sanity.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/heapalloc_uaf.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/heaprealloc.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/hello_world.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/intercept_memcpy.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/intercept_strdup.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/intercept_strlen.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/interface_symbols_windows.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/iostream_sbo.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/malloc_left_oob.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/malloc_right_oob.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/malloc_uaf.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/null_deref_multiple_dlls.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/oom.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/operator_array_new_left_oob.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/operator_array_new_right_oob.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/operator_array_new_uaf.cc
  
compiler-rt/trunk/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cc
  
compiler-rt/trunk/test/asan/TestCases/Windows/operator_delete_wrong_argument.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/operator_new_left_oob.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/operator_new_right_oob.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/operator_new_uaf.cc
  compiler-rt/trunk/test/asan/TestCases/Windows/queue_user_work_item_report.cc
  

[PATCH] D64506: clang-cl: Remove -O0 option

2019-07-10 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

lgtm


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64506/new/

https://reviews.llvm.org/D64506



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D64506: clang-cl: Remove -O0 option

2019-07-10 Thread Nico Weber via Phabricator via cfe-commits
thakis updated this revision to Diff 209092.
thakis added a comment.
Herald added subscribers: llvm-commits, kubamracek.
Herald added a project: LLVM.

update tests

(not yet executed, don't have a win machine today)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64506/new/

https://reviews.llvm.org/D64506

Files:
  clang/include/clang/Driver/CLCompatOptions.td
  compiler-rt/test/asan/TestCases/Windows/aligned_mallocs.cc
  compiler-rt/test/asan/TestCases/Windows/allocators_sanity.cc
  compiler-rt/test/asan/TestCases/Windows/beginthreadex.cc
  compiler-rt/test/asan/TestCases/Windows/bitfield.cc
  compiler-rt/test/asan/TestCases/Windows/bitfield_uaf.cc
  compiler-rt/test/asan/TestCases/Windows/calloc_left_oob.cc
  compiler-rt/test/asan/TestCases/Windows/calloc_right_oob.cc
  compiler-rt/test/asan/TestCases/Windows/calloc_uaf.cc
  compiler-rt/test/asan/TestCases/Windows/coverage-dll-stdio.cc
  compiler-rt/test/asan/TestCases/Windows/crt_initializers.cc
  compiler-rt/test/asan/TestCases/Windows/demangled_names.cc
  compiler-rt/test/asan/TestCases/Windows/dll_aligned_mallocs.cc
  compiler-rt/test/asan/TestCases/Windows/dll_allocators_sanity.cc
  compiler-rt/test/asan/TestCases/Windows/dll_cerr.cc
  compiler-rt/test/asan/TestCases/Windows/dll_control_c.cc
  compiler-rt/test/asan/TestCases/Windows/dll_global_dead_strip.c
  compiler-rt/test/asan/TestCases/Windows/dll_host.cc
  compiler-rt/test/asan/TestCases/Windows/dll_intercept_memchr.cc
  compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy.cc
  compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy_indirect.cc
  compiler-rt/test/asan/TestCases/Windows/dll_intercept_memset.cc
  compiler-rt/test/asan/TestCases/Windows/dll_intercept_strlen.cc
  compiler-rt/test/asan/TestCases/Windows/dll_malloc_left_oob.cc
  compiler-rt/test/asan/TestCases/Windows/dll_malloc_uaf.cc
  compiler-rt/test/asan/TestCases/Windows/dll_noreturn.cc
  compiler-rt/test/asan/TestCases/Windows/dll_null_deref.cc
  compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_left_oob.cc
  
compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cc
  compiler-rt/test/asan/TestCases/Windows/dll_poison_unpoison.cc
  
compiler-rt/test/asan/TestCases/Windows/dll_report_globals_symbolization_at_startup.cc
  compiler-rt/test/asan/TestCases/Windows/dll_seh.cc
  compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cc
  compiler-rt/test/asan/TestCases/Windows/dll_thread_stack_array_left_oob.cc
  compiler-rt/test/asan/TestCases/Windows/double_free.cc
  compiler-rt/test/asan/TestCases/Windows/double_operator_delete.cc
  compiler-rt/test/asan/TestCases/Windows/global_const_string.cc
  compiler-rt/test/asan/TestCases/Windows/global_const_string_oob.cc
  compiler-rt/test/asan/TestCases/Windows/heapalloc.cc
  compiler-rt/test/asan/TestCases/Windows/heapalloc_doublefree.cc
  compiler-rt/test/asan/TestCases/Windows/heapalloc_flags_fallback.cc
  compiler-rt/test/asan/TestCases/Windows/heapalloc_huge.cc
  compiler-rt/test/asan/TestCases/Windows/heapalloc_sanity.cc
  compiler-rt/test/asan/TestCases/Windows/heapalloc_uaf.cc
  compiler-rt/test/asan/TestCases/Windows/heaprealloc.cc
  compiler-rt/test/asan/TestCases/Windows/hello_world.cc
  compiler-rt/test/asan/TestCases/Windows/intercept_memcpy.cc
  compiler-rt/test/asan/TestCases/Windows/intercept_strdup.cc
  compiler-rt/test/asan/TestCases/Windows/intercept_strlen.cc
  compiler-rt/test/asan/TestCases/Windows/interface_symbols_windows.cc
  compiler-rt/test/asan/TestCases/Windows/iostream_sbo.cc
  compiler-rt/test/asan/TestCases/Windows/malloc_left_oob.cc
  compiler-rt/test/asan/TestCases/Windows/malloc_right_oob.cc
  compiler-rt/test/asan/TestCases/Windows/malloc_uaf.cc
  compiler-rt/test/asan/TestCases/Windows/null_deref_multiple_dlls.cc
  compiler-rt/test/asan/TestCases/Windows/oom.cc
  compiler-rt/test/asan/TestCases/Windows/operator_array_new_left_oob.cc
  compiler-rt/test/asan/TestCases/Windows/operator_array_new_right_oob.cc
  compiler-rt/test/asan/TestCases/Windows/operator_array_new_uaf.cc
  
compiler-rt/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cc
  compiler-rt/test/asan/TestCases/Windows/operator_delete_wrong_argument.cc
  compiler-rt/test/asan/TestCases/Windows/operator_new_left_oob.cc
  compiler-rt/test/asan/TestCases/Windows/operator_new_right_oob.cc
  compiler-rt/test/asan/TestCases/Windows/operator_new_uaf.cc
  compiler-rt/test/asan/TestCases/Windows/queue_user_work_item_report.cc
  compiler-rt/test/asan/TestCases/Windows/realloc_left_oob.cc
  compiler-rt/test/asan/TestCases/Windows/realloc_right_oob.cc
  compiler-rt/test/asan/TestCases/Windows/realloc_uaf.cc
  compiler-rt/test/asan/TestCases/Windows/report_globals_reload_dll.cc
  compiler-rt/test/asan/TestCases/Windows/report_globals_vs_freelibrary.cc
  compiler-rt/test/asan/TestCases/Windows/rtlallocateheap.cc
  compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_flags_fallback.cc
  

[PATCH] D64506: clang-cl: Remove -O0 option

2019-07-10 Thread Nico Weber via Phabricator via cfe-commits
thakis added a comment.

In D64506#1579251 , @rnk wrote:

> Does `clang-cl -O0` without a `/` still work, though? It's used:
>
> $ git grep O0 ../compiler-rt/test/asan/TestCases/Windows/
>  ../compiler-rt/test/asan/TestCases/Windows/aligned_mallocs.cc:// RUN: 
> %clang_cl_asan -O0 %s -Fe%t
>  ../compiler-rt/test/asan/TestCases/Windows/allocators_sanity.cc:// RUN: 
> %clang_cl_asan -O0 %s -Fe%t
>  ../compiler-rt/test/asan/TestCases/Windows/beginthreadex.cc:// RUN: 
> %clang_cl_asan -O0 %s -Fe%t
>  ../compiler-rt/test/asan/TestCases/Windows/bitfield.cc:// RUN: 
> %clang_cl_asan -O0 %s -Fe%t
>  ../compiler-rt/test/asan/TestCases/Windows/bitfield_uaf.cc:// RUN: 
> %clang_cl_asan -O0 %s -Fe%t
>  ../compiler-rt/test/asan/TestCases/Windows/calloc_left_oob.cc:// RUN: 
> %clang_cl_asan -O0 %s -Fe%t
>  ../compiler-rt/test/asan/TestCases/Windows/calloc_right_oob.cc:// RUN: 
> %clang_cl_asan -O0 %s -Fe%t
>  ...


Oh thanks, I only ran clang tests, not compiler-rt tests.

It no longer works, O isn't a CoreOption:

  $ out/gn/bin/clang-cl test.cc -O0 /c
  clang: warning: argument unused during compilation: '-O0' 
[-Wunused-command-line-argument]

But these tests should just use `/Od`, right?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64506/new/

https://reviews.llvm.org/D64506



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D64506: clang-cl: Remove -O0 option

2019-07-10 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment.

Does `clang-cl -O0` without a `/` still work, though? It's used:

$ git grep O0 ../compiler-rt/test/asan/TestCases/Windows/
../compiler-rt/test/asan/TestCases/Windows/aligned_mallocs.cc:// RUN: 
%clang_cl_asan -O0 %s -Fe%t
../compiler-rt/test/asan/TestCases/Windows/allocators_sanity.cc:// RUN: 
%clang_cl_asan -O0 %s -Fe%t
../compiler-rt/test/asan/TestCases/Windows/beginthreadex.cc:// RUN: 
%clang_cl_asan -O0 %s -Fe%t
../compiler-rt/test/asan/TestCases/Windows/bitfield.cc:// RUN: %clang_cl_asan 
-O0 %s -Fe%t
../compiler-rt/test/asan/TestCases/Windows/bitfield_uaf.cc:// RUN: 
%clang_cl_asan -O0 %s -Fe%t
../compiler-rt/test/asan/TestCases/Windows/calloc_left_oob.cc:// RUN: 
%clang_cl_asan -O0 %s -Fe%t
../compiler-rt/test/asan/TestCases/Windows/calloc_right_oob.cc:// RUN: 
%clang_cl_asan -O0 %s -Fe%t
...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64506/new/

https://reviews.llvm.org/D64506



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D64506: clang-cl: Remove -O0 option

2019-07-10 Thread Nico Weber via Phabricator via cfe-commits
thakis added a comment.

I did check that we now warn, like you had requested:

  $ out/gn/bin/clang-cl test.cc /O0 /c
  clang: warning: argument unused during compilation: '/O0' 
[-Wunused-command-line-argument]

Adding a test for that felt weird though, so I didn't.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64506/new/

https://reviews.llvm.org/D64506



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D64506: clang-cl: Remove -O0 option

2019-07-10 Thread Nico Weber via Phabricator via cfe-commits
thakis created this revision.
thakis added a reviewer: rnk.

cl.exe doesn't understand it; there's /Od instead. See also the review
thread for r229575.


https://reviews.llvm.org/D64506

Files:
  clang/include/clang/Driver/CLCompatOptions.td


Index: clang/include/clang/Driver/CLCompatOptions.td
===
--- clang/include/clang/Driver/CLCompatOptions.td
+++ clang/include/clang/Driver/CLCompatOptions.td
@@ -118,8 +118,6 @@
 def _SLASH_O : CLJoined<"O">,
   HelpText<"Set multiple /O flags at once; e.g. '/O2y-' for '/O2 /Oy-'">,
   MetaVarName<"">;
-// FIXME: Not sure why we have -O0 here; MSVC doesn't support that.
-def : CLFlag<"O0">, Alias, HelpText<"Disable optimization">;
 def : CLFlag<"O1">, Alias<_SLASH_O>, AliasArgs<["1"]>,
   HelpText<"Optimize for size  (same as /Og /Os /Oy /Ob2 /GF /Gy)">;
 def : CLFlag<"O2">, Alias<_SLASH_O>, AliasArgs<["2"]>,


Index: clang/include/clang/Driver/CLCompatOptions.td
===
--- clang/include/clang/Driver/CLCompatOptions.td
+++ clang/include/clang/Driver/CLCompatOptions.td
@@ -118,8 +118,6 @@
 def _SLASH_O : CLJoined<"O">,
   HelpText<"Set multiple /O flags at once; e.g. '/O2y-' for '/O2 /Oy-'">,
   MetaVarName<"">;
-// FIXME: Not sure why we have -O0 here; MSVC doesn't support that.
-def : CLFlag<"O0">, Alias, HelpText<"Disable optimization">;
 def : CLFlag<"O1">, Alias<_SLASH_O>, AliasArgs<["1"]>,
   HelpText<"Optimize for size  (same as /Og /Os /Oy /Ob2 /GF /Gy)">;
 def : CLFlag<"O2">, Alias<_SLASH_O>, AliasArgs<["2"]>,
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits