[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

[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. +// RUN: %clang -### -Xclangas -target-feature -Xclangas +v5t %s 2>&1 | \ MaskRay wrote: change one arg to use `-Xclangas=` https://github.com/llvm/llvm-project/pull/100714 _

[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 edited https://github.com/llvm/llvm-project/pull/100714 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm] Add triples for managarm (PR #87845)

2025-04-17 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. The patch mixes the following changes * Triple * llvm/lib/Support/Unix * clang/lib/Driver I think we need 3 PRs. The Triple and Support code looks good. I will have limited internet access between April 20th and May 4th, and my response t

[clang] [llvm] [llvm] Add triples for managarm (PR #87845)

2025-04-17 Thread Fangrui Song via cfe-commits
@@ -395,6 +395,36 @@ class LLVM_LIBRARY_VISIBILITY LinuxTargetInfo : public OSTargetInfo { } }; +// Managarm Target +template +class LLVM_LIBRARY_VISIBILITY ManagarmTargetInfo : public OSTargetInfo { +protected: + void getOSDefines(const LangOptions &Opts, const llvm::Tr

[clang] [llvm] [llvm] Add triples for managarm (PR #87845)

2025-04-17 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,227 @@ +//===--- Managarm.h - Managarm ToolChain Implementations *- C++ -*-===// MaskRay wrote: For new files, just use `//===--===//` per latest https://llvm.org/docs/Coding

[clang] [llvm] [llvm] Add triples for managarm (PR #87845)

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

[clang] [llvm] [Mips] Implement MipsInstrInfo::getNop() operation (PR #135524)

2025-04-17 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,13 @@ +// REQUIRES: mips-registered-target MaskRay wrote: `clang++ -target "mipsel-w64-windows-gnu" -c test.cpp` avoid deprecated `-target `. Use `--target=` https://github.com/llvm/llvm-project/pull/135524 ___

[clang] [llvm] [Mips] Implement MipsInstrInfo::getNop() operation (PR #135524)

2025-04-17 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,13 @@ +// REQUIRES: mips-registered-target MaskRay wrote: https://maskray.me/blog/2021-08-08-toolchain-testing#the-test-checks-too-little#the-test-checks-at-the-wrong-layer Should generally avoid clang/test/CodeGen test for lib/Target changes. llvm/t

[clang] Make the `-disable-free` flag more full featured (PR #136213)

2025-04-17 Thread Fangrui Song via cfe-commits
MaskRay wrote: You might want to change the `DisableFree` default for library uses so that users don't need to specify `-no-disable-free`. ``` // Clang calls BuryPointer on the internal AST and CodeGen-related elements like TargetMachine. // This will cause memory leaks if `compile` is exe

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

2025-04-16 Thread Fangrui Song via cfe-commits
@@ -1755,6 +1755,18 @@ Compilation *Driver::BuildCompilation(ArrayRef ArgList) { << TC.getTriple().str(); } + // Throw diagnosis if mcmodel=tiny option is passed for targets other than ARM + // or AArch64. + if (Arg *A = UArgs->getLastArg(options::OPT_mcmodel_EQ)

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

2025-04-16 Thread Fangrui Song via cfe-commits
@@ -1755,6 +1755,18 @@ Compilation *Driver::BuildCompilation(ArrayRef ArgList) { << TC.getTriple().str(); } + // Throw diagnosis if mcmodel=tiny option is passed for targets other than ARM + // or AArch64. + if (Arg *A = UArgs->getLastArg(options::OPT_mcmodel_EQ)

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

2025-04-16 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/118026 ___ 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-04-15 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay requested changes to this pull request. We typically add such incompatibility check in clang/lib/Driver instead of clang/lib/Frontend. (Apologies, I will have limited internet access between April 20th and May 4th, and my response time may be delayed.. Happy if a reg

[libunwind] Update LIBUNWIND_ENABLE_WERROR default value in BuildingLibunwind.rst (PR #135546)

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

[libunwind] Update LIBUNWIND_ENABLE_WERROR default value in BuildingLibunwind.rst (PR #135546)

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

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

2025-04-11 Thread Fangrui Song via cfe-commits
MaskRay wrote: I don't, but I wonder what's the GCC behavior. It seems to suppress the diagnostic when processing a .i file. https://github.com/llvm/llvm-project/pull/134621 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [llvm] MCAsmStreamer: Replace the MCInstPrinter * parameter with unique_ptr (PR #135128)

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

[clang] [llvm] MCAsmStreamer: Replace the MCInstPrinter * parameter with unique_ptr (PR #135128)

2025-04-10 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/135128 >From f6d368f889acb08443e9cc425d1d8aab4d05bfef Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 9 Apr 2025 21:24:40 -0700 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UTF

[clang] [llvm] MCAsmStreamer: Replace the MCInstPrinter * parameter with unique_ptr (PR #135128)

2025-04-10 Thread Fangrui Song via cfe-commits
MaskRay wrote: > Thanks for improving code health! :-) > > LGTM but I'm not familiar with this area of LLVM nor a code owner, so I'll > defer to the code owners. > > Nit: this patch does a few drive-by fixes (deletes the createAsmStreamer > variant with three bools; rename to createSystemZAsm

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

2025-04-10 Thread Fangrui Song via cfe-commits
MaskRay wrote: I am not sure clang driver should does this unusual suppression. You'd also get a warning with: `clang test.c -E -Wall -pedantic; clang test.i -S -Wall -pedantic` There might be a different strategy to suppress this diagnostic? https://github.com/llvm/llvm-project/pull/134621

[clang] [llvm] MCAsmStreamer: Replace the MCInstPrinter * parameter with unique_ptr (PR #135128)

2025-04-10 Thread Fangrui Song via cfe-commits
@@ -541,8 +542,8 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts, // FIXME: There is a bit of code duplication with addPassesToEmitFile. if (Opts.OutputType == AssemblerInvocation::FT_Asm) { -MCInstPrinter *IP = TheTarget->createMCInstPrinter( -ll

[clang] [llvm] MCAsmStreamer: Replace the MCInstPrinter * parameter with unique_ptr (PR #135128)

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

[clang] [llvm] MCAsmStreamer: Replace the MCInstPrinter * parameter with unique_ptr (PR #135128)

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

[clang] [flang] [driver] Generalize the code that adds the path of libflang_rt.runtime.a. (PR #134362)

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

[clang] [flang] [driver] Generalize the code that adds the path of libflang_rt.runtime.a. (PR #134362)

2025-04-08 Thread Fangrui Song via cfe-commits
@@ -7,35 +7,106 @@ !! LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON, use !! resource_dir_with_per_target_subdir as inputs. -! Check powerpc64-ibm-aix 64-bit linking to static flang-rt +! Check powerpc64-ibm-aix 64-bit linking to static flang-rt by default ! RUN: %flang %s -### 2>&1

[clang] [flang] [driver] Generalize the code that adds the path of libflang_rt.runtime.a. (PR #134362)

2025-04-08 Thread Fangrui Song via cfe-commits
@@ -7,35 +7,106 @@ !! LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON, use !! resource_dir_with_per_target_subdir as inputs. -! Check powerpc64-ibm-aix 64-bit linking to static flang-rt +! Check powerpc64-ibm-aix 64-bit linking to static flang-rt by default ! RUN: %flang %s -### 2>&1

[clang] [flang] [driver] Generalize the code that adds the path of libflang_rt.runtime.a. (PR #134362)

2025-04-08 Thread Fangrui Song via cfe-commits
@@ -850,6 +852,21 @@ void ToolChain::addFortranRuntimeLibraryPath(const llvm::opt::ArgList &Args, CmdArgs.push_back(Args.MakeArgString("-L" + DefaultLibPath)); } +void ToolChain::addFlangRTLibPath(const ArgList &Args, + llvm::opt::ArgStrin

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

2025-04-05 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] [Driver] Add linker options to support statical linking to shared flang-rt on AIX. (PR #131822)

2025-04-05 Thread Fangrui Song via cfe-commits
@@ -127,9 +127,19 @@ void aix::Linker::ConstructJob(Compilation &C, const JobAction &JA, } MaskRay wrote: This change needs a test somewhere at flang/test/Driver/ https://github.com/llvm/llvm-project/pull/131822 __

[clang] [llvm] [OpenEmbedded] Fix include and lib paths for multilib targets (PR #121302)

2025-04-05 Thread Fangrui Song via cfe-commits
MaskRay wrote: > I [tried > asking](https://lists.openembedded.org/g/openembedded-core/topic/gcc_library_directory_and/111849200) > about this on the OpenEmbedded mailing list. The response was that it has > been this way for so long that it's going to be a major undertaking to change > it ev

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

2025-04-04 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] [driver] Generalize the code that adds the path of libflang_rt.runtime.a. (PR #134362)

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

[clang] [flang] [driver] Generalize the code that adds the path of libflang_rt.runtime.a. (PR #134362)

2025-04-04 Thread Fangrui Song via cfe-commits
@@ -2,7 +2,7 @@ ! 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,UNIX,UNIX-F128NONE +! RUN: %f

[clang] [AArch64] Remove strict checks from init-aarch64.c (PR #134338)

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

[clang] [AArch64] Remove strict checks from init-aarch64.c (PR #134338)

2025-04-04 Thread Fangrui Song via cfe-commits
MaskRay wrote: The -NEXT unexpected macros. Please address this by modifying your downstream target. This is a downstream maintenance task, and it's important to avoid reducing the quality of upstream testing. https://github.com/llvm/llvm-project/pull/134338 ___

[clang] [Clang][CodeGen] Respect -fwrapv-pointer when emitting struct GEPs (PR #134269)

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

[clang] [Clang][CodeGen] Respect -fwrapv-pointer when emitting struct GEPs (PR #134269)

2025-04-03 Thread Fangrui Song via cfe-commits
MaskRay wrote: Looks good to me, but please allow some time for other reviewers to weigh in. https://github.com/llvm/llvm-project/pull/134269 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

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

2025-04-02 Thread Fangrui Song via cfe-commits
@@ -3148,6 +3158,7 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D, ComplexArithmeticStr(RangeVal)); } } + LastComplexRangeOption = "-fcomplex-arithmetic"; MaskRay wrote: `Arg:

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

2025-04-02 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][Driver] Override complex number calculation method by -fno-fa… (PR #132680)

2025-04-01 Thread Fangrui Song via cfe-commits
@@ -177,14 +177,83 @@ // RUN: %clang -### -target x86_64 -ffast-math -fcomplex-arithmetic=basic -c %s 2>&1 \ // RUN: | FileCheck --check-prefix=BASIC %s -// BASIC: -complex-range=basic -// FULL: -complex-range=full -// PRMTD: -complex-range=promoted -// BASIC-NOT: -complex-

[clang] [flang] [llvm] [flang-rt] Pass the whole path of libflang_rt.runtime.a to linker on AIX (PR #131041)

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

[clang] [flang] [llvm] [flang-rt] Pass the whole path of libflang_rt.runtime.a to linker on AIX (PR #131041)

2025-04-01 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. LGTM. Next time it would be safer to make the `IsFortran` argument change a separate PR... https://github.com/llvm/llvm-project/pull/131041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [flang] [llvm] [flang-rt] Pass the whole path of libflang_rt.runtime.a to linker on AIX (PR #131041)

2025-04-01 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,38 @@ +!! Testing ld command with flang on POWERPC. + +!! Because flang-rt currently only supports +!! LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON, use +!! resource_dir_with_per_target_subdir as inputs. + +! Check powerpc64-ibm-aix 64-bit linking to static flang-rt +! RUN: %

[clang] [flang] [llvm] [flang-rt] Pass the whole path of libflang_rt.runtime.a to linker on AIX (PR #131041)

2025-04-01 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/131041 ___ 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-04-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] [Clang] Check PP presence when printing stats (PR #131608)

2025-03-29 Thread Fangrui Song via cfe-commits
MaskRay wrote: LGTM! Thanks for the fix https://github.com/llvm/llvm-project/pull/131608 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Support alternative sections for patchable function entries (PR #131230)

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

[clang] [HIP] Claim `--offload-compress` for `-M` (PR #133456)

2025-03-29 Thread Fangrui Song via cfe-commits
@@ -242,3 +242,9 @@ // NO-WARN-ATOMIC: clang{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-Werror=atomic-alignment" {{.*}} "-Wno-error=atomic-alignment" // NO-WARN-ATOMIC-NOT: clang{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-Werror=atomic-alignment" // NO-WARN-ATOMIC-

[clang] [Driver] Enable LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON on AIX. (PR #132821)

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

[clang] [Driver] Search for compiler-rt libraries in sysroot/lib if not found in the resource directory (PR #132443)

2025-03-24 Thread Fangrui Song via cfe-commits
MaskRay wrote: NAK. (LibraryPaths is primarily intended for compiler-rt libraries.) Maintaining compatibility by itself isn’t sufficient, as each entry could subtly shift library selection precedence, and the code here reflects a certain level of upstream (llvm-project) preference. We should

[clang] [Driver] Search for compiler-rt libraries in sysroot/lib if not found in the resource directory (PR #132443)

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

[clang] [compiler-rt] Reland [Coverage] Fix region termination for GNU statement expressions (PR #132222)

2025-03-20 Thread Fangrui Song via cfe-commits
@@ -346,6 +346,12 @@ int elsecondnoret(void) { return 0; } +// CHECK-LABEL: _Z18statementexprnoretb MaskRay wrote: `_Z18statementexprnoretb:` https://github.com/llvm/llvm-project/pull/13 ___ cfe-commits maili

[clang] [compiler-rt] Reland [Coverage] Fix region termination for GNU statement expressions (PR #132222)

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

[clang] [llvm] [flang-rt] Pass the whole path of libflang_rt.runtime.a to linker on AIX (PR #131041)

2025-03-17 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay commented: Haven't read all comments. But the PR now changes many files, and there is a noticeable change to clang/lib/Driver/ToolChains/PPCLinux.cpp . However, the description hasn't been updated. https://github.com/llvm/llvm-project/pull/131041

  1   2   3   4   5   6   7   8   9   10   >