[clang] [clang][Sema] Add -Wswitch-default warning option (PR #73077)

2023-12-05 Thread dong jianqiang via cfe-commits
https://github.com/dongjianqiang2 updated https://github.com/llvm/llvm-project/pull/73077 >From 94069d442fd703051bef0244e8c663c1390cadbb Mon Sep 17 00:00:00 2001 From: dong jianqiang Date: Wed, 22 Nov 2023 11:06:00 +0800 Subject: [PATCH] [clang][Sema] Add -Wswitch-default warning option Adds a

[clang] [clang][Sema] Add -Wswitch-default warning option (PR #73077)

2023-12-05 Thread dong jianqiang via cfe-commits
@@ -10044,6 +10044,8 @@ def warn_missing_case : Warning<"%plural{" "3:enumeration values %1, %2, and %3 not handled in switch|" ":%0 enumeration values not handled in switch: %1, %2, %3...}0">, InGroup; +def warn_switch_default : Warning<"switch missing default case">, --

[clang] [clang][Sema] Add -Wswitch-default warning option (PR #73077)

2023-12-05 Thread dong jianqiang via cfe-commits
https://github.com/dongjianqiang2 updated https://github.com/llvm/llvm-project/pull/73077 >From af54d1f1870ba43e18cb3677d171e916f8c887b2 Mon Sep 17 00:00:00 2001 From: dong jianqiang Date: Wed, 22 Nov 2023 11:06:00 +0800 Subject: [PATCH] [clang][Sema] Add -Wswitch-default warning option Adds a

[clang] [clang][Sema] Add -Wswitch-default warning option (PR #73077)

2023-12-05 Thread dong jianqiang via cfe-commits
https://github.com/dongjianqiang2 updated https://github.com/llvm/llvm-project/pull/73077 >From a09d149f050918f6161e5880b4f7e352fc5e52c2 Mon Sep 17 00:00:00 2001 From: dong jianqiang Date: Wed, 22 Nov 2023 11:06:00 +0800 Subject: [PATCH] [clang][Sema] Add -Wswitch-default warning option Adds a

[clang] [Driver][MachineOutliner] Support -moutline option for aarch64_be (PR #73223)

2023-12-06 Thread dong jianqiang via cfe-commits
https://github.com/dongjianqiang2 updated https://github.com/llvm/llvm-project/pull/73223 >From 438da675d853e0b1bc38670c18361d7d3615f860 Mon Sep 17 00:00:00 2001 From: dong jianqiang Date: Thu, 23 Nov 2023 16:58:11 +0800 Subject: [PATCH] [Driver][MachineOutliner] Support outlining option with L

[clang] [Driver][MachineOutliner] Support -moutline option for aarch64_be (PR #73223)

2023-12-06 Thread dong jianqiang via cfe-commits
@@ -2400,7 +2400,8 @@ void tools::addMachineOutlinerArgs(const Driver &D, // Otherwise, add the proper mllvm flags. if (!(Triple.isARM() || Triple.isThumb() || Triple.getArch() == llvm::Triple::aarch64 || dongjianqiang2 wrote: Updated,

[clang] [Driver] Add support for -export-dynamic which can match GCC behavior. (PR #72781)

2023-11-18 Thread dong jianqiang via cfe-commits
https://github.com/dongjianqiang2 created https://github.com/llvm/llvm-project/pull/72781 clang splits -export-dynamic into "-e" and "xport-dynamic", and gets ld warning: cannot find entry symbol xport-dynamic; defaulting to , which is unexpected from user. Adjust the driver to support -e

[clang] [Driver] Add support for -export-dynamic which can match GCC behavior. (PR #72781)

2023-11-19 Thread dong jianqiang via cfe-commits
https://github.com/dongjianqiang2 closed https://github.com/llvm/llvm-project/pull/72781 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Add support for -export-dynamic which can match GCC behavior. (PR #72781)

2023-11-19 Thread dong jianqiang via cfe-commits
dongjianqiang2 wrote: > GCC's default spec file for Linux does not say how `-export-dynamic` > translates to ld `-export-dynamic`. > > I think ld `--export-dynamic` is exclusively caused by `-Wl,--export-dynamic` > or `-rdynamic`. Do you have any example of `gcc -export-dynamic` uses? > > > c

[clang] [Driver] Add support for -export-dynamic which can match GCC behavior. (PR #72781)

2023-11-19 Thread dong jianqiang via cfe-commits
https://github.com/dongjianqiang2 reopened https://github.com/llvm/llvm-project/pull/72781 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Add support for -export-dynamic which can match GCC behavior. (PR #72781)

2023-11-19 Thread dong jianqiang via cfe-commits
dongjianqiang2 wrote: @MaskRay the reason for adding this option is that gcc supports it. please refer to https://godbolt.org/z/54sE6zTa1 https://github.com/llvm/llvm-project/pull/72781 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [Driver] Add support for -export-dynamic which can match GCC behavior. (PR #72781)

2023-11-20 Thread dong jianqiang via cfe-commits
dongjianqiang2 wrote: > > @MaskRay the reason for adding this option is that gcc supports it. please > > refer to [godbolt.org/z/54sE6zTa1](https://godbolt.org/z/54sE6zTa1) > > This doesn't answer my question. GCC has a lot of options that Clang doesn't > support. An option supported by GCC do

[clang] [Driver] Default Generic_GCC aarch64_be to -fasynchronous-unwind-tables (PR #72971)

2023-11-21 Thread dong jianqiang via cfe-commits
https://github.com/dongjianqiang2 created https://github.com/llvm/llvm-project/pull/72971 This patch defaults Generic_GCC aarch64_be to use -fasynchronous-unwind-tables and ensures consistent behavior with aarch64 little endian. >From f8adcd49a4627926ac8009c595c6b0103589e600 Mon Sep 17 00:00:0

[clang] [clang][Sema] Add -Wswitch-default warning option (PR #73077)

2023-11-21 Thread dong jianqiang via cfe-commits
https://github.com/dongjianqiang2 created https://github.com/llvm/llvm-project/pull/73077 Adds a warning, issued by the clang semantic analysis. The patch warns on switch which don't have the default branch. This is a counterpart of gcc's Wswitch-default. >From 7962e1ffc6bb5ab8873f391f5030199

[clang] [clang][Sema] Add -Wswitch-default warning option (PR #73077)

2023-11-21 Thread dong jianqiang via cfe-commits
dongjianqiang2 wrote: > There is one clang-tidy check (bugprone-switch-missing-default-case) also for > this feature. Thank you for your reply. It may be a more convenient and straightforward way if can be identified during compile time. On the other hand, it it more compatibile with GCC's he

[clang] [Driver] Add support for -export-dynamic which can match GCC behavior. (PR #72781)

2023-11-21 Thread dong jianqiang via cfe-commits
dongjianqiang2 wrote: > > > > @MaskRay the reason for adding this option is that gcc supports it. > > > > please refer to > > > > [godbolt.org/z/54sE6zTa1](https://godbolt.org/z/54sE6zTa1) > > > > > > > > > This doesn't answer my question. GCC has a lot of options that Clang > > > doesn't su

[clang] [Driver][MachineOutliner] Support -moutline option for aarch64_be (PR #73223)

2023-11-23 Thread dong jianqiang via cfe-commits
https://github.com/dongjianqiang2 created https://github.com/llvm/llvm-project/pull/73223 This patch propagates the -moutline flag when target is aarch64_be, fix warning: 'aarch64_be' does not support '-moutline'; flag ignored [-Woption-ignored] >From 1492725fb3bb60f400264f718972ce249ec3eda8

[clang] [clang][Sema] Add -Wswitch-default warning option (PR #73077)

2023-12-18 Thread dong jianqiang via cfe-commits
dongjianqiang2 wrote: > ``` > enum class test > { > err1, > err2, > ok > }; > > int check_err (test v) > { > switch (v) > { > case test::err1: > return 1; > case test::err2: > return 2; > case test::ok: > break; > } > return 0; > } > ``

[clang] [clang][Sema] Add -Wswitch-default warning option (PR #73077)

2023-12-19 Thread dong jianqiang via cfe-commits
@@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wswitch-default %s + +int f1(int a) { + switch (a) {// expected-warning {{'switch' missing 'default' label}} +case 1: a++; break; +case 2: a += 2; break; + } + return a; +} don

[clang] [Clang][Wswitch-default] Warning for enum even completely covered the cases (PR #75900)

2023-12-19 Thread dong jianqiang via cfe-commits
https://github.com/dongjianqiang2 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/75900 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Wswitch-default] Warning for enum even completely covered the cases (PR #75900)

2023-12-19 Thread dong jianqiang via cfe-commits
https://github.com/dongjianqiang2 closed https://github.com/llvm/llvm-project/pull/75900 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix Wswitch-default bad warning in template (PR #76007)

2023-12-19 Thread dong jianqiang via cfe-commits
dongjianqiang2 wrote: thanks for correcting this. https://github.com/llvm/llvm-project/pull/76007 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Add support for -export-dynamic which can match GCC behavior. (PR #72781)

2023-11-23 Thread dong jianqiang via cfe-commits
dongjianqiang2 wrote: > export-dynamic In that case, we have got to change `-exxx` to `-e xxx`, and `-export-dynamic` to `-rdynamic`. LGTM, and it follows GCC's official documented spec : ) https://github.com/llvm/llvm-project/pull/72781 ___ cfe-comm

[clang] [Driver] Allow -e entry but reject -eentry (PR #72804)

2023-11-23 Thread dong jianqiang via cfe-commits
https://github.com/dongjianqiang2 approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/72804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver][MachineOutliner] Support -moutline option for aarch64_be (PR #73223)

2023-11-23 Thread dong jianqiang via cfe-commits
https://github.com/dongjianqiang2 updated https://github.com/llvm/llvm-project/pull/73223 >From 5742f71b9077a038cfefe4c74290d7e9d2f42d3f Mon Sep 17 00:00:00 2001 From: dong jianqiang Date: Thu, 23 Nov 2023 16:58:11 +0800 Subject: [PATCH] [Driver][MachineOutliner] Support outlining option with L

[clang] [Driver] Allow -e entry but reject -eentry (PR #72804)

2023-11-26 Thread dong jianqiang via cfe-commits
https://github.com/dongjianqiang2 closed https://github.com/llvm/llvm-project/pull/72804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver][MachineOutliner] Support -moutline option for aarch64_be (PR #73223)

2023-11-26 Thread dong jianqiang via cfe-commits
https://github.com/dongjianqiang2 updated https://github.com/llvm/llvm-project/pull/73223 >From 2a90faa84bd4a47a291f0631f26b87e7ee60ce63 Mon Sep 17 00:00:00 2001 From: dong jianqiang Date: Thu, 23 Nov 2023 16:58:11 +0800 Subject: [PATCH] [Driver][MachineOutliner] Support outlining option with L

[clang] [Driver][MachineOutliner] Support -moutline option for aarch64_be (PR #73223)

2023-11-26 Thread dong jianqiang via cfe-commits
https://github.com/dongjianqiang2 updated https://github.com/llvm/llvm-project/pull/73223 >From b58489a05f97dcb6cf31ce9527ff0e7a16a9f56e Mon Sep 17 00:00:00 2001 From: dong jianqiang Date: Thu, 23 Nov 2023 16:58:11 +0800 Subject: [PATCH] [Driver][MachineOutliner] Support outlining option with L

[clang] [Driver] Add support for -export-dynamic which can match GCC behavior. (PR #72781)

2023-11-30 Thread dong jianqiang via cfe-commits
https://github.com/dongjianqiang2 closed https://github.com/llvm/llvm-project/pull/72781 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix Wswitch-default bad warning in template (PR #76007)

2023-12-20 Thread dong jianqiang via cfe-commits
https://github.com/dongjianqiang2 approved this pull request. LGTM, thanks https://github.com/llvm/llvm-project/pull/76007 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits