[clang] [Driver] Don't pass -Z to ld for ELF platforms (PR #69120)

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

[clang] [Driver] Don't pass -Z to ld for ELF platforms (PR #69120)

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

[clang] [CodeGen] -fsanitize=alignment: add cl::opt sanitize-alignment-builtin to disable memcpy instrumentation (PR #69240)

2023-10-16 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/69240 Deploying #67766 to a large internal codebase uncovers many bugs (many are probably benign but need cleaning up). There are also issues in high-profile open-source projects like v8. Add a cl::opt to disable builti

[clang-tools-extra] [Clang] Support target attr specifying CPU (PR #68678)

2023-10-16 Thread Fangrui Song via cfe-commits
@@ -2420,11 +2420,11 @@ command line. The current set of options correspond to the existing "subtarget features" for the target with or without a "-mno-" in front corresponding to the absence -of the feature, as well as ``arch="CPU"`` which will change the default "CPU" -for t

[clang] [Clang] Support target attr specifying CPU (PR #68678)

2023-10-16 Thread Fangrui Song via cfe-commits
@@ -2420,11 +2420,11 @@ command line. The current set of options correspond to the existing "subtarget features" for the target with or without a "-mno-" in front corresponding to the absence -of the feature, as well as ``arch="CPU"`` which will change the default "CPU" -for t

[clang-tools-extra] [Clang] Support target attr specifying CPU (PR #68678)

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

[clang] [Clang] Support target attr specifying CPU (PR #68678)

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

[clang] [Clang] Support target attr specifying CPU (PR #68678)

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

[clang-tools-extra] [Clang] Support target attr specifying CPU (PR #68678)

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

[clang] [flang][Driver] Support -rpath, -shared, and -static in the frontend (PR #66702)

2023-10-16 Thread Fangrui Song via cfe-commits
MaskRay wrote: These tests just need a `--target=x86_64-linux-gnu`: which is how clang/test/Driver tests these stuff. Non-ELF platforms such as Apple, Windows, and AIX, may not support some options. Ideally we should express that the test works for every ELF platform or everything except bare

[clang] [Clang] Fix dependence handling of nttp for variable templates (PR #69075)

2023-10-16 Thread Fangrui Song via cfe-commits
@@ -380,25 +380,25 @@ UnresolvedLookupExpr *UnresolvedLookupExpr::Create( void *Mem = Context.Allocate(Size, alignof(UnresolvedLookupExpr)); return new (Mem) UnresolvedLookupExpr(Context, NamingClass, QualifierLoc, SourceLocation(), N

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

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

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

2023-10-16 Thread Fangrui Song via cfe-commits
@@ -56,7 +56,9 @@ void dragonfly::Linker::ConstructJob(Compilation &C, const JobAction &JA, const InputInfoList &Inputs, const ArgList &Args, const char *LinkingOutpu

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

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

[clang] [Clang] Fix dependence handling of nttp for variable templates (PR #69075)

2023-10-16 Thread Fangrui Song via cfe-commits
=?utf-8?b?5YiY6Zuo5Z+5?= Message-ID: In-Reply-To: https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/69075 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [Clang] Fix dependence handling of nttp for variable templates (PR #69075)

2023-10-16 Thread Fangrui Song via cfe-commits
=?utf-8?b?5YiY6Zuo5Z+5?= Message-ID: In-Reply-To: https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/69075 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [unittest] Add a test for Generic_GCC::GCCVersion::Parse (PR #69078)

2023-10-17 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,48 @@ +//===- unittests/Driver/GCCVersionTest.cpp --- GCCVersion parser tests ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [clang] [unittest] Add a test for Generic_GCC::GCCVersion::Parse (PR #69078)

2023-10-17 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,48 @@ +//===- unittests/Driver/GCCVersionTest.cpp --- GCCVersion parser tests ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [clang] [unittest] Add a test for Generic_GCC::GCCVersion::Parse (PR #69078)

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

[clang] [clang] [unittest] Add a test for Generic_GCC::GCCVersion::Parse (PR #69078)

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

[clang] [clang] [unittest] Add a test for Generic_GCC::GCCVersion::Parse (PR #69078)

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

[clang] [clang] [unittest] Add a test for Generic_GCC::GCCVersion::Parse (PR #69078)

2023-10-17 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,48 @@ +//===- unittests/Driver/GCCVersionTest.cpp --- GCCVersion parser tests ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [Driver] Link Flang runtime on Solaris (PR #65644)

2023-10-17 Thread Fangrui Song via cfe-commits
@@ -21,12 +22,12 @@ ! run on any other platform, such as Windows that use a .exe ! suffix. Clang's driver will try to resolve the path to the ld ! executable and may find the GNU linker from MinGW or Cygwin. -! GNU-LABEL: "{{.*}}ld{{(\.exe)?}}" -! GNU-SAME: "

[clang] [Driver] Link Flang runtime on Solaris (PR #65644)

2023-10-17 Thread Fangrui Song via cfe-commits
@@ -2,8 +2,9 @@ ! invocation. These libraries are added on top of other standard runtime ! libraries that the Clang driver will include. -! RUN: %flang -### -target ppc64le-linux-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,GNU +! RUN: %flang -### -targe

[clang] [Driver] Remove identifier with the comment (PR #68351)

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

[clang] [Driver] Remove identifier with the comment (PR #68351)

2023-10-17 Thread Fangrui Song via cfe-commits
MaskRay wrote: Add `NFC`? https://github.com/llvm/llvm-project/pull/68351 ___ 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-10-18 Thread Fangrui Song via cfe-commits
@@ -43,6 +43,12 @@ #define LIBUNWIND_AVAIL #endif +#if defined(__SANITIZE_MEMORY__) || \ MaskRay wrote: `__SANITIZE_MEMORY__` is a macro defined by the Linux kernel and copied to other projects. We can drop it.

[clang] [CodeGen] -fsanitize=alignment: add cl::opt sanitize-alignment-builtin to disable memcpy instrumentation (PR #69240)

2023-10-18 Thread Fangrui Song via cfe-commits
MaskRay wrote: > > For reference, can you give a couple examples of code where this is > > triggering? > > If this is triggering in practice, do we want a real driver option to > > control the sanitizer? The alignment attributes themselves? > I am not sure we need special driver flag for that

[clang] [CodeGen] -fsanitize=alignment: add cl::opt sanitize-alignment-builtin to disable memcpy instrumentation (PR #69240)

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

[clang] [CodeGen] -fsanitize=alignment: add cl::opt sanitize-alignment-builtin to disable memcpy instrumentation (PR #69240)

2023-10-18 Thread Fangrui Song via cfe-commits
@@ -66,6 +66,11 @@ using namespace clang; using namespace CodeGen; using namespace llvm; +static llvm::cl::opt ClSanitizeAlignmentBuiltin( +"sanitize-alignment-builtin", llvm::cl::Hidden, +llvm::cl::desc("Instrument builtin functions for -fsanitize=alignment"), +ll

[clang] [CodeGen] -fsanitize=alignment: add cl::opt sanitize-alignment-builtin to disable memcpy instrumentation (PR #69240)

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

[clang] [CodeGen] -fsanitize=alignment: add cl::opt sanitize-alignment-builtin to disable memcpy instrumentation (PR #69240)

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

[clang] [CodeGen] -fsanitize=alignment: add cl::opt sanitize-alignment-builtin to disable memcpy instrumentation (PR #69240)

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

[clang] [Driver] Corrections for linker flags passed with relocatable linking on OpenBSD (PR #67254)

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

[clang] [Driver] Corrections for linker flags passed with relocatable linking on OpenBSD (PR #67254)

2023-10-19 Thread Fangrui Song via cfe-commits
MaskRay wrote: `-Bdynamic` is the linker default, so you can remove it. Gnu.cpp uses `-Bdynamic` like `)` to close `-Bstatic`: `-Bstatic ... `-Bdynamic` https://github.com/llvm/llvm-project/pull/67254 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [Driver] Corrections for linker flags passed with relocatable linking on OpenBSD (PR #67254)

2023-10-19 Thread Fangrui Song via cfe-commits
@@ -36,10 +36,12 @@ // RUN: | FileCheck --check-prefix=CHECK-MIPS64-LD %s // RUN: %clang --target=mips64el-unknown-openbsd -### %s 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-LD %s -// CHECK-LD-R: "-r" +// CHECK-LD-R-NOT: "-e" "__start" Mas

[clang] [clang] [unittest] Add a test for Generic_GCC::GCCVersion::Parse (PR #69078)

2023-10-19 Thread Fangrui Song via cfe-commits
MaskRay wrote: I hope that we do not drop `LLVM_LIBRARY_VISIBILITY` arbitrarily from `clang::driver::toolchains::*` classes, just because some unittests need to reference the symbols in a shared object. ```c #if !defined(LLVM_BUILD_SHARED_LIBS) ``` is not great but is not too bad. `-DBUILD_SH

[clang] [Driver] Corrections for linker flags passed with relocatable linking on OpenBSD (PR #67254)

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

[clang] ✨ [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy) (PR #68620)

2023-10-21 Thread Fangrui Song via cfe-commits
@@ -816,6 +821,14 @@ will be ignored}]>; def L : JoinedOrSeparate<["-"], "L">, Flags<[RenderJoined]>, Group, Visibility<[ClangOption, FlangOption]>, MetaVarName<"">, HelpText<"Add directory to library search path">; +def embed_dir : JoinedOrSeparate<["-"], "embed-dir">,

[clang] ✨ [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy) (PR #68620)

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

[clang] ✨ [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy) (PR #68620)

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

[clang] [Driver] Hook up Haiku PowerPC support (PR #69134)

2023-10-22 Thread Fangrui Song via cfe-commits
MaskRay wrote: It seems that there is no usable Haiku kernel: https://www.haiku-os.org/guides/building/port_status/ Then we shouldn't add this? https://github.com/llvm/llvm-project/pull/69134 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[clang] [Clang][LTO][GISel] Propagate `-fglobal-siel` to LTO (PR #69747)

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

[clang] [Clang][LTO][GISel] Propagate `-fglobal-siel` to LTO (PR #69747)

2023-10-22 Thread Fangrui Song via cfe-commits
@@ -694,6 +694,16 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args, CmdArgs.push_back(Args.MakeArgString(Twine(PluginOptPrefix) + ParallelismOpt + Parallelism)); + // Pass down GlobalISel options. + if

[clang] [Clang][LTO][GISel] Propagate `-fglobal-siel` to LTO (PR #69747)

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

[clang] -fstack-usage: fix filename for functions in an included file (PR #69896)

2023-10-22 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/69896 Fix #69889 >From 343f5abcd269701f526b64508237fb992ad7828d Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 22 Oct 2023 22:04:31 -0700 Subject: [PATCH] -fstack-usage: fix filename for functions in an inclu

[clang] [Driver] Ignore non-clang pch files when -include a.h probes a.h.gch (PR #69204)

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

[clang] -fstack-usage: fix filename for functions in an included file (PR #69896)

2023-10-23 Thread Fangrui Song via cfe-commits
MaskRay wrote: > Thanks for the MR, @MaskRay! The patch LGTM. Can you confirm that the failing > checks are not related to this patch? Thanks for review. I confirm it is an unrelated `clang-format` issue (`grep -rnI '[[:blank:]]$' clang/lib clang/include clang/docs`) caused by another patch a

[clang] -fstack-usage: fix filename for functions in an included file (PR #69896)

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

[clang-tools-extra] [Docs][LTO] Updated HowToSubmitABug.rst for LTO crashes (PR #68389)

2023-10-23 Thread Fangrui Song via cfe-commits
@@ -153,6 +153,67 @@ Please run this, then file a bug with the instructions and reduced .bc file that bugpoint emits. If something goes wrong with bugpoint, please submit the "foo.bc" file and the option that llc crashes with. +LTO bugs +--- + +If you

[clang-tools-extra] [Docs][LTO] Updated HowToSubmitABug.rst for LTO crashes (PR #68389)

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

[clang-tools-extra] [Docs][LTO] Updated HowToSubmitABug.rst for LTO crashes (PR #68389)

2023-10-23 Thread Fangrui Song via cfe-commits
@@ -153,6 +153,67 @@ Please run this, then file a bug with the instructions and reduced .bc file that bugpoint emits. If something goes wrong with bugpoint, please submit the "foo.bc" file and the option that llc crashes with. +LTO bugs +--- + +If you

[clang-tools-extra] [Docs][LTO] Updated HowToSubmitABug.rst for LTO crashes (PR #68389)

2023-10-23 Thread Fangrui Song via cfe-commits
@@ -153,6 +153,67 @@ Please run this, then file a bug with the instructions and reduced .bc file that bugpoint emits. If something goes wrong with bugpoint, please submit the "foo.bc" file and the option that llc crashes with. +LTO bugs +--- + +If you

[clang] [ADT] Rename llvm::erase_value to llvm::erase (NFC) (PR #70156)

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

[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] [llvm] ms inline asm: Fix {call,jmp} fptr (PR #73207)

2023-11-27 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed 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

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

2023-11-27 Thread Fangrui Song via cfe-commits
MaskRay wrote: > (btw, that `squash!` commit contains the revised commit message I plan to put > on the final version, so I need to not forget to do the squash by hand to get > that right) You may edit the first comment in this PR now, and it will be propagated to the textbox when you click "

[clang] [flang] [flang][Driver] Support -nodefaultlibs, -nostartfiles and -nostdlib (PR #72601)

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

[clang] [flang] [flang][Driver] Support -nodefaultlibs, -nostartfiles and -nostdlib (PR #72601)

2023-11-27 Thread Fangrui Song via cfe-commits
@@ -5152,7 +5152,8 @@ def : Flag<["-"], "nocudalib">, Alias; def gpulibc : Flag<["-"], "gpulibc">, Visibility<[ClangOption, CC1Option]>, HelpText<"Link the LLVM C Library for GPUs">; def nogpulibc : Flag<["-"], "nogpulibc">, Visibility<[ClangOption, CC1Option]>; -def nodefaul

[clang] [flang] [flang][Driver] Support -nodefaultlibs, -nostartfiles and -nostdlib (PR #72601)

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

[clang] [flang] [flang][Driver] Support -nodefaultlibs, -nostartfiles and -nostdlib (PR #72601)

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

[clang] [clang] changes where a test writes its output (PR #73560)

2023-11-27 Thread Fangrui Song via cfe-commits
MaskRay wrote: b9b627fbc3bc64cd3e7e009917df35d2971827d9 already fixed the issue https://github.com/llvm/llvm-project/pull/73560 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [KMSAN] Enable on PowerPC64 (PR #73611)

2023-11-27 Thread Fangrui Song via cfe-commits
MaskRay wrote: Does `-fsanitize=kernel-memory` work for Linux kernel's powerpc64 port? https://github.com/llvm/llvm-project/pull/73611 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2023-11-27 Thread Fangrui Song via cfe-commits
@@ -3618,6 +3618,13 @@ void CompilerInvocationBase::GenerateLangArgs(const LangOptions &Opts, GenerateArg(Consumer, OPT_fcxx_abi_EQ, TargetCXXABI::getSpelling(*Opts.CXXABI)); + if (Opts.MSBitfields.has_value()) { +if (Opts.MSBitfields.value()) +

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2023-11-27 Thread Fangrui Song via cfe-commits
@@ -4393,15 +4393,15 @@ def : Joined<["-"], "mmacosx-version-min=">, Group, Alias; def mms_bitfields : Flag<["-"], "mms-bitfields">, Group, Visibility<[ClangOption, CC1Option]>, - HelpText<"Set the default structure layout to be compatible with the Microsoft compiler stan

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

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

[clang] e2d60c8 - [Frontend] Remove unneeded -frtti check. NFC

2023-11-27 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2023-11-27T21:41:04-08:00 New Revision: e2d60c86268479b019d62bba25745407dc15ce98 URL: https://github.com/llvm/llvm-project/commit/e2d60c86268479b019d62bba25745407dc15ce98 DIFF: https://github.com/llvm/llvm-project/commit/e2d60c86268479b019d62bba25745407dc15ce98.diff

[clang] [llvm] [KMSAN] Enable on PowerPC64 (PR #73611)

2023-11-27 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,149 @@ +; RUN: opt < %s -S -msan-kernel=1 -passes=msan 2>&1 | FileCheck %s + +target datalayout = "e-m:e-i64:64-n32:64" +target triple = "powerpc64le--linux" + +define void @Store1(ptr %p, i8 %x) sanitize_memory { +entry: + store i8 %x, ptr %p + ret void +} + +; CHECK

[clang] [llvm] [KMSAN] Enable on PowerPC64 (PR #73611)

2023-11-27 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,149 @@ +; RUN: opt < %s -S -msan-kernel=1 -passes=msan 2>&1 | FileCheck %s + +target datalayout = "e-m:e-i64:64-n32:64" +target triple = "powerpc64le--linux" + +define void @Store1(ptr %p, i8 %x) sanitize_memory { +entry: + store i8 %x, ptr %p + ret void +} + +; CHECK

[llvm] [clang] [KMSAN] Enable on PowerPC64 (PR #73611)

2023-11-27 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,149 @@ +; RUN: opt < %s -S -msan-kernel=1 -passes=msan 2>&1 | FileCheck %s MaskRay wrote: Since the directory name contains `PowerPC`, it's unnecessary to repeat `ppc64le`. You can use `basic-kernel.ll` like SystemZ/ or `kernel.ll`. https://github.c

[clang] [llvm] [KMSAN] Enable on PowerPC64 (PR #73611)

2023-11-28 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,149 @@ +; RUN: opt < %s -S -msan-kernel=1 -passes=msan 2>&1 | FileCheck %s MaskRay wrote: `llvm/test/Instrumentation/MemorySanitizer/PowerPC/vararg-ppc64.ll` does not follow the convention. I think the new test should follow other tests which follow

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2023-11-29 Thread Fangrui Song via cfe-commits
MaskRay wrote: `-mms-bitfields` is a GCC x86 specific option (`aarch64-linux-gnu-gcc -mms-bitfields -xc /dev/null -E` => `error: unrecognized command-line option ‘-mms-bitfields’`). It does not make sense for MSVC. Currently, Driver defaults to pass -mms-bitfields to cc1 for `windows-gnu` trip

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

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

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2023-11-29 Thread Fangrui Song via cfe-commits
MaskRay wrote: I am now confused by the subject "[clang] Stub out gcc_struct attribute". Do you mean "Implement gcc_struct attribute"? But the description isn't clear that this patch changes `-mms-bitfields` and `ms_struct` to be respected for windows-msvc targets. SerenityOS is an OS, indepen

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

2023-11-30 Thread Fangrui Song via cfe-commits
MaskRay wrote: > Weirdly, this leads to `warning: argument unused during compilation: > '-nopie'` rather than `error: unknown argument: '-nopie'` Marking `-nopie` as `TargetSpecific` should change this to an error. https://github.com/openbsd/src has some `-nopie` use cases that haven't migrat

[clang] f1eddf5 - [Driver] Mark OpenBSD-specific -nopie as TargetSpecific after #72578

2023-11-30 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2023-11-30T11:42:54-08:00 New Revision: f1eddf5c39e7e203fbc8fb5f9293b9baa8bbb04b URL: https://github.com/llvm/llvm-project/commit/f1eddf5c39e7e203fbc8fb5f9293b9baa8bbb04b DIFF: https://github.com/llvm/llvm-project/commit/f1eddf5c39e7e203fbc8fb5f9293b9baa8bbb04b.diff

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

2023-12-01 Thread Fangrui Song via cfe-commits
MaskRay wrote: LGTM 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] [Driver][LTO] Copy fix empty stats filename to AMDGPU, HIPAMD, MinGW (PR #74178)

2023-12-01 Thread Fangrui Song via cfe-commits
MaskRay wrote: At this point, it does seem that changing `addLTOOption` to accept `Inputs` instead of `Input` will eliminate duplication and ensure consistency among targets. https://github.com/llvm/llvm-project/pull/74178 ___ cfe-commits mailing lis

[clang] [Driver] Add the --gcc-triple option (PR #73214)

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

[clang] [Driver] Add the --gcc-triple option (PR #73214)

2023-12-01 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,8 @@ +// UNSUPPORTED: system-windows +// MaskRay wrote: Drop `^//$` lines. The conventional style doesn't add these markers for otherwise blank lines. Without them, we can navigate among the tests using vim-style `{` `}` . https://github.com/llvm/ll

[clang] [Driver] Add the --gcc-triple option (PR #73214)

2023-12-01 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,8 @@ +// UNSUPPORTED: system-windows +// +// RUN: %clang --target=x86_64-redhat-linux-gnu \ +// RUN: --sysroot=%S/Inputs/fedora_39_tree --gcc-triple=x86_64-redhat-linux -v 2>&1 | \ MaskRay wrote: Indent continuation lines. https://github.com/llvm/llv

[clang] [Driver] Add the --gcc-triple option (PR #73214)

2023-12-01 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,8 @@ +// UNSUPPORTED: system-windows +// +// RUN: %clang --target=x86_64-redhat-linux-gnu \ +// RUN: --sysroot=%S/Inputs/fedora_39_tree --gcc-triple=x86_64-redhat-linux -v 2>&1 | \ +// RUN: FileCheck %s +// MaskRay wrote: Add another test when `--gcc-

[clang] [Driver] Add the --gcc-triple option (PR #73214)

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

[clang] [Driver] Add the --gcc-triple option (PR #73214)

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

[clang] [Driver] Add the --gcc-triple option (PR #73214)

2023-12-01 Thread Fangrui Song via cfe-commits
@@ -2130,6 +2130,15 @@ void Generic_GCC::GCCInstallationDetector::init( return; } + // If --gcc-triple is specified use this instead of trying to + // auto-detect a triple. + if (const Arg *A = + Args.getLastArg(clang::driver::options::OPT_gcc_triple_EQ)) { +

<    5   6   7   8   9   10   11   >