[clang] [Driver,AArch64] Remove AArch32-specific -m[no-]unaligned-access (PR #85441)

2024-03-15 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/85441 Follow-up to #85350: GCC only supports -m[no-]strict-align for AArch64 and rejects adding -m[no-]unaligned-access aliases. We inapropriated supported -m[no-]unaligned-access as aliases for non-AArch64 due to an ea

[clang] [Driver,AArch64] Remove AArch32-specific -m[no-]unaligned-access (PR #85441)

2024-03-15 Thread Fangrui Song via cfe-commits
MaskRay wrote: If Apple platforms need this option, I can keep it recognized but only for Apple. For ELF platforms, we should remove the GCC-unsupported-and-rejected aliases. https://github.com/llvm/llvm-project/pull/85441 ___ cfe-commits mailing lis

[clang] [clang] Move CCC_OVERRIDE_OPTIONS implementation to Driver (PR #85425)

2024-03-15 Thread Fangrui Song via cfe-commits
@@ -6677,3 +6678,136 @@ llvm::Error driver::expandResponseFiles(SmallVectorImpl &Args, return llvm::Error::success(); } + +namespace { + +const char *GetStableCStr(std::set &SavedStrings, StringRef S) { + return SavedStrings.insert(std::string(S)).first->c_str(); +} + +///

[clang] [clang] Move CCC_OVERRIDE_OPTIONS implementation to Driver (PR #85425)

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

[clang] [clang] Move CCC_OVERRIDE_OPTIONS implementation to Driver (PR #85425)

2024-03-15 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. two nits https://github.com/llvm/llvm-project/pull/85425 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Move CCC_OVERRIDE_OPTIONS implementation to Driver (PR #85425)

2024-03-15 Thread Fangrui Song via cfe-commits
@@ -87,6 +87,7 @@ #include "llvm/Support/Process.h" #include "llvm/Support/Program.h" #include "llvm/Support/RISCVISAInfo.h" +#include "llvm/Support/Regex.h" MaskRay wrote: remove #include "llvm/Support/Regex.h" for clang/tools/driver/driver.cpp https://githu

[clang] [clang] Move CCC_OVERRIDE_OPTIONS implementation to Driver (PR #85425)

2024-03-15 Thread Fangrui Song via cfe-commits
@@ -6677,3 +6678,136 @@ llvm::Error driver::expandResponseFiles(SmallVectorImpl &Args, return llvm::Error::success(); } + +namespace { + +const char *GetStableCStr(std::set &SavedStrings, StringRef S) { + return SavedStrings.insert(std::string(S)).first->c_str(); +} + +///

[clang] [clang] Move CCC_OVERRIDE_OPTIONS implementation to Driver (PR #85425)

2024-03-15 Thread Fangrui Song via cfe-commits
@@ -6677,3 +6678,134 @@ llvm::Error driver::expandResponseFiles(SmallVectorImpl &Args, return llvm::Error::success(); } + +namespace { + +const char *GetStableCStr(std::set &SavedStrings, StringRef S) { MaskRay wrote: We prefer `static` for functions http

[clang] [clang] Move CCC_OVERRIDE_OPTIONS implementation to Driver (PR #85425)

2024-03-15 Thread Fangrui Song via cfe-commits
@@ -839,6 +839,13 @@ llvm::Error expandResponseFiles(SmallVectorImpl &Args, bool ClangCLMode, llvm::BumpPtrAllocator &Alloc, llvm::vfs::FileSystem *FS = nullptr); +/// Apply a space separated list of edits to the

[clang] [clang] Move CCC_OVERRIDE_OPTIONS implementation to Driver (PR #85425)

2024-03-15 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/85425 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [openmp] [docs] Prefer --gcc-install-dir= to deprecated GCC_INSTALL_PREFIX (PR #85458)

2024-03-15 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/85458 Setting GCC_INSTALL_PREFIX leads to a warning (#77537). Link: discourse.llvm.org/t/add-gcc-install-dir-deprecate-gcc-toolchain-and-remove-gcc-install-prefix/65091 Link: discourse.llvm.org/t/correct-cmake-parame

[clang] [openmp] [docs] Prefer --gcc-install-dir= to deprecated GCC_INSTALL_PREFIX (PR #85458)

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

[clang] [clang] Move CCC_OVERRIDE_OPTIONS implementation to Driver (PR #85425)

2024-03-15 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/85425 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-03-15 Thread Fangrui Song via cfe-commits
MaskRay wrote: > CC @llvm/clang-vendors > > > I [announced this change on > > discourse](https://discourse.llvm.org/t/use-glob-instead-of-regex-for-specialcaselists/71666?u=ellishg) > > last year. > > "Use glob instead of regex for SpecialCaseLists" doesn't mean anything for > anyone not act

[clang] [C++20] [Modules] Introduce -fgen-reduced-bmi (PR #85050)

2024-03-15 Thread Fangrui Song via cfe-commits
@@ -3031,6 +3032,11 @@ defm skip_odr_check_in_gmf : BoolOption<"f", "skip-odr-check-in-gmf", "Perform ODR checks for decls in the global module fragment.">>, Group; +def gen_reduced_bmi : Flag<["-"], "fgen-reduced-bmi">, + Group, Visibility<[ClangOption, CC1Optio

[clang] [C++20] [Modules] Introduce -fgen-reduced-bmi (PR #85050)

2024-03-15 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,53 @@ +// It is annoying to handle different slash direction +// in Windows and Linux. So we disable the test on Windows +// here. +// REQUIRES: !system-windows +// On AIX, the default output for `-c` may be `.s` instead of `.o`, +// which makes the test fail. So disabl

[clang] [C++20] [Modules] Introduce -fgen-reduced-bmi (PR #85050)

2024-03-15 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,53 @@ +// It is annoying to handle different slash direction +// in Windows and Linux. So we disable the test on Windows +// here. +// REQUIRES: !system-windows MaskRay wrote: UNSUPPORTED is much more common https://github.com/llvm/llvm-project/pull/8

[clang] [Sema] Allow -Wno-main to suppress the arg wrong error (PR #85494)

2024-03-15 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/85494 The diagnostic is a warning in GCC. We make it a DefaultError warning under -Wmain. There is a use case to pass customized arguments to main without using -ffreestanding. Close #85491 >From 0fd3675447f41b0334

[clang] [Driver] -fsanitize=undefined: don't expand to signed-integer-overflow if -fwrapv (PR #85501)

2024-03-15 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/85501 Linux kernel uses -fwrapv to change signed integer overflows from undefined behaviors to defined behaviors. However, the security folks still want -fsanitize=signed-integer-overflow diagnostics. Their intention ca

[clang] Sanitizer: Support -fwrapv with -fsanitize=signed-integer-overflow (PR #82432)

2024-03-15 Thread Fangrui Song via cfe-commits
MaskRay wrote: > Shouldn't plain `-fsanitize=undefined` disable this sanitizer by default > (requiring explicit opt-in)? In `-fwrapv` mode this is not undefined > behavior, so `-fsanitize=undefined` should not complain about it. I was on the fence whether `-fsanitize=undefined` should expand t

[clang] [Sema] Allow -Wno-main to suppress the arg wrong error (PR #85494)

2024-03-16 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/85494 >From 0fd3675447f41b033472f9269648e8e735bc543a Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Fri, 15 Mar 2024 20:26:52 -0700 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?= =?UTF

[clang] [Driver] -fsanitize=undefined: don't expand to signed-integer-overflow if -fwrapv (PR #85501)

2024-03-18 Thread Fangrui Song via cfe-commits
MaskRay wrote: "Squash and merge" uses the description instead of the commit message, so the commit message is not useful. The commit message is due to spr. https://github.com/llvm/llvm-project/pull/85501 ___ cfe-commits mailing list cfe-commits@lists

[clang] [llvm] [AsmPrinter,X86] Hard code AT&T syntax input for module-level inline assembly for MSVC triples (PR #85668)

2024-03-18 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/85668 clang-cl is conflating input assembly syntax with output assembly syntax. It expects AT&T syntax input but Intel syntax output. This conflicts with clang -c -masm=intel users that do expect -masm=intel to control

[clang] [llvm] [AsmPrinter,X86] Hard code AT&T syntax input for module-level inline assembly for MSVC triples (PR #85668)

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

[clang] [Driver,AArch64] Remove AArch32-specific -m[no-]unaligned-access (PR #85441)

2024-03-18 Thread Fangrui Song via cfe-commits
MaskRay wrote: > If possible I would prefer to keep -m[no-]unaligned-access for AArch64. > > The history of this option name derives from Arm's proprietary compiler > [developer.arm.com/documentation/dui0472/m/Compiler-Command-line-Options/--unaligned-accessno-unaligned-access](https://deve

[clang] [llvm] [AsmPrinter,X86] Hard code AT&T syntax input for module-level inline assembly for MSVC triples (PR #85668)

2024-03-18 Thread Fangrui Song via cfe-commits
MaskRay wrote: Thanks. Fixing it on the Chromium feels nicer to me as well. This should work around the code if you run into more code needing this :) Personally I suspect not, since module-level inline asm with instructions are very rarely used (non-instruction directives are uses more). htt

[clang] [openmp] [docs] Prefer --gcc-install-dir= to deprecated GCC_INSTALL_PREFIX (PR #85458)

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

[clang] [Driver,AArch64] Remove AArch32-specific -m[no-]unaligned-access (PR #85441)

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

[clang] [Driver,AArch64] Remove AArch32-specific -m[no-]unaligned-access (PR #85441)

2024-03-18 Thread Fangrui Song via cfe-commits
MaskRay wrote: Thanks for the comment. I'll abandon this. https://github.com/llvm/llvm-project/pull/85441 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang driver: enable fast unaligned access for Android on RISCV64 (PR #85704)

2024-03-19 Thread Fangrui Song via cfe-commits
@@ -167,6 +167,10 @@ void riscv::getRISCVTargetFeatures(const Driver &D, const llvm::Triple &Triple, Features.push_back("-relax"); } + // Android requires fast unaligned access on RISCV64. MaskRay wrote: This adds two +fast-unaligned-access if -mno-st

[clang] clang driver: enable fast unaligned access for Android on RISCV64 (PR #85704)

2024-03-19 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay commented: . https://github.com/llvm/llvm-project/pull/85704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] -fsanitize=undefined: don't expand to signed-integer-overflow if -fwrapv (PR #85501)

2024-03-19 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/85501 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Hexagon] ELF attributes for Hexagon (PR #85359)

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

[clang] [CMake] Change GCC_INSTALL_PREFIX from warning to fatal error (PR #85891)

2024-03-19 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/85891 unless USE_DEPRECATED_GCC_INSTALL_PREFIX (temporary escape hatch) is set. Setting GCC_INSTALL_PREFIX leads to a warning for Clang 18.1 (#77537) and will be completely removed for Clang 20. Link: discourse.llvm.o

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-19 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. bazel-6.3.2 build --config=generic_clang @llvm-project//clang build passes with this refactoring. Thanks https://github.com/llvm/llvm-project/pull/84184 ___ cfe-commits mailing list cfe-commits@li

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI compatibility tag (PR #85235)

2024-03-19 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,32 @@ +// Check that we can manually enable specific ptrauth features. + +// RUN: %clang -target aarch64 -c %s -### 2>&1 | FileCheck %s --check-prefix NONE MaskRay wrote: `--target=` for new tests https://github.com/llvm/llvm-project/pull/85235 _

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI compatibility tag (PR #85235)

2024-03-19 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,32 @@ +// Check that we can manually enable specific ptrauth features. + +// RUN: %clang -target aarch64 -c %s -### 2>&1 | FileCheck %s --check-prefix NONE +// NONE: "-cc1" +// NONE-NOT: "-fptrauth-intrinsics" +// NONE-NOT: "-fptrauth-calls" +// NONE-NOT: "-fptrauth-re

[clang] [CMake] Change GCC_INSTALL_PREFIX from warning to fatal error (PR #85891)

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

[clang] [clang][SPIRV] Don't warn on -mcmodel (PR #86039)

2024-03-21 Thread Fangrui Song via cfe-commits
@@ -5804,7 +5804,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, } else if (Triple.getArch() == llvm::Triple::x86_64) { Ok = llvm::is_contained({"small", "kernel", "medium", "large", "tiny"}, CM); -} else if (Tripl

[clang] [clang][AST][NFC] Add '[[fallthrough]]' to cases fall through (PR #85921)

2024-03-21 Thread Fangrui Song via cfe-commits
MaskRay wrote: We should remove the comment. To make the PR more useful, the PR can be changed to remove other confusing comments like this. https://github.com/llvm/llvm-project/pull/85921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang] [Clang] Make '-frtlib-add-rpath' include the standard library directory (PR #86217)

2024-03-21 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/86217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [cmake] Add cmake module dir before using GetDarwinLinkerVersion (PR #86386)

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

[clang] [Sema] Allow -Wno-main to suppress the arg wrong error (PR #85494)

2024-03-25 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/85494 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Allow -Wno-main to suppress the arg wrong error (PR #85494)

2024-03-25 Thread Fangrui Song via cfe-commits
MaskRay wrote: > > There is a use case to pass customized arguments to main without using > > -ffreestanding. > > This is not motivating for C++ because that's not actually valid to do > ([eel.is/c++draft/basic.start.main#3.sentence-1](https://eel.is/c++draft/basic.start.main#3.sentence-1)), >

[clang] [llvm] [AsmPrinter,X86] Hard code AT&T syntax input for module-level inline assembly for MSVC triples (PR #85668)

2024-03-25 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/85668 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AsmPrinter,X86] Hard code AT&T syntax input for module-level inline assembly for MSVC triples (PR #85668)

2024-03-25 Thread Fangrui Song via cfe-commits
MaskRay wrote: > Looks like we were able to fix code on our end and this here isn't needed. > But maybe the current behavior isn't 100% ideal. Thanks. I am abandoning this workaround. > Here's what I think the situation currently is (please correct me if I'm > wrong): > > * With clang-cl, yo

[clang] Use timeTraceAsyncProfilerBegin for Source span (PR #83961)

2024-03-25 Thread Fangrui Song via cfe-commits
@@ -166,8 +167,9 @@ class SemaPPCallbacks : public PPCallbacks { } case ExitFile: if (!IncludeStack.empty()) { -if (llvm::timeTraceProfilerEnabled()) - llvm::timeTraceProfilerEnd(); +if (llvm::timeTraceProfilerEnabled()) { + llvm:

[clang] 6ff6191 - [Driver] Reject -fptrauth-intrinsics on non-AArch64 targets

2024-03-26 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2024-03-26T00:04:19-07:00 New Revision: 6ff61914a1ef2c05702ba73cf31ffdeed59c1740 URL: https://github.com/llvm/llvm-project/commit/6ff61914a1ef2c05702ba73cf31ffdeed59c1740 DIFF: https://github.com/llvm/llvm-project/commit/6ff61914a1ef2c05702ba73cf31ffdeed59c1740.diff

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI compatibility tag (PR #85235)

2024-03-26 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,32 @@ +// Check that we can manually enable specific ptrauth features. + +// RUN: %clang --target=aarch64 -c %s -### 2>&1 | FileCheck %s --check-prefix NONE +// NONE: "-cc1" +// NONE-NOT: "-fptrauth-intrinsics" MaskRay wrote: `// NONE-NOT: "-fptrauth-

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI compatibility tag (PR #85235)

2024-03-26 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,32 @@ +// Check that we can manually enable specific ptrauth features. MaskRay wrote: aarch64-ptrauth.c is more conventional for such target-specific features https://github.com/llvm/llvm-project/pull/85235

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI compatibility tag (PR #85235)

2024-03-26 Thread Fangrui Song via cfe-commits
@@ -7203,6 +7203,33 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, options::OPT_fno_ptrauth_intrinsics, false)) CmdArgs.push_back("-fptrauth-intrinsics"); + if (Args.hasFlag(options::OPT_fptrauth_calls, options::OPT_fno_ptrauth_calls,

[clang] f18600c - [Driver] Avoid repeated ToolChain.getTriple() calls. NFC

2024-03-27 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2024-03-27T13:50:17-07:00 New Revision: f18600c87404eab8d0a279b0286f8add8b4a1bb8 URL: https://github.com/llvm/llvm-project/commit/f18600c87404eab8d0a279b0286f8add8b4a1bb8 DIFF: https://github.com/llvm/llvm-project/commit/f18600c87404eab8d0a279b0286f8add8b4a1bb8.diff

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-03-29 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/87130 https://reviews.llvm.org/D54188 marked "alias" targets as used in C to fix -Wunused false positives. This patch extends the approach to handle mangled names to support global scope names in C++. We fix false posit

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Fangrui Song via cfe-commits
@@ -1980,6 +1981,23 @@ static void handleWeakRefAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL)); } +// Mark alias/ifunc target as used. For C++, we look up the demangled name +// ignoring parameters. This should handle

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

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

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Fangrui Song via cfe-commits
@@ -1,7 +1,35 @@ -// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wunneeded-internal-declaration -x c -verify %s +// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wunused -x c -verify %s +// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wunused -x c++ -verify %s + +#ifdef __cplusplus +exter

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Fangrui Song via cfe-commits
@@ -1,7 +1,35 @@ -// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wunneeded-internal-declaration -x c -verify %s +// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wunused -x c -verify %s +// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wunused -x c++ -verify %s + +#ifdef __cplusplus +exter

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Fangrui Song via cfe-commits
@@ -1980,6 +1981,23 @@ static void handleWeakRefAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL)); } +// Mark alias/ifunc target as used. For C++, we look up the demangled name +// ignoring parameters. This should handle

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Fangrui Song via cfe-commits
@@ -1980,6 +1981,23 @@ static void handleWeakRefAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL)); } +// Mark alias/ifunc target as used. For C++, we look up the demangled name +// ignoring parameters. This should handle

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

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

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/87130 >From 23422a0b3af3e070fed5ae86ed0f67acec066c0a Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Fri, 29 Mar 2024 17:48:14 -0700 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?= =?UTF

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-02 Thread Fangrui Song via cfe-commits
@@ -1980,6 +1981,23 @@ static void handleWeakRefAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL)); } +// Mark alias/ifunc target as used. For C++, we look up the demangled name +// ignoring parameters. This should handle

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

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

[clang] f599116 - [Driver,test] Remove --gcc-toolchain=""

2024-04-02 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2024-04-02T10:40:19-07:00 New Revision: f5991161529511ca6ebc058da2a0507c2fc5283e URL: https://github.com/llvm/llvm-project/commit/f5991161529511ca6ebc058da2a0507c2fc5283e DIFF: https://github.com/llvm/llvm-project/commit/f5991161529511ca6ebc058da2a0507c2fc5283e.diff

[clang] [Driver] Check the environment version except wasm case. (PR #80783)

2024-02-06 Thread Fangrui Song via cfe-commits
MaskRay wrote: wasm tests in android-* seem weird. A wasm file should be used https://github.com/llvm/llvm-project/pull/80783 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Check the environment version except wasm case. (PR #80783)

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

[clang] [Driver] Check the environment version except wasm case. (PR #80783)

2024-02-06 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. LGTM with glandium's suggestion. https://github.com/llvm/llvm-project/pull/80783 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Check the environment version except wasm case. (PR #80783)

2024-02-06 Thread Fangrui Song via cfe-commits
@@ -14,3 +14,18 @@ // RUN: FileCheck --check-prefix=CHECK-TARGET %s // CHECK-TARGET: "aarch64-unknown-linux-android31" + +// RUN: not %clang --target=armv7-linux-gnuS -c %s -### 2>&1 | \ +// RUN: FileCheck --check-prefix=CHECK-ERROR2 %s + +// CHECK-ERROR2: error: version '

[clang] [Driver] Check the environment version except wasm case. (PR #80783)

2024-02-06 Thread Fangrui Song via cfe-commits
@@ -14,3 +14,18 @@ // RUN: FileCheck --check-prefix=CHECK-TARGET %s MaskRay wrote: Sorry, I didn't see the `[clang/test/Driver/invalid-version.cpp](https://github.com/llvm/llvm-project/pull/80783/files#diff-6c20c1f9b36f569382ab3c9daebb660db0eb8666af4beaf59813

[clang] [clang] Add zero-initialization for fixed point types (PR #80781)

2024-02-06 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/80781 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add fbasic-block-sections support for AArch64 (PR #80916)

2024-02-07 Thread Fangrui Song via cfe-commits
MaskRay wrote: Perhaps `[Driver] Allow -fbasic-block-sections for ELF AArch64' https://github.com/llvm/llvm-project/pull/80916 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Allow -fbasic-block-sections for AArch64 ELF (PR #80916)

2024-02-07 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/80916 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][clang][Driver] Specify options for with -save-temps= (PR #80921)

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

[clang] [NFC][clang][Driver] Specify options for with -save-temps= (PR #80921)

2024-02-07 Thread Fangrui Song via cfe-commits
@@ -5392,7 +5392,9 @@ def regcall4 : Flag<["-"], "regcall4">, Group, MarshallingInfoFlag>; def save_temps_EQ : Joined<["-", "--"], "save-temps=">, Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>, - HelpText<"Save intermediate compilatio

[clang] [NFC][clang][Driver] Specify options for with -save-temps= (PR #80921)

2024-02-07 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/80921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Driver] Improve error when a compiler-rt library is not found (PR #81037)

2024-02-07 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/81037 BSD/Linux/OS390x enable `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` by default. When a compiler-rt library is not found, we currently report an incorrect filename `libclang_rt.XXX-$arch.a` ``` % /tmp/Debug/bin/clang++ a.

[clang] [llvm] [Driver] Improve error when a compiler-rt library is not found (PR #81037)

2024-02-07 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/81037 >From e276cf4e52fd6328860bb31d73d2bb1b6a11c45d Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 7 Feb 2024 12:56:05 -0800 Subject: [PATCH] [Driver] Improve error when a compiler-rt library is not found BS

[clang] [Driver] Remove "-android" from compiler-rt library names for legacy LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=off (PR #81044)

2024-02-07 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/81044 https://reviews.llvm.org/D7187 (2015) changed a compiler-rt library name from `libclang_rt.builtins-arm.a` to `libclang_rt.builtins-arm-android.a`. LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=on was since then added (https

[clang] [llvm] MIPS/clang: Fix asm constraint for softfloat (PR #79116)

2024-02-07 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -triple mips -target-feature +soft-float -DSOFT_FLOAT_NO_CONSTRAINT_F -fsyntax-only -verify %s + +#ifdef SOFT_FLOAT_NO_CONSTRAINT_F +void read_float(float* p) { MaskRay wrote: Can just use argument `float p`? https://github.c

[clang] [llvm] MIPS/clang: Fix asm constraint for softfloat (PR #79116)

2024-02-07 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,25 @@ +; RUN: llc -march=mips < %s | FileCheck %s --check-prefix=MIPS32 +; RUN: llc -march=mips64 < %s | FileCheck %s --check-prefix=MIPS64 + +define dso_local void @read_double(double* nocapture noundef readonly %0) local_unnamed_addr #0 { MaskRay w

[clang] [NFC] Refactor fast-math handling for clang driver (PR #81173)

2024-02-08 Thread Fangrui Song via cfe-commits
@@ -3061,22 +3080,7 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D, continue; [[fallthrough]]; MaskRay wrote: Should fallthrough still be used? https://github.com/llvm/llvm-project/pull/81173 _

[clang] [llvm] [clang][driver] Set TLSDESC as the default for Android on RISC-V (PR #81198)

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

[clang] [llvm] [clang][driver] Set TLSDESC as the default for Android on RISC-V (PR #81198)

2024-02-08 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. LGTM once the `!isAndroidVersionLT(29)` check is removed. https://github.com/llvm/llvm-project/pull/81198 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [llvm] [clang][driver] Set TLSDESC as the default for Android on RISC-V (PR #81198)

2024-02-08 Thread Fangrui Song via cfe-commits
@@ -3,6 +3,11 @@ // RUN: %clang -### --target=riscv64-linux %s 2>&1 | FileCheck --check-prefix=NODESC %s // RUN: %clang -### --target=x86_64-linux -mtls-dialect=gnu %s 2>&1 | FileCheck --check-prefix=NODESC %s +/// Android supports TLSDESC by default after Android version 29

[clang] [clang][sema] Fix -Wunused-function on target_version'd file-scope Fn's (PR #81167)

2024-02-08 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/81167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Support per-function [[clang::code_align(N)]] attribute. (PR #80765)

2024-02-09 Thread Fangrui Song via cfe-commits
MaskRay wrote: > > Aligning the targets of branches is a different thing from what you've > > implemented. There are basic blocks which are not branch targets, and there > > are branch targets which are not at the beginning of a basic block. (Branch > > targets that aren't at the beginning of

[clang] [Sema] Warn unused functions for FMV based on the target attribute (PR #81302)

2024-02-09 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/81302 The spurious -Wunused-function warning issue for `target_version` #80227 also applied to `__attribute__((target(...)))` based FMV. #81167 removed warnings for all `target`-based FMV. This patch restores the warnin

[clang] [NFC][clang][Driver] Specify options for with -save-temps= (PR #80921)

2024-02-09 Thread Fangrui Song via cfe-commits
@@ -5392,7 +5392,9 @@ def regcall4 : Flag<["-"], "regcall4">, Group, MarshallingInfoFlag>; def save_temps_EQ : Joined<["-", "--"], "save-temps=">, Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>, - HelpText<"Save intermediate compilatio

[clang] [Sema] Warn unused functions for FMV based on the target attribute (PR #81302)

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

[clang] [Driver] Unify InstalledDir and Dir (PR #80527)

2024-02-09 Thread Fangrui Song via cfe-commits
MaskRay wrote: Ping:) @ldionne I know you are discussing a `-isysroot` related issue (don't recall which one off my head) for Apple platforms. I think unifying InstalledDir and Dir will help. https://github.com/llvm/llvm-project/pull/80527 ___ cfe-c

[clang] [NFC] Refactor fast-math handling for clang driver (PR #81173)

2024-02-09 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/81173 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 9397d23 - [docs] --save-temps=: add single quotes after #80921 and update --save-temps

2024-02-09 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2024-02-09T14:26:49-08:00 New Revision: 9397d23671f26ab8631e90f688ae2ea212f3c770 URL: https://github.com/llvm/llvm-project/commit/9397d23671f26ab8631e90f688ae2ea212f3c770 DIFF: https://github.com/llvm/llvm-project/commit/9397d23671f26ab8631e90f688ae2ea212f3c770.diff

[clang] [llvm] LLVM] Add `__builtin_readfixedtimer` intrinsic and buiiltin for realtime clocks (PR #81331)

2024-02-09 Thread Fangrui Song via cfe-commits
MaskRay wrote: Looks good. > LLVM] Add Missing `[`? https://github.com/llvm/llvm-project/pull/81331 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Emit atomic IR in place of optimized libcalls. (PR #73176)

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

[clang] fb48fd1 - [Driver, test] Fix hlsl-lang-targets.hlsl after #78655

2024-02-12 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2024-02-12T10:05:22-08:00 New Revision: fb48fd18c240574841378defacadff34238089bb URL: https://github.com/llvm/llvm-project/commit/fb48fd18c240574841378defacadff34238089bb DIFF: https://github.com/llvm/llvm-project/commit/fb48fd18c240574841378defacadff34238089bb.diff

[clang] [Driver] Remove "-android" from compiler-rt library names for legacy LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=off (PR #81044)

2024-02-12 Thread Fangrui Song via cfe-commits
MaskRay wrote: Thanks for the response, so it seems that we need to keep this for a while. https://github.com/llvm/llvm-project/pull/81044 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [flang] [flang][Driver] Add -masm option to flang (PR #81490)

2024-02-12 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,13 @@ +// RUN: %flang -target x86_64-unknown-linux -masm=intel -S %s -### 2>&1 | FileCheck --check-prefix=CHECK-INTEL %s MaskRay wrote: `--target=` for new tests https://github.com/llvm/llvm-project/pull/81490

[clang] 9df7189 - [test] Replace aarch64-*-{eabi, gnueabi} with aarch64

2024-02-12 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2024-02-12T15:00:45-08:00 New Revision: 9df71899bd5dbbaf0640c74cc82a6330dc7760cf URL: https://github.com/llvm/llvm-project/commit/9df71899bd5dbbaf0640c74cc82a6330dc7760cf DIFF: https://github.com/llvm/llvm-project/commit/9df71899bd5dbbaf0640c74cc82a6330dc7760cf.diff

[clang] [RISCV] Add canonical ISA string as Module metadata in IR. (PR #80760)

2024-02-12 Thread Fangrui Song via cfe-commits
MaskRay wrote: I share a similar concern about not addressing the issue in a target-specific manner. However, I know a lot of confused users by the behavior, and this patch will significantly improve the status quo. I concur with asb's analysis. https://github.com/llvm/llvm-project/pull/80760

[clang] [RISCV] Add canonical ISA string as Module metadata in IR. (PR #80760)

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

<    4   5   6   7   8   9   10   11   12   13   >