[clang] [RISCV] Add -march=unset to cancel and ignore a previous -march. (PR #148321)

2025-07-12 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. Thanks! The reactions include a thumbs-up and a love. Setting my approval. https://github.com/llvm/llvm-project/pull/148321 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [RISCV] Add -march=unset to cancel and ignore a previous -march. (PR #148321)

2025-07-12 Thread Fangrui Song via cfe-commits
@@ -403,6 +403,11 @@ // MCPU-MARCH: "-nostdsysteminc" "-target-cpu" "sifive-e31" "-target-feature" "+m" "-target-feature" "+c" // MCPU-MARCH: "-target-abi" "ilp32" +// march=unset erases previous march MaskRay wrote: `/// -march=unset erases previous -march`

[clang] [llvm] [DTLTO][Clang] Add support for Integrated Distributed ThinLTO (PR #147265)

2025-07-12 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,43 @@ +// REQUIRES: lld + +/// Check DTLTO options are forwarded to the linker. + +// RUN: echo "--target=x86_64-linux-gnu \ +// RUN: -Xthinlto-distributor=distarg1 \ +// RUN: -Xthinlto-distributor=distarg2,distarg3 \ +// RUN: -fuse-ld=lld" > %t.rsp + +/// Check t

[clang] [LTO] Add unified LTO tests for the PS targets. (PR #148229)

2025-07-11 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang -flto=thin --target=x86_64-scei-ps4 -O2 -c %s -o %t.ps4.tu -Xclang -fdebug-pass-manager 2>%t.ps4.tu.txt MaskRay wrote: unified-lto-pipeline.c is present and serves the purpose. For target-generic codegen features, we usually tes

[clang] [WIP][DO NOT MERGE][Clang][Driver] Emit warning when -fsanitize-trap=<...> is passed without associated -fsanitize=<...> (PR #147997)

2025-07-11 Thread Fangrui Song via cfe-commits
MaskRay wrote: Thank you for your efforts to enhance sanitizers. However, the current implementation aligns with the preferences of many, including GCC contributors who introduced -fsanitize-trap in 2022. Gaining consensus to modify -fsanitize-trap to issue warnings or errors seems unlikely, s

[clang] [RISCV] Add -march=unset to cancel and ignore a previous -march. (PR #148321)

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

[clang] [RISCV] Add -march=unset to cancel and ignore a previous -march. (PR #148321)

2025-07-11 Thread Fangrui Song via cfe-commits
@@ -403,6 +403,11 @@ // MCPU-MARCH: "-nostdsysteminc" "-target-cpu" "sifive-e31" "-target-feature" "+m" "-target-feature" "+c" // MCPU-MARCH: "-target-abi" "ilp32" +// march=unset erases previous march +// RUN: %clang --target=riscv32 -### -c %s 2>&1 -march=rv32imc -march=uns

[clang] [RISCV] Add -march=unset to cancel and ignore a previous -march. (PR #148321)

2025-07-11 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay commented: Thanks for implementing -mcpu=unset. This looks good. I'm glad to see -mcpu=unset gaining support, especially after feeling like the lone voice in the GCC thread: https://gcc.gnu.org/pipermail/gcc-patches/2025-June/685537.html https://github.com/llvm/llvm-

[clang] [Clang][Driver] Emit warning when -fsanitize-trap=<...> is passed without associated -fsanitize=<...> (PR #147997)

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

[clang] [Clang][Driver] Emit warning when -fsanitize-trap=<...> is passed without associated -fsanitize=<...> (PR #147997)

2025-07-10 Thread Fangrui Song via cfe-commits
MaskRay wrote: The current -fsanitize-trap behavior is intentional. See https://discourse.llvm.org/t/clang-gsoc-2025-usability-improvements-for-trapping-undefined-behavior-sanitizer/84568/11 I believe Google actually depended on -fsanitize-trap=undefined not leading to warnings/errors when -fs

[clang] [llvm] [PseudoProbe] Support emitting to COFF object (PR #123870)

2025-07-09 Thread Fangrui Song via cfe-commits
@@ -12,7 +12,7 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target triple = "x86_64-unknown--" MaskRay wrote: Yes, they can be omitted in the IR. https://github.com/llvm/llvm-project/pull/12387

[clang] Add necessary linker flags when -static-pie is enabled in BareMetal Toolchain (PR #147589)

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

[clang] [Clang][Driver][SamplePGO] Enable -fsample-profile-use-profi by default (PR #146795)

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

[libunwind] [libunwind] Add CMake option to enable execute-only code generation on AArch64 (PR #140554)

2025-07-04 Thread Fangrui Song via cfe-commits
=?utf-8?q?Csanád_Hajdú?= , =?utf-8?q?Csanád_Hajdú?= Message-ID: In-Reply-To: @@ -16,6 +16,8 @@ #if defined(_AIX) .toc +#elif defined(__aarch64__) && defined(__ELF__) && defined(_LIBUNWIND_EXECUTE_ONLY_CODE) MaskRay wrote: `defined(__ELF__)` seems unnece

[clang] [Clang][Driver][SamplePGO] Enable -fsample-profile-use-profi by default (PR #146795)

2025-07-02 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay commented: Driver change looks reasonable if samplepgo maintainers decide to proceed. https://github.com/llvm/llvm-project/pull/146795 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [llvm] [AVR] Handle flash RO data mapped to data space for newer devices (PR #146244)

2025-07-02 Thread Fangrui Song via cfe-commits
@@ -651,8 +651,19 @@ void AVR::Linker::ConstructJob(Compilation &C, const JobAction &JA, // This is almost always required because otherwise avr-ld // will assume 'avr2' and warn about the program being larger // than the bare minimum supports. - if (Linker.find("avr-ld

[clang] [llvm] [AVR] Handle flash RO data mapped to data space for newer devices (PR #146244)

2025-07-02 Thread Fangrui Song via cfe-commits
@@ -263,11 +263,17 @@ bool AVRAsmPrinter::doFinalization(Module &M) { auto *Section = cast(TLOF.SectionForGlobal(&GO, TM)); if (Section->getName().starts_with(".data")) NeedsCopyData = true; -else if (Section->getName().starts_with(".rodata") && SubTM->hasLPM(

[clang] [llvm] [AVR] Handle flash RO data mapped to data space for newer devices (PR #146244)

2025-07-02 Thread Fangrui Song via cfe-commits
@@ -263,11 +263,17 @@ bool AVRAsmPrinter::doFinalization(Module &M) { auto *Section = cast(TLOF.SectionForGlobal(&GO, TM)); if (Section->getName().starts_with(".data")) NeedsCopyData = true; -else if (Section->getName().starts_with(".rodata") && SubTM->hasLPM(

[clang] [llvm] [AVR] Handle flash RO data mapped to data space for newer devices (PR #146244)

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

[clang] [llvm] [AVR] Handle flash RO data mapped to data space for newer devices (PR #146244)

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

[clang] [llvm] Driver: Avoid llvm::sys::path::append if resource directory absolute. (PR #146449)

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

[clang] [llvm] Remove Native Client support (PR #133661)

2025-06-30 Thread Fangrui Song via cfe-commits
MaskRay wrote: > > Thanks for working on this! This will be the first time I'm not going to > > oppose an effort to remove Native Client support 🎉 Although I am going to > > ask you to wait a couple of months to land it, until we finally turn it off > > for good and start deleting the support

[clang] [llvm] Triple: Forward declare Twine and remove include (PR #145685)

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

[clang] [llvm] Triple: Forward declare Twine and remove include (PR #145685)

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

[clang] [llvm] Triple: Forward declare Twine and remove include (PR #145685)

2025-06-25 Thread Fangrui Song via cfe-commits
@@ -349,7 +350,12 @@ class Triple { /// triple fields unknown. Triple() = default; + LLVM_ABI explicit Triple(std::string &&Str); + explicit Triple(StringRef Str) : Triple(Str.str()) {} + explicit Triple(const char *Str) : Triple(std::string(Str)) {} + explicit Triple(

[clang] [PAC][clang] Add new features to pauthtest ABI (PR #113150)

2025-06-25 Thread Fangrui Song via cfe-commits
MaskRay wrote: Sorry, I haven't closely followed the AArch64 PAuth work. The Clang driver options should come last in the patch stack, with other patches reviewed first. For driver options, I don't know a bunch of `-fptrauth-*` is a good idea. We had a similar scenario with -mbranches-within-3

[clang] [clang] Add managarm support (PR #139271)

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

[clang] [clang] Add managarm support (PR #139271)

2025-06-14 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,221 @@ +//===--===// +// +// 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][cmake] Don't pass -fno-strict-aliasing for GCC (PR #144222)

2025-06-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. LGTM. Thanks for removing this tech debt. https://github.com/llvm/llvm-project/pull/144222 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [clang][driver] Suppress gnu-line-marker when saving temps (PR #134621)

2025-06-12 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay commented: LGTM! https://github.com/llvm/llvm-project/pull/134621 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement address sanitizer on AIX (PR #129925)

2025-06-12 Thread Fangrui Song via cfe-commits
@@ -1635,8 +1656,13 @@ bool tools::addSanitizerRuntimes(const ToolChain &TC, const ArgList &Args, } // If there is a static runtime with no dynamic list, force all the symbols // to be dynamic to be sure we export sanitizer interface functions. - if (AddExportDynamic) -

[clang] [Clang] Add check for -mstack-alignment (PR #143124)

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

[clang] [llvm] [PowerPC] frontend get target feature from backend with cpu name (PR #137670)

2025-06-11 Thread Fangrui Song via cfe-commits
@@ -18,6 +18,53 @@ using namespace llvm; using namespace AMDGPU; +/// Find KV in array using binary search. +static const BasicSubtargetSubTypeKV * +Find(StringRef S, ArrayRef A) { MaskRay wrote: `find` (functionName in new code) https://github.com/llvm/llvm

[clang] [llvm] [PowerPC] frontend get target feature from backend with cpu name (PR #137670)

2025-06-11 Thread Fangrui Song via cfe-commits
@@ -18,6 +18,53 @@ using namespace llvm; using namespace AMDGPU; +/// Find KV in array using binary search. +static const BasicSubtargetSubTypeKV * +Find(StringRef S, ArrayRef A) { + // Binary search the array + auto F = llvm::lower_bound(A, S); + // If not found then retur

[clang] Reland: "[Frontend][PCH]-Add support for ignoring PCH options (-ignore-pch). (#142409)" (PR #143614)

2025-06-10 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,19 @@ +// RUN: rm -rf %t +// RUN: mkdir -p %t + +// Create PCH without -ignore-pch. +// RUN: %clang -x c++-header %S/../Modules/Inputs/codegen-flags/foo.h -### 2>&1 | FileCheck %s -check-prefix=CHECK-EMIT-PCH MaskRay wrote: `%S/../` references auxilia

[libunwind] [libunwind] Don't override LINKER_LANGUAGE (PR #143533)

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

[clang] [Clang] Support constexpr asm at global scope. (PR #143268)

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

[clang] [llvm] [AArch64] Add support for -mlong-calls code generation (PR #142982)

2025-06-05 Thread Fangrui Song via cfe-commits
MaskRay wrote: -mlong-calls is an old-fashioned compiler option. I think it was added before linkers knew range extension thunks (aka stubs, veneers, etc). Can you use -fno-plt instead? It works with both SelectionDAG and GlobalISel. You will get GOT-generating code sequence that can be optimi

[clang] [llvm] Add -funique-source-file-identifier flag. (PR #142901)

2025-06-04 Thread Fangrui Song via cfe-commits
MaskRay wrote: Should call this "option". Within LLVM, we use flag for options without a value. https://github.com/llvm/llvm-project/pull/142901 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang] [llvm] [PowerPC] frontend get target feature from backend with cpu name (PR #137670)

2025-06-03 Thread Fangrui Song via cfe-commits
@@ -16,6 +16,7 @@ #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" +#include "llvm/MC/MCSubtargetInfo.h" MaskRay wrote: @diggerlin This is blocking and should be addressed before landing. https://github.com/llvm/llvm-project/pull/137670 __

[clang] [llvm] [ARM, AArch64] Don't put BTI at asm goto branch targets (PR #141562)

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

[clang] [clang][docs] Add docs for CCC_OVERRIDE_OPTIONS. (PR #142396)

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

[clang] [llvm] Remove Native Client support (PR #133661)

2025-06-01 Thread Fangrui Song via cfe-commits
MaskRay wrote: > Thanks for working on this! This will be the first time I'm not going to > oppose an effort to remove Native Client support 🎉 Although I am going to ask > you to wait a couple of months to land it, until we finally turn it off for > good and start deleting the support code fro

[clang] [flang] [flang][driver] Introduce FCC_OVERRIDE_OPTIONS. (PR #140556)

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

[clang] [flang] [flang][driver] Introduce FCC_OVERRIDE_OPTIONS. (PR #140556)

2025-05-31 Thread Fangrui Song via cfe-commits
@@ -614,3 +614,30 @@ nvfortran defines `-fast` as - `-Mcache_align`: there is no equivalent flag in Flang or Clang. - `-Mflushz`: flush-to-zero mode - when `-ffast-math` is specified, Flang will link to `crtfastmath.o` to ensure denormal numbers are flushed to zero. + + +#

[clang] [flang] [flang][driver] Introduce FCC_OVERRIDE_OPTIONS. (PR #140556)

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

[clang] [flang] [flang][driver] Introduce FCC_OVERRIDE_OPTIONS. (PR #140556)

2025-05-31 Thread Fangrui Song via cfe-commits
@@ -614,3 +614,30 @@ nvfortran defines `-fast` as - `-Mcache_align`: there is no equivalent flag in Flang or Clang. - `-Mflushz`: flush-to-zero mode - when `-ffast-math` is specified, Flang will link to `crtfastmath.o` to ensure denormal numbers are flushed to zero. + + +#

[clang] [Clang][Driver] Override complex number calculation method by -fno-fast-math (PR #132680)

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

[clang] [flang] [flang][driver] Introduce FCC_OVERRIDE_OPTIONS. (PR #140556)

2025-05-29 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,12 @@ +! RUN: env FCC_OVERRIDE_OPTIONS="#+-Os +-Oz +-O +-O3 +-Oignore +a +b +c xb Xa Omagic ^-### " %flang -target x86_64-unknown-linux-gnu %s -O2 b -O3 2>&1 | FileCheck %s MaskRay wrote: `--target=x86_64-unknown-linux-gnu` instead of the long depre

[clang] [flang] [flang][driver] Introduce FCC_OVERRIDE_OPTIONS. (PR #140556)

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

[clang] [flang] [flang][driver] Introduce FCC_OVERRIDE_OPTIONS. (PR #140556)

2025-05-29 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay commented: clang driver code looks good https://github.com/llvm/llvm-project/pull/140556 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Driver] Override complex number calculation method by -fno-fast-math (PR #132680)

2025-05-29 Thread Fangrui Song via cfe-commits
MaskRay wrote: > Thank you for confirming. > > @MaskRay, do you have any comments regarding the handling of warning messages? Sorry for the delayed response. Does this implement the last-option-win behavior as suggested in the last few comments of https://discourse.llvm.org/t/the-priority-of

[clang] [Clang][Driver] Override complex number calculation method by -fno-fast-math (PR #132680)

2025-05-29 Thread Fangrui Song via cfe-commits
@@ -2997,6 +2997,7 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D, LangOptions::ComplexRangeKind Range = LangOptions::ComplexRangeKind::CX_None; std::string ComplexRangeStr = ""; std::string GccRangeComplexOption = ""; + std::string LastC

[clang] [clang][docs] Remove reference to deleted line in sanitizer doc (PR #141921)

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

[clang] Check for unsupported target options even with -Qunused-arguments (PR #141698)

2025-05-27 Thread Fangrui Song via cfe-commits
@@ -27,3 +27,10 @@ // RUN: not %clang --target=x86_64 -### -mhtm -lc %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=UNSUP_OPT // UNSUP_OPT: error: unsupported option + + +// RUN: not %clang -c --target=aarch64-- -mfpu=crypto-neon-fp-armv8 %s 2>&1 | \ +// RUN: FileCheck %s --c

[clang] Check for unsupported target options even with -Qunused-arguments (PR #141698)

2025-05-27 Thread Fangrui Song via cfe-commits
@@ -27,3 +27,10 @@ // RUN: not %clang --target=x86_64 -### -mhtm -lc %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=UNSUP_OPT // UNSUP_OPT: error: unsupported option + + +// RUN: not %clang -c --target=aarch64-- -mfpu=crypto-neon-fp-armv8 %s 2>&1 | \ MaskRay

[clang] Check for unsupported target options even with -Qunused-arguments (PR #141698)

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

[clang] [llvm] Arm64EC entry/exit thunks, consolidated. (PR #79067)

2025-05-25 Thread Fangrui Song via cfe-commits
@@ -44,7 +44,11 @@ define void @varargs_caller() nounwind { ; CHECK-NEXT:stp xzr, x30, [sp, #24] // 8-byte Folded Spill ; CHECK-NEXT:stp x9, x8, [sp] ; CHECK-NEXT:str xzr, [sp, #16] -; CHECK-NEXT:bl varargs_callee +; CHECK-NEXT:.weak_anti_dep varargs_callee

[clang] [Driver][LTO] Move common code for LTO to addLTOOptions() (PR #74178)

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

[clang] [Driver][X86] Add -m[no-]apxf to m_x86_Features_Group (PR #140874)

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

[clang] [llvm] [RISCV] Add MC layer support for XSfmm*. (PR #133031)

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

[clang] [llvm] [RISCV] Add MC layer support for XSfmm*. (PR #133031)

2025-05-20 Thread Fangrui Song via cfe-commits
@@ -2331,6 +2337,65 @@ bool RISCVAsmParser::generateVTypeError(SMLoc ErrorLoc) { "e[8|16|32|64],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]"); } +ParseStatus RISCVAsmParser::parseXSfmmVType(OperandVector &Operands) { + SMLoc S = getLoc(); + + unsigned Widen = 0; + unsigned SE

[clang] [llvm] [CMake] Add a linker test for -Bsymbolic-functions to AddLLVM (PR #79539)

2025-05-18 Thread Fangrui Song via cfe-commits
@@ -355,6 +349,9 @@ function(add_link_opts target_name) set_property(TARGET ${target_name} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-brtl") endif() + + check_linker_flag(CXX "-Wl,-Bsymbolic-functions" MaskRay wrote: @mati865 This might b

[clang] [llvm] [CMake] Add a linker test for -Bsymbolic-functions to AddLLVM (PR #79539)

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

[clang] [llvm] [CMake] Add a linker test for -Bsymbolic-functions to AddLLVM (PR #79539)

2025-05-15 Thread Fangrui Song via cfe-commits
@@ -355,6 +349,9 @@ function(add_link_opts target_name) set_property(TARGET ${target_name} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-brtl") endif() + + check_linker_flag(CXX "-Wl,-Bsymbolic-functions" MaskRay wrote: While I am aware of h

[clang] [llvm] [CMake] Add a linker test for -Bsymbolic-functions to AddLLVM (PR #79539)

2025-05-14 Thread Fangrui Song via cfe-commits
@@ -355,6 +349,9 @@ function(add_link_opts target_name) set_property(TARGET ${target_name} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-brtl") endif() + + check_linker_flag(CXX "-Wl,-Bsymbolic-functions" MaskRay wrote: Add a comment what ta

[clang] [clang] Enforce 1-based indexing for command line source locations (PR #139457)

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

[clang] [clang] Enforce 1-based indexing for command line source locations (PR #139457)

2025-05-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. LGTM with a few nits. Please give other reviewers some time to chime in https://github.com/llvm/llvm-project/pull/139457 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [clang] Enforce 1-based indexing for command line source locations (PR #139457)

2025-05-14 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,19 @@ +// Related to #139457 +// Clang uses 1-based indexing for source locations given from the command-line. +// Verify that `clang-refactor` rejects 0 as an invalid value for line or column number. + +// For range start: +// RUN: not clang-refactor local-rename -se

[clang] [clang] Enforce 1-based indexing for command line source locations (PR #139457)

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

[clang] [clang] Enforce 1-based indexing for command line source locations (PR #139457)

2025-05-14 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,12 @@ +// Related to #139375 MaskRay wrote: I don't why some regression tests are named `crash-*`, but I would not name this `crash-*`. I'd just name this source-loc-zero.cpp and change this comment to `// Regression test for #139375` https://githu

[clang] [clang] Enforce 1-based indexing for command line source locations (PR #139457)

2025-05-14 Thread Fangrui Song via cfe-commits
@@ -89,8 +92,13 @@ struct ParsedSourceRange { // probably belongs to the filename which menas the whole // string should be parsed. RangeSplit.first = Str; - } else + } else { +// Column and line numbers are 1-based Mas

[clang] [Driver] Use StringRef::substr instead of StringRef::slice (NFC) (PR #139455)

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

[clang] [clang] Add managarm support (PR #139271)

2025-05-10 Thread Fangrui Song via cfe-commits
MaskRay wrote: You might want to test two configurations to ensure that -rtlib= -stdlib= -unwindlib= defaults do not make the new test fail. * default * -DCLANG_DEFAULT_RTLIB=compiler-rt -DCLANG_DEFAULT_UNWINDLIB=libunwind -DCLANG_DEFAULT_CXX_STDLIB=libc++ https://github.com/llvm/llvm-projec

[clang] [clang] Add managarm support (PR #139271)

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

[clang] [clang] Add managarm support (PR #139271)

2025-05-10 Thread Fangrui Song via cfe-commits
@@ -1622,6 +1622,11 @@ // RUN: %clang_cc1 -x c -std=c99 -E -dM -ffreestanding -triple=amd64-unknown-openbsd < /dev/null | FileCheck -match-full-lines -check-prefix OPENBSD-STDC-N %s // OPENBSD-STDC-N-NOT:#define __STDC_NO_THREADS__ 1 // +// RUN: %clang_cc1 -triple=aarch64-unk

[clang] [clang] Add managarm support (PR #139271)

2025-05-10 Thread Fangrui Song via cfe-commits
@@ -228,6 +228,8 @@ static const char *getLDMOption(const llvm::Triple &T, const ArgList &Args) { return "elf_iamcu"; return "elf_i386"; case llvm::Triple::aarch64: +if (T.isOSManagarm()) + return "aarch64managarm"; MaskRay wrote: Is this

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2025-05-10 Thread Fangrui Song via cfe-commits
MaskRay wrote: Since the option has been renamed to `-fextend-variable-liveness`, I think you want to edit this title and the description to reflect the naming change as well. I wanted to check the status the effort and I tried `git log --grep fextend-lifetimes` but found nothing, then I reali

[clang] [llvm] [Driver] Reject -mcmodel=tiny on X86 (PR #125643)

2025-05-07 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/125643 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Driver] Reject -mcmodel=tiny on X86 (PR #125643)

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

[clang] [llvm] [Driver] Reject -mcmodel=tiny on X86 (PR #125643)

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

[clang] [Clang] [Driver] add a Cygwin ToolChain (PR #135691)

2025-05-06 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,109 @@ +//===--- Cygwin.cpp - Cygwin ToolChain Implementations --*- C++ -*-===// MaskRay wrote: In new code, can remove the comments per the updated https://llvm.org/docs/CodingStandards.html#file-headers https://github.com/llvm/llvm-project

[clang] [Clang] [Driver] add a Cygwin ToolChain (PR #135691)

2025-05-06 Thread Fangrui Song via cfe-commits
@@ -2632,6 +2632,27 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( return; } + if (TargetTriple.isWindowsCygwinEnvironment()) { +static const char *const CygwinX86Triples[] = {"i686-pc-cygwin", +

[clang] [Clang] [Driver] add a Cygwin ToolChain (PR #135691)

2025-05-06 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay commented: LGTM. But I hope folks more familiar with Windows can take a look. Can you describe the support triples in the description and state why we need the msys ones? (Wow, MSYS and Cygwin... familiar names! I used them back in 2009, but then I made the switch to

[clang] [Clang] [Driver] add a Cygwin ToolChain (PR #135691)

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

[clang] [llvm] [ARM] Adding diagnostics for mcmodel=tiny when used in invalid targets (PR #125643)

2025-05-05 Thread Fangrui Song via cfe-commits
@@ -391,6 +391,7 @@ Improvements to Clang's diagnostics - An error is now emitted when a ``musttail`` call is made to a function marked with the ``not_tail_called`` attribute. (#GH133509). +- The ``-mcmodel=tiny`` option will now be diagnosed on all targets other than ARM o

[clang] [clang] Implement address sanitizer on AIX (1/6) (PR #129925)

2025-05-05 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay commented: clang/test/Driver/Inputs/resource_dir/lib/aix/libclang_rt.asan-powerpc.a is the old runtime path. Does $triple/libclang_rt.asan.a work? If yes, the new hierarchy is preferred https://github.com/llvm/llvm-project/pull/129925 _

[clang] [clang] Implement address sanitizer on AIX (1/6) (PR #129925)

2025-05-05 Thread Fangrui Song via cfe-commits
@@ -256,6 +256,8 @@ def err_drv_malformed_sanitizer_metadata_ignorelist : Error< "malformed sanitizer metadata ignorelist: '%0'">; def err_drv_unsupported_static_sanitizer_darwin : Error< MaskRay wrote: Rename this one to `err_drv_unsupported_static_sanitizer

[clang] [clang][Driver][test] Fix Driver/solaris-ld.c on non-Unix hosts (PR #138466)

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

[clang] [clang][Driver][test] Fix Driver/solaris-ld.c on non-Unix hosts (PR #138466)

2025-05-04 Thread Fangrui Song via cfe-commits
MaskRay wrote: It's not due to non-Unix hosts. It's likely due to these builds setting CLANG_DEFAULT_RTLIB and CLANG_DEFAULT_UNWINDLIB. https://github.com/llvm/llvm-project/pull/138466 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

[clang] [lld] [llvm] [X86][APX] Suppress EGPR/NDD instructions for relocations (PR #136660)

2025-04-29 Thread Fangrui Song via cfe-commits
MaskRay wrote: We should avoid introducing a new cmake config for changes like this. You could utilize clang config file to specify the option. lld change should have been separated https://github.com/llvm/llvm-project/pull/136660 ___ cfe-commits ma

[clang] [Driver] Fix _XOPEN_SOURCE definition on Solaris (PR #137141)

2025-04-26 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. (I have limited internet access between April 20th and May 4th, and my response time may be delayed..) https://github.com/llvm/llvm-project/pull/137141 ___ cfe-commits mailing list cfe-commits@li

[clang] [clang][Driver] Support passing arbitrary args to `-cc1as` with `-Xclangas`. (PR #100714)

2025-04-18 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. LGTM! (I will have limited internet access between April 20th and May 4th, and my response time may be delayed..) https://github.com/llvm/llvm-project/pull/100714 ___ cfe-commits mailing list cf

[clang] [clang][driver] Suppress gnu-line-marker when saving temps (PR #134621)

2025-04-18 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -std=c99 -fsyntax-only -pedantic %s 2>&1 | grep 'warning: this style of line directive is a GNU extension' MaskRay wrote: We prefer `FileCheck` to `grep`. FileCheck enables testing the line number, e.g. ``` // CHECK: [[#@LINE

[clang] [clang][Driver] Support passing arbitrary args to `-cc1as` with `-Xclangas`. (PR #100714)

2025-04-18 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,6 @@ +/// Check that -Xclangas/-Xclangas= are passed to -cc1as. +// RUN: %clang -### -Xclangas -target-feature -Xclangas=+v5t %s 2>&1 | \ MaskRay wrote: Also add a `-Werror` to test `Arg->claim();`. I haven't tested, but without `Arg->claim();` there

[clang] [clang][Driver] Support passing arbitrary args to `-cc1as` with `-Xclangas`. (PR #100714)

2025-04-18 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,6 @@ +/// Check that -Xclangas/-Xclangas= are passed to -cc1as. +// RUN: %clang -### -Xclangas -target-feature -Xclangas=+v5t %s 2>&1 | \ +// RUN: FileCheck -check-prefix=ARGS %s +// ARGS: -cc1as +// ARGS: -target-feature MaskRay wrote: Use `-SAME:`

[clang] [clang][Driver] Support passing arbitrary args to `-cc1as` with `-Xclangas`. (PR #100714)

2025-04-18 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,6 @@ +/// Check that -Xclangas/-Xclangas= are passed to -cc1as. +// RUN: %clang -### -Xclangas -target-feature -Xclangas=+v5t %s 2>&1 | \ +// RUN: FileCheck -check-prefix=ARGS %s MaskRay wrote: unnecessary to use a custom check prefix. Just omit it a

[clang] [clang][Driver] Support passing arbitrary args to -cc1as with -Xclangas. (PR #100714)

2025-04-18 Thread Fangrui Song via cfe-commits
MaskRay wrote: > This is one of the ideas I gave in > https://github.com/llvm/llvm-project/issues/97517. I opted to propose this > one first as introducing a new -Xclangas option comes with no concerns about > GCC compatibility as with -Xassembler. Please update the description/commit messag

[clang] [clang][Driver] Support passing arbitrary args to -cc1as with -Xclangas. (PR #100714)

2025-04-18 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,6 @@ +// Check that -Xclangas passes args to -cc1as. MaskRay wrote: `/// ` for non-RUN non-CHECK comments to make them stand out https://github.com/llvm/llvm-project/pull/100714 ___ cfe-commits mailing list

[clang] [clang][Driver] Support passing arbitrary args to -cc1as with -Xclangas. (PR #100714)

2025-04-18 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. (I will have limited internet access between April 20th and May 4th, and my response time may be delayed..) https://github.com/llvm/llvm-project/pull/100714 ___ cfe-commits mailing list cfe-commi

  1   2   3   4   5   6   7   8   9   10   >