[clang] [compiler-rt] [clang-tools-extra] [llvm] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-10 Thread Fangrui Song via cfe-commits
@@ -1,39 +0,0 @@ -; Do setup work for all below tests: generate bitcode and combined index MaskRay wrote: Hmm, I think it is still preferred to have a test here as runtime tests are more sensitive to the environment and may be skipped by some contributors. It m

[clang-tools-extra] [compiler-rt] [llvm] [clang] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-10 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,97 @@ +// This is a regression test for ThinLTO indirect-call-promotion when candidate +// callees need to be imported from another IR module. In the C++ test case, +// `main` calls `global_func` which is defined in another module. `global_func` +// has two indirect ca

[clang] [llvm] [llvm] Add support for building on illumos (PR #74930)

2023-12-10 Thread Fangrui Song via cfe-commits
MaskRay wrote: I hope that someone using illumos can test, but if it is hard to find one I can approve this. https://github.com/llvm/llvm-project/pull/74930 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] [Sema] atomic_compare_exchange: check failure memory order (PR #74959)

2023-12-11 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/74959 >From 56a63cd9f910dc78163adda15252e7818cc7a419 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sat, 9 Dec 2023 16:37:51 -0800 Subject: [PATCH 1/2] [Sema] atomic_compare_exchange: check failure memory order Fo

[llvm] [clang] [SpecialCaseList] Use glob by default (PR #74809)

2023-12-11 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/74809 >From 4aba7a65213971887db7432911e7743365f4f417 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Thu, 7 Dec 2023 21:17:24 -0800 Subject: [PATCH 1/2] [SpecialCaseList] Use glob by default https://reviews.llvm.org

[llvm] [clang] [SpecialCaseList] Use glob by default (PR #74809)

2023-12-11 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/74809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] atomic_compare_exchange: check failure memory order (PR #74959)

2023-12-11 Thread Fangrui Song via cfe-commits
@@ -8728,7 +8728,13 @@ def err_atomic_op_needs_atomic_int : Error< "%select{|atomic }0integer (%1 invalid)">; def warn_atomic_op_has_invalid_memory_order : Warning< "memory order argument to atomic operation is invalid">, - InGroup>; + InGroup; +def warn_atomic_op_has_inv

[compiler-rt] [clang-tools-extra] [llvm] [clang] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-11 Thread Fangrui Song via cfe-commits
@@ -147,6 +147,9 @@ def exclude_unsupported_files_for_aix(dirname): config.substitutions.append( ("%clang_pgouse=", build_invocation(clang_cflags) + " -fprofile-use=") ) +config.substitutions.append( +("%clangxx_pgouse=", build_invocation(clang_cxxflags) + " -fprofile-u

[compiler-rt] [clang-tools-extra] [llvm] [clang] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-11 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,97 @@ +// This is a regression test for ThinLTO indirect-call-promotion when candidate +// callees need to be imported from another IR module. In the C++ test case, +// `main` calls `global_func` which is defined in another module. `global_func` +// has two indirect ca

[clang] [clang][Driver] Support -fms-volatile as equivalent to /volatile:ms (PR #74790)

2023-12-11 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/74790 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Driver] Support -fms-volatile as equivalent to /volatile:ms (PR #74790)

2023-12-11 Thread Fangrui Song via cfe-commits
@@ -611,3 +611,9 @@ // CHECK-INT-OBJEMITTER-NOT: unsupported option '-fintegrated-objemitter' for target // RUN: not %clang -### -fno-integrated-objemitter --target=x86_64 %s 2>&1 | FileCheck -check-prefix=CHECK-NOINT-OBJEMITTER %s // CHECK-NOINT-OBJEMITTER: unsupported optio

[clang] [clang][Driver] Support -fms-volatile as equivalent to /volatile:ms (PR #74790)

2023-12-11 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/74790 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [lldb] [clang-tools-extra] [compiler-rt] [flang] [clang] [mlir] [Profile] Add binary profile correlation for code coverage. (PR #69493)

2023-12-11 Thread Fangrui Song via cfe-commits
MaskRay wrote: We have this team: @llvm/pr-subscribers-pgo https://github.com/llvm/llvm-project/pull/69493 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [compiler-rt] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-11 Thread Fangrui Song via cfe-commits
@@ -1,39 +0,0 @@ -; Do setup work for all below tests: generate bitcode and combined index MaskRay wrote: It looks like that we had 3 precanned profraw files and this patch is adding another one. Since the raw profile isn't stable, this is going to add some inc

[clang] [clang-tools-extra] [llvm] [compiler-rt] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-11 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/74008 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [compiler-rt] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-11 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/74008 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [compiler-rt] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-11 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,97 @@ +// This is a regression test for ThinLTO indirect-call-promotion when candidate +// callees need to be imported from another IR module. In the C++ test case, +// `main` calls `global_func` which is defined in another module. `global_func` +// has two indirect ca

[clang] [clang-tools-extra] [llvm] [compiler-rt] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-11 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. LGTM once these changes are made. * unused `%clangxx_pgouse=` * profraw => proftext for the PGOProfile test * lld-available -fuse-ld=lld and windows triple simplification for the compiler-rt test It seems useful to wait for others' opinion

[clang] [llvm] [compiler-rt] [clang-tools-extra] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-11 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/74008 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] atomic_compare_exchange: check failure memory order (PR #74959)

2023-12-11 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/74959 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] atomic_compare_exchange: check failure memory order (PR #74959)

2023-12-11 Thread Fangrui Song via cfe-commits
MaskRay wrote: > PR description needs to be updated after changes. Otherwise LGTM. Thanks. Updated the description. https://github.com/llvm/llvm-project/pull/74959 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang] [clang] Add per-global code model attribute (PR #72078)

2023-12-11 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: %clang_cc1 -emit-llvm -triple loongarch64 %s -o - | FileCheck %s + +// CHECK: @_ZL2v1 ={{.*}} global i32 0, code_model "small" +static int v1 __attribute__((model("normal"))); + +void use1() { + v1 = 1; +} + +// CHECK: @v2 ={{.*}} global i32 0, code_mode

[clang] [clang] Add per-global code model attribute (PR #72078)

2023-12-11 Thread Fangrui Song via cfe-commits
@@ -4841,6 +4841,19 @@ CodeGenModule::GetOrCreateLLVMGlobal(StringRef MangledName, llvm::Type *Ty, isExternallyVisible(D->getLinkageAndVisibility().getLinkage())) GV->setSection(".cp.rodata"); +// Handle code model attribute +if (D->hasAttr()) { + i

[clang] [clang] Add per-global code model attribute (PR #72078)

2023-12-11 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/72078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 9c1c56a - -fcoverage-mapping: simplify. NFC

2023-11-13 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2023-11-13T15:16:58-08:00 New Revision: 9c1c56a80323291cd47af59d96122ec5bd42ea83 URL: https://github.com/llvm/llvm-project/commit/9c1c56a80323291cd47af59d96122ec5bd42ea83 DIFF: https://github.com/llvm/llvm-project/commit/9c1c56a80323291cd47af59d96122ec5bd42ea83.diff

[clang] Ignore template parameter visibility (PR #72092)

2023-11-13 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/72092 >From 401af7b4eabe92c8264c722a3f1181875da18438 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 12 Nov 2023 23:22:50 -0800 Subject: [PATCH 1/2] Ignore template parameter visibility When computing the visib

[clang] Ignore template parameter visibility (PR #72092)

2023-11-13 Thread Fangrui Song via cfe-commits
MaskRay wrote: Thanks for the comment. Frankly, I am at a loss in deriving a criterion (for shouldConsiderTemplateVisibility) to select one of the following rules. (1) factor in both template arguments and template parameters (2) factor in only template arguments (3) factor in nothing. Could y

[clang] [Driver][BoundsSafety] Add -fexperimental-bounds-safety flag (PR #70480)

2023-11-13 Thread Fangrui Song via cfe-commits
MaskRay wrote: > @MaskRay To be clear, the check is now in Driver as you suggested. It's just > that the frontend also has some extra checks too. So, you want me to remove > the extra checks in the frontend? Yes, otherwise it's duplicated check. In addition, I think our convention is to add t

[clang] [Driver][BoundsSafety] Add -fexperimental-bounds-safety flag (PR #70480)

2023-11-13 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay requested changes to this pull request. > -fbounds-safety-experimental is an experimental flag for -fbounds-safety, -fexperimental-bounds-safety https://github.com/llvm/llvm-project/pull/70480 ___ cfe-commits mailing list cf

[lld] [llvm] [mlir] [clang] [flang] [ELF] Merge exportDynamic into versionId (PR #71272)

2023-11-13 Thread Fangrui Song via cfe-commits
MaskRay wrote: I'm nervous of making `--version-script` export a symbol when creating an executable. I have implemented https://github.com/llvm/llvm-project/pull/72208 instead to give us more free bits! https://github.com/llvm/llvm-project/pull/71272 __

[clang] Ignore template parameter visibility (PR #72092)

2023-11-13 Thread Fangrui Song via cfe-commits
MaskRay wrote: > > After the change, does it seem more feasible to ignore template parameters? > > Hmm. You're right that considering the type of a non-type template argument > would be enough to give the right visibility to my example. It would not be > enough if the template was used as a te

[clang] [Driver] Default LoongArch to -fno-direct-access-external-data for non-PIC (PR #72221)

2023-11-13 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/72221 For -fno-pic, if an extern variable is defined in a DSO, a copy relocation will be needed. However, loongarch*-linux does not and will not support copy relocations. Change Driver to default to -fno-direct-access-

[clang] [clang][LoongArch] Don't imply -fdirect-access-external-data for non-PIC (PR #71887)

2023-11-13 Thread Fangrui Song via cfe-commits
MaskRay wrote: Thanks for the patch, but I think we can keep the default only in the default so that Frontend does not need to handle target-specific differences. See https://github.com/llvm/llvm-project/pull/72221 and I've added only few tests that make sense (`-fpic -fdirect-access-external-

[clang] [Driver] Handle Flang in same manner between Gnu and *BSD/Solaris ToolChain (PR #70429)

2023-11-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/70429 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Make use of AddFilePathLibArgs() on NetBSD. (PR #71371)

2023-11-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/71371 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Make use of AddFilePathLibArgs() on NetBSD. (PR #71371)

2023-11-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/71371 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Make use of AddFilePathLibArgs() on NetBSD. (PR #71371)

2023-11-14 Thread Fangrui Song via cfe-commits
@@ -461,3 +461,8 @@ // DRIVER-PASS-INCLUDES: "-cc1" {{.*}}"-resource-dir" "[[RESOURCE:[^"]+]]" // DRIVER-PASS-INCLUDES-SAME: "-internal-isystem" "[[RESOURCE]]{{/|}}include" // DRIVER-PASS-INCLUDES-SAME: {{^}} "-internal-externc-isystem" "{{.*}}/usr/include" + +// Che

[clang] [Driver] Make use of AddFilePathLibArgs() on NetBSD. (PR #71371)

2023-11-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/71371 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Default LoongArch to -fno-direct-access-external-data for non-PIC (PR #72221)

2023-11-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/72221 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver][BoundsSafety] Add -fexperimental-bounds-safety flag (PR #70480)

2023-11-14 Thread Fangrui Song via cfe-commits
MaskRay wrote: > > In addition, I think our convention is to add the option when the feature > > is ready, rather than add a no-op option, than build functional patches on > > top of it. > > @MaskRay This feature will involve a lot of incremental patches. And we will > still need an experimen

[clang] 291f4a0 - [Driver] -rdynamic: remove duplicate -export-dynamic

2023-11-15 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2023-11-15T21:24:12-08:00 New Revision: 291f4a00232b5742940d67e2ecf9168631251317 URL: https://github.com/llvm/llvm-project/commit/291f4a00232b5742940d67e2ecf9168631251317 DIFF: https://github.com/llvm/llvm-project/commit/291f4a00232b5742940d67e2ecf9168631251317.diff

[clang] ae623d1 - [Driver,Gnu] Simplify -static -static-pie -shared -pie handling and suppress -shared -rdynamic warning

2023-11-16 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2023-11-16T13:48:04-08:00 New Revision: ae623d16d50c9f12de7ae7ac1aa11c9d6857e081 URL: https://github.com/llvm/llvm-project/commit/ae623d16d50c9f12de7ae7ac1aa11c9d6857e081 DIFF: https://github.com/llvm/llvm-project/commit/ae623d16d50c9f12de7ae7ac1aa11c9d6857e081.diff

[clang] [Driver] Make ELF -nopie specific to OpenBSD (PR #72578)

2023-11-16 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/72578 -no-pie[1]/-nopie is rarely used and among the rare uses almost everwhere uses -no-pie, since GCC does not recognize -nopie. However, OpenBSD seems to prefer -nopie. Therefore, make -nopie specific to OpenBSD to p

[mlir] [lld] [flang] [clang] [llvm] [ELF] Merge exportDynamic into versionId (PR #71272)

2023-11-16 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/71272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [mlir] [lld] [llvm] [flang] [ELF] Merge exportDynamic into versionId (PR #71272)

2023-11-16 Thread Fangrui Song via cfe-commits
MaskRay wrote: Obsoleted by 255ea486085fca79d21eb0082594579abdbd89d0 (#72208). In Bazel, `linkopts` on a `cc_library` target is propagated to an executable. If a cc_library specifies `--version-script`, with this patch the executable will export certain symbols. Breaking GNU compatibility is p

[clang] [Driver] Make ELF -nopie specific to OpenBSD (PR #72578)

2023-11-16 Thread Fangrui Song via cfe-commits
MaskRay wrote: > -nopie is for the linker. We only use -fno-pie for the compiler. OK. Then it seems that the driver option `-nopie` for linking should be removed even for OpenBSD? https://github.com/llvm/llvm-project/pull/72578 ___ cfe-commits mailin

[clang] 76a441a - [MC] Fix compression header size check in ELF writer

2023-11-17 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2023-11-17T01:13:38-08:00 New Revision: 76a441a6efa5b7e73d96a3d67512493f3873b1cb URL: https://github.com/llvm/llvm-project/commit/76a441a6efa5b7e73d96a3d67512493f3873b1cb DIFF: https://github.com/llvm/llvm-project/commit/76a441a6efa5b7e73d96a3d67512493f3873b1cb.diff

[clang] ae623d1 - [Driver,Gnu] Simplify -static -static-pie -shared -pie handling and suppress -shared -rdynamic warning

2023-11-17 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2023-11-16T13:48:04-08:00 New Revision: ae623d16d50c9f12de7ae7ac1aa11c9d6857e081 URL: https://github.com/llvm/llvm-project/commit/ae623d16d50c9f12de7ae7ac1aa11c9d6857e081 DIFF: https://github.com/llvm/llvm-project/commit/ae623d16d50c9f12de7ae7ac1aa11c9d6857e081.diff

[clang] [Driver] Simply some gcc search logic (PR #72558)

2023-11-18 Thread Fangrui Song via cfe-commits
@@ -2117,14 +2117,17 @@ void Generic_GCC::GCCInstallationDetector::init( // The compatible GCC triples for this particular architecture. SmallVector CandidateTripleAliases; SmallVector CandidateBiarchTripleAliases; + // Add some triples that we want to check first. + Ca

[clang] [Driver] Simply some gcc search logic (PR #72558)

2023-11-18 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/72558 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Simply some gcc search logic (PR #72558)

2023-11-18 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/72558 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Enable __float128 support on X86 and PPC64le on FreeBSD / NetBSD (PR #72788)

2023-11-18 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/72788 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Enable __float128 support on X86 and PPC64le on FreeBSD / NetBSD (PR #72788)

2023-11-18 Thread Fangrui Song via cfe-commits
MaskRay wrote: Linux ppc64le does not support `__float128`. Should *BSD support it? https://github.com/llvm/llvm-project/pull/72788 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 5603bb5 - [test] Fix misused Joined -e options

2023-11-19 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2023-11-19T10:38:49-08:00 New Revision: 5603bb5f5001e88a490b8f9c11c6e8969037183b URL: https://github.com/llvm/llvm-project/commit/5603bb5f5001e88a490b8f9c11c6e8969037183b DIFF: https://github.com/llvm/llvm-project/commit/5603bb5f5001e88a490b8f9c11c6e8969037183b.diff

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

2023-11-19 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/72804 This short option taking an argument is unfortunate. * If a cc1-only option starts with `-e`, using it for driver will not be reported as an error (e.g. commit 6cd9886c88d16d288c74846495d89f2fe84ff827). * If

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

2023-11-19 Thread Fangrui Song via cfe-commits
MaskRay 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? We probably should just

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

2023-11-20 Thread Fangrui Song via cfe-commits
MaskRay 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 does not mean that

[clang] Allow multiple sanitizers on baremetal targets. (PR #72933)

2023-11-20 Thread Fangrui Song via cfe-commits
@@ -491,3 +491,26 @@ void baremetal::Linker::ConstructJob(Compilation &C, const JobAction &JA, JA, *this, ResponseFileSupport::AtFileCurCP(), Args.MakeArgString(TC.GetLinkerPath()), CmdArgs, Inputs, Output)); } + +SanitizerMask BareMetal::getSupportedSanitizers() c

[clang] Allow multiple sanitizers on baremetal targets. (PR #72933)

2023-11-20 Thread Fangrui Song via cfe-commits
@@ -973,11 +973,58 @@ // RUN: not %clang --target=x86_64-sie-ps5 -fsanitize=kcfi %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UBSAN-KCFI // RUN: not %clang --target=x86_64-sie-ps5 -fsanitize=function -fsanitize=kcfi %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UBSAN-K

[clang] Allow multiple sanitizers on baremetal targets. (PR #72933)

2023-11-20 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/72933 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][driver] Remove -v from mkdir & ln -s from a test since it fails on ppc64 (PR #72924)

2023-11-20 Thread Fangrui Song via cfe-commits
MaskRay wrote: > since it fails on ppc64 Change ppc64 to AIX. This is OS-specific instead of arch-specific. AIX mkdir doesn't provide `-v`, but other ppc64 OSes (e.g. Linux/FreeBSD) may provide `-v` even if https://pubs.opengroup.org/onlinepubs/9699919799/ does not require it. https://github

[clang] [clang][driver] Remove -v from mkdir & ln -s from a test since it fails on AIX (PR #72924)

2023-11-20 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/72924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver, test] Remove -v from mkdir & ln -s from a test since it fails on AIX (PR #72924)

2023-11-20 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/72924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver, test] Remove -v from mkdir & ln -s from a test since it fails on AIX (PR #72924)

2023-11-20 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/72924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2023-11-20 Thread Fangrui Song via cfe-commits
MaskRay wrote: Driver used to accept `-e` but ignore it (at least for `Gnu.cpp`). My fcf8ada18f9cfb1261262e4b0399ae9ab40451f8 in 2020-July rendered `-e` (both `Joined` and `Separate`). I think if we impose a restriction that `-exxx` is unsupported, technically it is a breaking change but likel

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

2023-11-20 Thread Fangrui Song via cfe-commits
MaskRay 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 b

[clang] [Driver, test] Remove -v from mkdir & ln -s from a test since it fails on AIX (PR #72924)

2023-11-20 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/72924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver, test] Remove -v from mkdir & ln -s from a test since it fails on AIX (PR #72924)

2023-11-20 Thread Fangrui Song via cfe-commits
MaskRay wrote: Thank you for the patch and open for my idea changing the title :) I think `[test] ` as a tag is more common a patch that only deals with tests (more common than trailing `. NFC` or `[NFC]`), so I used it. https://github.com/llvm/llvm-project/pull/72924 _

[clang] [Driver, test] Remove -v from mkdir & ln -s from a test since it fails on AIX (PR #72924)

2023-11-20 Thread Fangrui Song via cfe-commits
MaskRay wrote: > Is there a page documenting these tags? There is no AFAIK, but as I have done `git log` a lot and I have figured out the convention... https://github.com/llvm/llvm-project/pull/72924 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [Driver] Make ELF -nopie specific to OpenBSD (PR #72578)

2023-11-20 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/72578 >From 23eb2b42bfb0b7148497b9035615a14dc8b7e67c Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Thu, 16 Nov 2023 14:09:09 -0800 Subject: [PATCH] [Driver] Make ELF -nopie specific to OpenBSD -no-pie[1]/-nopie is

[clang] [Driver] Make ELF -nopie specific to OpenBSD (PR #72578)

2023-11-20 Thread Fangrui Song via cfe-commits
MaskRay wrote: Rebase to resolve a merge conflict. No change to the diff otherwise. https://github.com/llvm/llvm-project/pull/72578 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Make ELF -nopie specific to OpenBSD (PR #72578)

2023-11-20 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/72578 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Make ELF -nopie specific to OpenBSD (PR #72578)

2023-11-20 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/72578 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] In compilation databases, add support for relative directories (PR #69856)

2023-11-21 Thread Fangrui Song via cfe-commits
MaskRay wrote: We need an update to the documentation `JSONCompilationDatabase` and formal description of the problem you have seen. Your Buck2 feature is not blocked. You can use `/proc/self/cwd`, which is probably unavoidable if you use other features that require reproducible builds (https

[clang] [Modules] Fix ModuleDeclState transition when module is used as a regular identifier (PR #71134)

2023-11-02 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/71134 `ModuleDeclState` is incorrectly changed to `NamedModuleImplementation` for `struct module {}; void foo(module a);`. This is mostly benign but leads to a spurious warning after #69555. A real world example is: ``

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-11-02 Thread Fangrui Song via cfe-commits
MaskRay wrote: > > FWIW, we saw failures at Google (where, to the best of my knowledge, we > > aren't using named modules at all) that look like this: > > ``` > > error: '#include ' attaches the declarations to the named module > > '.get', which is not usually intended; consider moving that dir

[clang] [Modules] Fix ModuleDeclState transition when module is used as a regular identifier (PR #71134)

2023-11-02 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/71134 >From 92cfc6e1306321ae8beb05775e2c7f8ac720f5e6 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Thu, 2 Nov 2023 19:42:09 -0700 Subject: [PATCH 1/2] [Modules] Fix ModuleDeclState transition when module is used a

[clang] [Modules] Fix ModuleDeclState transition when module is used as a regular identifier (PR #71134)

2023-11-02 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/71134 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules] Fix ModuleDeclState transition when module is used as a regular identifier (PR #71134)

2023-11-02 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/71134 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Fix running tests with MSan (PR #67860)

2023-11-03 Thread Fangrui Song via cfe-commits
@@ -43,6 +43,12 @@ #define LIBUNWIND_AVAIL #endif +#if defined(__SANITIZE_MEMORY__) || \ MaskRay wrote: GCC just doesn't support msan :) https://github.com/llvm/llvm-project/pull/67860 ___

[lld] [llvm] [clang] [mlir] [flang] [ELF] Merge exportDynamic into versionId (PR #71272)

2023-11-04 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/71272 >From e6a9f8c08ddab444f581a18c0d3c2ad242448e7c Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Fri, 3 Nov 2023 14:48:13 -0700 Subject: [PATCH 1/2] [ELF] Merge exportDynamic into versionId For a Defined/Common

[clang] [Clang][Driver][LTO] Fix empty stats filename when in LTO mode (PR #71197)

2023-11-04 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/71197 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Driver][LTO] Fix empty stats filename when in LTO mode (PR #71197)

2023-11-04 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/71197 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Driver][LTO] Fix empty stats filename when in LTO mode (PR #71197)

2023-11-04 Thread Fangrui Song via cfe-commits
@@ -535,7 +535,15 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, if (D.isUsingLTO()) { assert(!Inputs.empty() && "Must have at least one input."); -addLTOOptions(ToolChain, Args, CmdArgs, Output, Inputs[0], +// Find the first

[clang] [Clang][Driver][LTO] Fix empty stats filename when in LTO mode (PR #71197)

2023-11-04 Thread Fangrui Song via cfe-commits
@@ -20,6 +20,8 @@ // CHECK-INVALID: invalid value 'bla' in '-save-stats=bla' // RUN: %clang -target x86_64-linux-unknown -save-stats -flto -o obj/dir/save-stats.exe %s -### 2>&1 | FileCheck %s -check-prefix=CHECK-LTO +// Previously `-plugin-opt=stats-file` would use empty fil

[clang] c0a7391 - [ItaniumCXXABI] Add -fassume-nothrow-exception-dtor to assume that all exception objects' destructors are non-throwing

2023-11-05 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2023-11-05T00:39:38-07:00 New Revision: c0a73918bfddc6a04a897aab57fb95e8d2da7ec0 URL: https://github.com/llvm/llvm-project/commit/c0a73918bfddc6a04a897aab57fb95e8d2da7ec0 DIFF: https://github.com/llvm/llvm-project/commit/c0a73918bfddc6a04a897aab57fb95e8d2da7ec0.diff

[clang] [Driver][Solaris][NFC] A little bit of clean up (PR #69867)

2023-11-05 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/69867 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] Add an alias for -mregnames so that full register names used in assembly. (PR #70255)

2023-11-05 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. Mostly looks good https://github.com/llvm/llvm-project/pull/70255 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] Add an alias for -mregnames so that full register names used in assembly. (PR #70255)

2023-11-05 Thread Fangrui Song via cfe-commits
@@ -5011,6 +5011,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, Args.AddLastArg(CmdArgs, options::OPT_fthinlto_index_EQ); } + if (Triple.isPPC()) +if (const Arg *A = MaskRay wrote: use `AddOptInFlag` https://github.com/llvm/l

[clang] [llvm] [PowerPC] Add an alias for -mregnames so that full register names used in assembly. (PR #70255)

2023-11-05 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,18 @@ +// REQUIRES: powerpc-registered-target +// RUN: %clang -### -target powerpc-ibm-aix-xcoff -mcpu=pwr8 -O3 -mregnames \ +// RUN: %s 2>&1 >/dev/null | FileCheck %s --check-prefix=FULLNAMES +// RUN: %clang -### -target powerpc64-ibm-aix-xcoff -mcpu=pwr8 -O3 -mregna

[llvm] [clang] [PowerPC] Add an alias for -mregnames so that full register names used in assembly. (PR #70255)

2023-11-05 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,18 @@ +// REQUIRES: powerpc-registered-target +// RUN: %clang -### -target powerpc-ibm-aix-xcoff -mcpu=pwr8 -O3 -mregnames \ +// RUN: %s 2>&1 >/dev/null | FileCheck %s --check-prefix=FULLNAMES +// RUN: %clang -### -target powerpc64-ibm-aix-xcoff -mcpu=pwr8 -O3 -mregna

[llvm] [clang] [PowerPC] Add an alias for -mregnames so that full register names used in assembly. (PR #70255)

2023-11-05 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/70255 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [PowerPC] Add an alias for -mregnames so that full register names used in assembly. (PR #70255)

2023-11-05 Thread Fangrui Song via cfe-commits
@@ -1780,6 +1780,9 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Opts.setDebugInfo(llvm::codegenoptions::LimitedDebugInfo); } + if (const Arg *A = Args.getLastArg(OPT_mregnames)) +Opts.PPCUseFullRegisterNames = true; --

[llvm] [clang] [PowerPC] Add an alias for -mregnames so that full register names used in assembly. (PR #70255)

2023-11-05 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/70255 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Added removal of file extension when guessing the toolchain (PR #69887)

2023-11-05 Thread Fangrui Song via cfe-commits
MaskRay wrote: In quite a few places we only detect `.exe` as the extension name. I am not sure we should commit to arbitrary extension name now. The build systems can consider `--driver-mode=cl` https://github.com/llvm/llvm-project/pull/69887 ___ cf

[clang] [StackProtector] Do not emit the stack protector on GPU architectures (PR #70799)

2023-11-05 Thread Fangrui Song via cfe-commits
MaskRay wrote: I think this is fine, but we probably should think about the general option compatibility problem https://github.com/llvm/llvm-project/pull/70740#issuecomment-1786180822 https://github.com/llvm/llvm-project/pull/70799 ___ cfe-commits m

[clang] [clang] Do not pass -canonical-system-headers on Windows by default (PR #71097)

2023-11-05 Thread Fangrui Song via cfe-commits
@@ -1180,8 +1180,19 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA, if (ArgM->getOption().matches(options::OPT_M) || ArgM->getOption().matches(options::OPT_MD)) CmdArgs.push_back("-sys-header-deps"); + + // #70011: Canonicaliz

[clang] [clang] Do not pass -canonical-system-headers on Windows by default (PR #71097)

2023-11-05 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/71097 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Do not pass -canonical-system-headers on Windows by default (PR #71097)

2023-11-05 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/71097 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Do not pass -canonical-system-headers on Windows by default (PR #71097)

2023-11-05 Thread Fangrui Song via cfe-commits
@@ -1,3 +1,6 @@ +// REQUIRES: !system-windows MaskRay wrote: `UNSUPPORTED: system-windows` https://github.com/llvm/llvm-project/pull/71097 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

<    2   3   4   5   6   7   8   9   10   11   >