[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] [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] [Driver] Default Generic_GCC aarch64_be to -fasynchronous-unwind-tables (PR #72971)

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

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-22 Thread Fangrui Song via cfe-commits
@@ -5739,6 +5739,16 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (CM == "large" && RelocationModel != llvm::Reloc::Static) D.Diag(diag::err_drv_argument_only_allowed_with) << A->getAsString(Args) << "-fno-pic"; +} else if (T

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-22 Thread Fangrui Song via cfe-commits
@@ -5739,6 +5739,16 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (CM == "large" && RelocationModel != llvm::Reloc::Static) D.Diag(diag::err_drv_argument_only_allowed_with) << A->getAsString(Args) << "-fno-pic"; +} else if (T

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-22 Thread Fangrui Song via cfe-commits
@@ -5739,6 +5739,16 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (CM == "large" && RelocationModel != llvm::Reloc::Static) D.Diag(diag::err_drv_argument_only_allowed_with) << A->getAsString(Args) << "-fno-pic"; +} else if (T

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-22 Thread Fangrui Song via cfe-commits
MaskRay wrote: [gcc.gnu.org/onlinedocs/gcc/LoongArch-Options.html](https://gcc.gnu.org/onlinedocs/gcc/LoongArch-Options.html) says ‘large (Not implemented yet)’ ‘extreme’ This mode does not limit the size of the code segment and data segment. The -mcmodel=extreme option is incompatible with -f

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-22 Thread Fangrui Song via cfe-commits
@@ -15,6 +15,15 @@ // RUN: not %clang -### -c --target=aarch64 -mcmodel=medium %s 2>&1 | FileCheck --check-prefix=ERR-MEDIUM %s // RUN: not %clang -### -c --target=aarch64 -mcmodel=kernel %s 2>&1 | FileCheck --check-prefix=ERR-KERNEL %s // RUN: not %clang --target=aarch64_32-

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

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

[clang] Honor -fno-sanitize-link-runtime for libclang_rt.asan_static (PR #66414)

2023-11-22 Thread Fangrui Song via cfe-commits
MaskRay wrote: * https://reviews.llvm.org/D65029 added `-fno-sanitize-link-runtime` for kernel-like scenarios with custom runtime. * Patches related to https://reviews.llvm.org/D122407 link in `--whole-archive libclang_rt.asan_static.a --no-whole-archive` and define symbols like `__asan_report

[clang] Honor -fno-sanitize-link-runtime for libclang_rt.asan_static (PR #66414)

2023-11-22 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/66414 ___ 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-22 Thread Fangrui Song via cfe-commits
MaskRay wrote: GCC compatibility certainly matters a lot, but I feel that some of my previous points are ignored. My previous replies asked us to focus on other respects (a) whether the behavior makes sense or makes things more error-prone (b) whether not supporting it causes us trouble (c) wh

[llvm] [clang] ms inline asm: Fix {call,jmp} fptr (PR #73207)

2023-11-22 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/73207 https://reviews.llvm.org/D151863 (2023-05) removed `BaseReg = BaseReg ? BaseReg : 1` (introduced in commit 175d0aeef3725ce17032e9ef76e018139f2f52f0 (2013)) and caused a regression: ensuring a non-zero `BaseReg` wa

[llvm] [clang] ms inline asm: Fix {call,jmp} fptr (PR #73207)

2023-11-22 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/73207 >From 5b74d57faf8ab5fae4d9512517d6ec4d888a6ecd Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 22 Nov 2023 16:14:14 -0800 Subject: [PATCH] ms inline asm: Fix {call,jmp} fptr https://reviews.llvm.org/D1518

[llvm] [clang] ms inline asm: Fix {call,jmp} fptr (PR #73207)

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

[llvm] [clang] ms inline asm: Fix {call,jmp} fptr (PR #73207)

2023-11-22 Thread Fangrui Song via cfe-commits
MaskRay wrote: I should confess that I don't understand the mechanism well. I've tried hard to write a good description but I cannot improve the comments in `CreateMemForMSInlineAsm`. https://github.com/llvm/llvm-project/pull/73207 ___ cfe-commits m

[llvm] [clang] ms inline asm: Fix {call,jmp} fptr (PR #73207)

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

[llvm] [clang] ms inline asm: Fix {call,jmp} fptr (PR #73207)

2023-11-22 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/73207 >From f8d61499c92d98e3c29027f0137e9d2f734d39c0 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 22 Nov 2023 16:14:14 -0800 Subject: [PATCH] ms inline asm: Fix {call,jmp} fptr https://reviews.llvm.org/D1518

[clang] [Driver] Add ExclusiveGroup feature to multilib.yaml. (PR #69447)

2023-10-27 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. Looks good to me, but other reviewers likely have opinions https://github.com/llvm/llvm-project/pull/69447 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [Driver] Add ExclusiveGroup feature to multilib.yaml. (PR #69447)

2023-10-27 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,70 @@ +# REQUIRES: shell MaskRay wrote: If `LIT_USE_INTERNAL_SHELL=1 llvm-lit ..` passes, you can remove `# REQUIRES: shell` (dependency on an external shell) https://github.com/llvm/llvm-project/pull/69447 ___

[clang] [Driver] Add ExclusiveGroup feature to multilib.yaml. (PR #69447)

2023-10-27 Thread Fangrui Song via cfe-commits
@@ -96,13 +98,36 @@ bool MultilibSet::select(const Multilib::flags_list &Flags, llvm::SmallVector &Selected) const { llvm::StringSet<> FlagSet(expandFlags(Flags)); Selected.clear(); - llvm::copy_if(Multilibs, std::back_inserter(Selected), -

[clang] [Driver] Add ExclusiveGroup feature to multilib.yaml. (PR #69447)

2023-10-27 Thread Fangrui Song via cfe-commits
@@ -96,13 +97,39 @@ bool MultilibSet::select(const Multilib::flags_list &Flags, llvm::SmallVector &Selected) const { llvm::StringSet<> FlagSet(expandFlags(Flags)); Selected.clear(); - llvm::copy_if(Multilibs, std::back_inserter(Selected), -

[clang] [Driver] Add ExclusiveGroup feature to multilib.yaml. (PR #69447)

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

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

2023-10-28 Thread Fangrui Song via cfe-commits
MaskRay wrote: Seems fine to me once a test is added:) 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][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-10-31 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay requested changes to this pull request. https://github.com/llvm/llvm-project/pull/70480 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

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

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-10-31 Thread Fangrui Song via cfe-commits
@@ -330,6 +330,14 @@ def warn_alias_with_section : Warning< "as the %select{aliasee|resolver}2">, InGroup; +let CategoryName = "Bounds Safety Issue" in { +def err_bounds_safety_lang_not_supported : Error< + "bounds safety is only supported for C">; +def warn_bounds_safety

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-10-31 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,11 @@ +// RUN: %clang -c %s -### 2>&1 | FileCheck -check-prefix T0 %s MaskRay wrote: `clang/test/Driver/clang_f_opts.c` mixes a lot of options. Newer `-fxxx` tests can go to a dedicated `clang/test/Driver/fxxx.c` https://github.com/llvm/llvm-project/

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-10-31 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,5 @@ +; RUN: %clang -fbounds-safety-experimental -x ir -S %s -o /dev/null 2>&1 | FileCheck %s +; RUN: %clang_cc1 -fbounds-safety-experimental -x ir -S %s -o /dev/null 2>&1 | FileCheck %s + MaskRay wrote: We usually test `%clang` for driver and `%clan

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-10-31 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,25 @@ +// RUN: not %clang -fbounds-safety-experimental -x c++ %s 2>&1 | FileCheck -check-prefix ERR %s + MaskRay wrote: We use a terse style and use a blank line to group different sets of tests. Here the blank line use is unnecessary and harms reada

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-10-31 Thread Fangrui Song via cfe-commits
@@ -330,6 +330,14 @@ def warn_alias_with_section : Warning< "as the %select{aliasee|resolver}2">, InGroup; +let CategoryName = "Bounds Safety Issue" in { +def err_bounds_safety_lang_not_supported : Error< + "bounds safety is only supported for C">; +def warn_bounds_safety

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-10-31 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,11 @@ +// RUN: %clang -c %s -### 2>&1 | FileCheck -check-prefix T0 %s MaskRay wrote: Test subdirectories are added conservatively. The main use cases are target-specific tests and flang. `Driver/XRay` is somehow an unneeded use that you can ignore. `

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

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

[clang] [clang][driver] Add \/../include/c++/v1 to include path on Darwin (PR #70817)

2023-10-31 Thread Fangrui Song via cfe-commits
MaskRay wrote: I am unfamiliar with Darwin and @jansvoboda11 @ldionne can give a more authoritative answer, but I can share some feelings. * Gnu.cpp uses `Generic_GCC::addLibCxxIncludePaths` so other versions (e.g. `usr/include/c++/v2`) are supported. * Only one of `Dir`/`InstalledDir` should

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-10-31 Thread Fangrui Song via cfe-commits
@@ -330,6 +330,14 @@ def warn_alias_with_section : Warning< "as the %select{aliasee|resolver}2">, InGroup; +let CategoryName = "Bounds Safety Issue" in { +def err_bounds_safety_lang_not_supported : Error< + "bounds safety is only supported for C">; +def warn_bounds_safety

[clang] [llvm] [AIX][TOC] Add -mtocdata/-mno-tocdata options on AIX (PR #67999)

2023-10-31 Thread Fangrui Song via cfe-commits
@@ -265,6 +269,63 @@ bool AIXTargetCodeGenInfo::initDwarfEHRegSizeTable( return PPC_initDwarfEHRegSizeTable(CGF, Address, Is64Bit, /*IsAIX*/ true); } +void AIXTargetCodeGenInfo::setTargetAttributes( +const Decl *D, llvm::GlobalValue *GV, CodeGen::CodeGenModule &M) const

[clang] [Driver] Silence stdlib warning when linking C on *BSD / Solaris / Haiku (PR #70434)

2023-10-31 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/70434 ___ 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-02 Thread Fangrui Song via cfe-commits
@@ -197,6 +197,7 @@ CODEGENOPT(HIPCorrectlyRoundedDivSqrt, 1, 1) ///< -fno-hip-fp32-correctly-rounde CODEGENOPT(HIPSaveKernelArgName, 1, 0) ///< Set when -fhip-kernel-arg-name is enabled. CODEGENOPT(UniqueInternalLinkageNames, 1, 0) ///< Internal Linkage symbols get unique na

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

2023-11-02 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 (const Arg *A = + Args.getLastArg(options::OPT_mregnames, options::OPT_mno_regnames)) { MaskR

[compiler-rt] [flang] [clang] [libc] [llvm] [clang-tools-extra] [libcxx] [lldb] [PowerPC] Support mcmodel=large for AIX (PR #70652)

2023-11-02 Thread Fangrui Song via cfe-commits
@@ -5723,16 +5723,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (Arg *A = Args.getLastArg(options::OPT_mcmodel_EQ)) { StringRef CM = A->getValue(); bool Ok = false; -if (Triple.isOSAIX() && CM == "medium") { +if (Triple.isOSAIX() && C

[clang] e65721c - [Driver][test] Fix dragonfly.c after #69095

2023-11-02 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2023-11-02T11:28:56-07:00 New Revision: e65721c3a1ee3ee4aa43499882f6d71dc9368daf URL: https://github.com/llvm/llvm-project/commit/e65721c3a1ee3ee4aa43499882f6d71dc9368daf DIFF: https://github.com/llvm/llvm-project/commit/e65721c3a1ee3ee4aa43499882f6d71dc9368daf.diff

[clang] [Driver][DragonFly] Fixes for linker path and command-line option handling (PR #69095)

2023-11-02 Thread Fangrui Song via cfe-commits
MaskRay wrote: > > This appears to have broken some bots: > > [lab.llvm.org/buildbot/#/builders/119/builds/15633](https://lab.llvm.org/buildbot/#/builders/119/builds/15633) > > > > [lab.llvm.org/buildbot/#/builders/60/builds/14449](https://lab.llvm.org/buildbot/#/builders/60/builds/14449) > >

[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; --

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