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

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

[clang] Added removal of file extension when guessing the toolchain (PR #69887)

2023-11-05 Thread Fangrui Song via cfe-commits
MaskRay wrote: In quite a few places we only detect `.exe` as the extension name. I am not sure we should commit to arbitrary extension name now. The build systems can consider `--driver-mode=cl` https://github.com/llvm/llvm-project/pull/69887 ___ cf

[clang] [StackProtector] Do not emit the stack protector on GPU architectures (PR #70799)

2023-11-05 Thread Fangrui Song via cfe-commits
MaskRay wrote: I think this is fine, but we probably should think about the general option compatibility problem https://github.com/llvm/llvm-project/pull/70740#issuecomment-1786180822 https://github.com/llvm/llvm-project/pull/70799 ___ cfe-commits m

[clang] [clang] Do not pass -canonical-system-headers on Windows by default (PR #71097)

2023-11-05 Thread Fangrui Song via cfe-commits
@@ -1180,8 +1180,19 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA, if (ArgM->getOption().matches(options::OPT_M) || ArgM->getOption().matches(options::OPT_MD)) CmdArgs.push_back("-sys-header-deps"); + + // #70011: Canonicaliz

[clang] [clang] Do not pass -canonical-system-headers on Windows by default (PR #71097)

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

[clang] [clang] Do not pass -canonical-system-headers on Windows by default (PR #71097)

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

[clang] [clang] Do not pass -canonical-system-headers on Windows by default (PR #71097)

2023-11-05 Thread Fangrui Song via cfe-commits
@@ -1,3 +1,6 @@ +// REQUIRES: !system-windows MaskRay wrote: `UNSUPPORTED: system-windows` https://github.com/llvm/llvm-project/pull/71097 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [clang] Allow MCTargetOptions to be parseable by -mllvm. (PR #66347)

2023-11-05 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay requested changes to this pull request. Agree that the motivation should be communicated. Driver options have stronger stability guarantee. If there are sufficient motivation and useful MCTargetOptions that we don't feel comfortable exposing driver options, I think t

[clang] [Driver][LTO] Copy fix empty stats filename to AVR, FreeBSD, Fuchsia (PR #71359)

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

[clang] [Preprocessor] Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 for AArch64 (PR #74954)

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

[clang] [clang] Use StringRef::{starts,ends}_with (NFC) (PR #75149)

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

[clang] [DebugInfo] Fix duplicate DIFile when main file is preprocessed (PR #75022)

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

[llvm] [clang] Disable PGO instrumentation on naked function (PR #75224)

2023-12-12 Thread Fangrui Song via cfe-commits
@@ -1783,6 +1783,8 @@ static bool skipPGOUse(const Function &F) { static bool skipPGOGen(const Function &F) { if (skipPGOUse(F)) return true; + if (F.hasFnAttribute(llvm::Attribute::Naked)) MaskRay wrote: Makes sense. Similar to https://reviews.llvm.org

[llvm] [clang] Disable PGO instrumentation on naked function (PR #75224)

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

[clang] [llvm] Disable PGO instrumentation on naked function (PR #75224)

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

[clang] [llvm] Disable PGO instrumentation on naked function (PR #75224)

2023-12-12 Thread Fangrui Song via cfe-commits
@@ -892,6 +892,10 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy, } } + if (FD->hasAttr()) { MaskRay wrote: This should not be needed. The llvm change is sufficient to work with all frontends including clang. https://github.com

[clang-tools-extra] [clang] [llvm] [llvm-objcopy] Add --gap-fill and --pad-to options (PR #65815)

2023-12-12 Thread Fangrui Song via cfe-commits
@@ -738,6 +739,36 @@ objcopy::parseObjcopyOptions(ArrayRef RawArgsArr, if (auto Arg = InputArgs.getLastArg(OBJCOPY_extract_partition)) Config.ExtractPartition = Arg->getValue(); + if (const auto *A = InputArgs.getLastArg(OBJCOPY_gap_fill)) { +if (Config.OutputForma

[clang] [llvm] [clang-tools-extra] [llvm-objcopy] Add --gap-fill and --pad-to options (PR #65815)

2023-12-12 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,198 @@ +# RUN: yaml2obj --docnum=1 %s -o %t + +# RUN: not llvm-objcopy --gap-fill 1 %t 2>&1 | FileCheck %s --check-prefix=NOT-BINARY +# NOT-BINARY: error: '--gap-fill' is only supported for binary output + +# RUN: not llvm-objcopy -O binary --gap-fill= %t %t.bin 2>&1 |

[libunwind] [libunwind] Replace process_vm_readv with pipe (PR #74791)

2023-12-12 Thread Fangrui Song via cfe-commits
@@ -2700,19 +2701,18 @@ bool UnwindCursor::setInfoForSigReturn(Registers_arm64 &) { // [1] https://github.com/torvalds/linux/blob/master/arch/arm64/kernel/vdso/sigreturn.S const pint_t pc = static_cast(this->getReg(UNW_REG_IP)); // The PC might contain an invalid address

[clang] [Sema] atomic_compare_exchange: check failure memory order (PR #74959)

2023-12-12 Thread Fangrui Song via cfe-commits
MaskRay wrote: @jyknight If this looks good, mind changing the status from "request changes"? :) https://github.com/llvm/llvm-project/pull/74959 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [Sema] atomic_compare_exchange: check failure memory order (PR #74959)

2023-12-12 Thread Fangrui Song via cfe-commits
MaskRay wrote: > Did this change anything for the `scoped_atomic_compare_exchange_n` variant I > added recently? I am not familiar with the scoped atomic xchg stuff, but this patch needs to update one `__hip_atomic_compare_exchange_weak` test: ``` flag = __hip_atomic_compare_exchange_weak(pt

[clang] [clang] Add per-global code model attribute (PR #72078)

2023-12-12 Thread Fangrui Song via cfe-commits
@@ -3408,6 +3408,8 @@ def warn_objc_redundant_literal_use : Warning< def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", " "\"local-dynamic\", \"initial-exec\" or \"local-exec\"">; +def err_attr_codemodel_arg : Error<"code_model '%0' is not yet supported

[clang] [clang] Add per-global code model attribute (PR #72078)

2023-12-12 Thread Fangrui Song via cfe-commits
MaskRay wrote: Add @erichkeane for the attribute change. https://github.com/llvm/llvm-project/pull/72078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] atomic_compare_exchange: check failure memory order (PR #74959)

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

[mlir] [clang] [clang-tools-extra] [llvm] Make clang report garbage target versions. (PR #75373)

2023-12-14 Thread Fangrui Song via cfe-commits
MaskRay wrote: In addition, calling `exit` from library code is probably not good. The error can be surfaced by a very top-level component (e.g. driver as @zmodem mentioned). https://github.com/llvm/llvm-project/pull/75373 ___ cfe-commits mailing lis

[llvm] [clang] [AArch64] Disable large global group relocation (PR #75445)

2023-12-14 Thread Fangrui Song via cfe-commits
MaskRay wrote: Perhaps the subject should be changed to RFC now as it's not ready for merge. I have a longer reply at https://discourse.llvm.org/t/patch-to-disable-group-relocation-in-aarch64-large-code-model/75666/2 https://github.com/llvm/llvm-project/pull/75445 _

[clang] 57f42a8 - Revert "[clang] Substitute alias templates from correct context (#75069)"

2023-12-14 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2023-12-14T14:57:15-08:00 New Revision: 57f42a8765cd3d878be4fb59ad44c85f8a7ca223 URL: https://github.com/llvm/llvm-project/commit/57f42a8765cd3d878be4fb59ad44c85f8a7ca223 DIFF: https://github.com/llvm/llvm-project/commit/57f42a8765cd3d878be4fb59ad44c85f8a7ca223.diff

[clang] ce1faec - [Serialization] Fix -Wpessimizing-move after 9cdb825a4f1bf9e75829d03879620c6144d0b7bc

2023-12-14 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2023-12-14T19:40:09-08:00 New Revision: ce1faec3ad15780f6336ac83047aac6eacd16772 URL: https://github.com/llvm/llvm-project/commit/ce1faec3ad15780f6336ac83047aac6eacd16772 DIFF: https://github.com/llvm/llvm-project/commit/ce1faec3ad15780f6336ac83047aac6eacd16772.diff

[clang] [llvm] [Instrumentation][X86] Limit setting large section flag to medium/large code models (PR #75542)

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

[clang] [Driver] Add -fandroid-pad-segment/-fno-android-pad-segment (PR #75652)

2023-12-15 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/75652 -fandroid-pad-segment is an Android-specific opt-in option that links in crt_pad_segment.o. crt_pad_segment.o contains a note section, which will be included in the linker-created PT_NOTE segment. This PT_NOTE te

[clang] [Driver] Add -fandroid-pad-segment/-fno-android-pad-segment (PR #75652)

2023-12-15 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/75652 >From 964f9b98b389060e554e52e3c286255b4a25a7bb Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Fri, 15 Dec 2023 11:16:37 -0800 Subject: [PATCH] [Driver] Add -fandroid-pad-segment/-fno-android-pad-segment -fand

[clang] 9950bb9 - [ASTReader] Fix readability-inconsistent-declaration-parameter-name. NFC

2023-12-15 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2023-12-15T17:11:21-08:00 New Revision: 9950bb994461d6dc67ac9b33e48f549edcb44739 URL: https://github.com/llvm/llvm-project/commit/9950bb994461d6dc67ac9b33e48f549edcb44739 DIFF: https://github.com/llvm/llvm-project/commit/9950bb994461d6dc67ac9b33e48f549edcb44739.diff

[clang] [llvm] [LTO] Improve diagnostics handling when parsing module-level inline assembly (PR #75726)

2023-12-16 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/75726 Non-LTO compiles set the buffer name to "" (`AsmPrinter::addInlineAsmDiagBuffer`) and pass diagnostics to `ClangDiagnosticHandler` (through the `MCContext` handler in `MachineModuleInfoWrapperPass::doInitializatio

[llvm] [lld] [clang] [LTO] Improve diagnostics handling when parsing module-level inline assembly (PR #75726)

2023-12-17 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/75726 >From 4e5fb8b8c7f39935dce2a11bd90fc27f65cd2d76 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 10 Dec 2023 10:13:59 -0800 Subject: [PATCH 1/2] [LTO] Improve diagnostics handling when parsing module-level

[lld] [llvm] [clang] [LTO] Improve diagnostics handling when parsing module-level inline assembly (PR #75726)

2023-12-17 Thread Fangrui Song via cfe-commits
MaskRay wrote: > `MachO/lto-module-asm-err.ll` needs update? Thanks for the reminder. Updated in 09f2f27972d75886085bdd790533d154c01984d4 https://github.com/llvm/llvm-project/pull/75726 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [lld] [llvm] [LTO] Improve diagnostics handling when parsing module-level inline assembly (PR #75726)

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

[clang-tools-extra] [llvm] [RISCV] Support Global Dynamic TLSDESC in the RISC-V backend (PR #66915)

2023-12-18 Thread Fangrui Song via cfe-commits
@@ -6843,6 +6845,24 @@ SDValue RISCVTargetLowering::getDynamicTLSAddr(GlobalAddressSDNode *N, return LowerCallTo(CLI).first; } +SDValue +RISCVTargetLowering::getGeneralDynamicTLSDescAddr(GlobalAddressSDNode *N, MaskRay wrote: `GeneralDynamicTLSDesc` in the

[clang-tools-extra] [llvm] [RISCV] Support Global Dynamic TLSDESC in the RISC-V backend (PR #66915)

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

[clang] Add tests for driver to propagate module map flags even without -fmod… (PR #75827)

2023-12-18 Thread Fangrui Song via cfe-commits
@@ -57,6 +57,14 @@ // CHECK-MODULE-MAP-FILES: "-fmodule-map-file=foo.map" // CHECK-MODULE-MAP-FILES: "-fmodule-map-file=bar.map" +// RUN: %clang -fno-modules -fmodule-name=foo -c -### %s 2>&1 | FileCheck -check-prefix=CHECK-PROPAGATE-MODULE-NAME %s MaskRay wr

[clang] Add tests for driver to propagate module map flags even without -fmod… (PR #75827)

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

[clang] Add tests for driver to propagate module map flags even without -fmod… (PR #75827)

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

[llvm] [clang-tools-extra] [RISCV] Support Global Dynamic TLSDESC in the RISC-V backend (PR #66915)

2023-12-18 Thread Fangrui Song via cfe-commits
@@ -6843,6 +6845,24 @@ SDValue RISCVTargetLowering::getDynamicTLSAddr(GlobalAddressSDNode *N, return LowerCallTo(CLI).first; } +SDValue +RISCVTargetLowering::getGeneralDynamicTLSDescAddr(GlobalAddressSDNode *N, MaskRay wrote: getTLSDescAddr sounds good. h

[libunwind] [llvm] [clang-tools-extra] [clang] [libunwind] Replace process_vm_readv with SYS_rt_sigprocmask (PR #74791)

2023-12-18 Thread Fangrui Song via cfe-commits
@@ -2762,18 +2757,17 @@ int UnwindCursor::stepThroughSigReturn(Registers_arm64 &) { template bool UnwindCursor::setInfoForSigReturn(Registers_riscv &) { const pint_t pc = static_cast(getReg(UNW_REG_IP)); - uint32_t instructions[2]; - struct iovec local_iov = {&instructions

[libunwind] [llvm] [clang-tools-extra] [clang] [libunwind] Replace process_vm_readv with SYS_rt_sigprocmask (PR #74791)

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

[libunwind] [llvm] [clang-tools-extra] [clang] [libunwind] Replace process_vm_readv with SYS_rt_sigprocmask (PR #74791)

2023-12-18 Thread Fangrui Song via cfe-commits
@@ -2822,13 +2816,11 @@ bool UnwindCursor::setInfoForSigReturn(Registers_s390x &) { // onto the stack. const pint_t pc = static_cast(this->getReg(UNW_REG_IP)); // The PC might contain an invalid address if the unwind info is bad, so - // directly accessing it could cause

[clang-tools-extra] [libunwind] [llvm] [clang] [libunwind] Replace process_vm_readv with SYS_rt_sigprocmask (PR #74791)

2023-12-18 Thread Fangrui Song via cfe-commits
@@ -2974,6 +2966,39 @@ bool UnwindCursor::getFunctionName(char *buf, size_t bufLen, buf, bufLen, offset); } +#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) +template +bool UnwindCursor::isReadableAddr(const pint_t addr) const { + // T

[clang] [llvm] [clang-tools-extra] [libunwind] [libunwind] Replace process_vm_readv with SYS_rt_sigprocmask (PR #74791)

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

[clang-tools-extra] [libunwind] [llvm] [clang] [libunwind] Replace process_vm_readv with SYS_rt_sigprocmask (PR #74791)

2023-12-18 Thread Fangrui Song via cfe-commits
@@ -2974,6 +2966,39 @@ bool UnwindCursor::getFunctionName(char *buf, size_t bufLen, buf, bufLen, offset); } +#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) +template +bool UnwindCursor::isReadableAddr(const pint_t addr) const { + // T

[clang-tools-extra] [libunwind] [llvm] [clang] [libunwind] Replace process_vm_readv with SYS_rt_sigprocmask (PR #74791)

2023-12-18 Thread Fangrui Song via cfe-commits
@@ -2974,6 +2966,39 @@ bool UnwindCursor::getFunctionName(char *buf, size_t bufLen, buf, bufLen, offset); } +#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) +template +bool UnwindCursor::isReadableAddr(const pint_t addr) const { + // T

[clang] [libunwind] [clang-tools-extra] [llvm] [libunwind] Replace process_vm_readv with SYS_rt_sigprocmask (PR #74791)

2023-12-18 Thread Fangrui Song via cfe-commits
@@ -2974,6 +2966,39 @@ bool UnwindCursor::getFunctionName(char *buf, size_t bufLen, buf, bufLen, offset); } +#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) +template +bool UnwindCursor::isReadableAddr(const pint_t addr) const { + // T

[llvm] [clang] DiagnosticHandler: refactor error checking (PR #75889)

2023-12-18 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/75889 In LLVMContext::diagnose, set `HasErrors` for `DS_Error` so that all derived `DiagnosticHandler` have correct `HasErrors` information. An alternative is to set `HasErrors` in `DiagnosticHandler::handleDiagnostics

[llvm] [clang] DiagnosticHandler: refactor error checking (PR #75889)

2023-12-18 Thread Fangrui Song via cfe-commits
@@ -256,10 +256,13 @@ void LLVMContext::diagnose(const DiagnosticInfo &DI) { RS->emit(*OptDiagBase); // If there is a report handler, use it. - if (pImpl->DiagHandler && - (!pImpl->RespectDiagnosticFilters || isDiagnosticEnabled(DI)) && - pImpl->DiagHandler-

[lld] [llvm] [clang] [LTO] Improve diagnostics handling when parsing module-level inline assembly (PR #75726)

2023-12-18 Thread Fangrui Song via cfe-commits
@@ -418,6 +418,8 @@ void BackendConsumer::anchor() { } } // namespace clang bool ClangDiagnosticHandler::handleDiagnostics(const DiagnosticInfo &DI) { + if (DI.getSeverity() == DS_Error) +HasErrors = true; MaskRay wrote: I created https://github.com/llvm

[clang] [llvm] DiagnosticHandler: refactor error checking (PR #75889)

2023-12-19 Thread Fangrui Song via cfe-commits
@@ -256,10 +256,13 @@ void LLVMContext::diagnose(const DiagnosticInfo &DI) { RS->emit(*OptDiagBase); // If there is a report handler, use it. - if (pImpl->DiagHandler && - (!pImpl->RespectDiagnosticFilters || isDiagnosticEnabled(DI)) && - pImpl->DiagHandler-

[clang] [llvm] DiagnosticHandler: refactor error checking (PR #75889)

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

[clang] [llvm] DiagnosticHandler: refactor error checking (PR #75889)

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

[llvm] [clang] DiagnosticHandler: refactor error checking (PR #75889)

2023-12-19 Thread Fangrui Song via cfe-commits
@@ -256,10 +256,13 @@ void LLVMContext::diagnose(const DiagnosticInfo &DI) { RS->emit(*OptDiagBase); // If there is a report handler, use it. - if (pImpl->DiagHandler && - (!pImpl->RespectDiagnosticFilters || isDiagnosticEnabled(DI)) && - pImpl->DiagHandler-

[clang] Add tests for driver to propagate module map flags even without -fmod… (PR #75827)

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

[clang] Add tests for driver to propagate module map flags even without -fmod… (PR #75827)

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

[clang] Add tests for driver to propagate module map flags even without -fmod… (PR #75827)

2023-12-19 Thread Fangrui Song via cfe-commits
@@ -57,6 +57,14 @@ // CHECK-MODULE-MAP-FILES: "-fmodule-map-file=foo.map" // CHECK-MODULE-MAP-FILES: "-fmodule-map-file=bar.map" +// RUN: %clang -fno-modules -fmodule-name=foo -c -### %s 2>&1 | FileCheck -check-prefix=CHECK-PROPAGATE-MODULE-NAME %s MaskRay wr

[clang] [llvm] DiagnosticHandler: refactor error checking (PR #75889)

2023-12-19 Thread Fangrui Song via cfe-commits
@@ -256,10 +256,13 @@ void LLVMContext::diagnose(const DiagnosticInfo &DI) { RS->emit(*OptDiagBase); // If there is a report handler, use it. - if (pImpl->DiagHandler && - (!pImpl->RespectDiagnosticFilters || isDiagnosticEnabled(DI)) && - pImpl->DiagHandler-

[clang-tools-extra] [clang] [libunwind] [llvm] [libunwind] Replace process_vm_readv with SYS_rt_sigprocmask (PR #74791)

2023-12-19 Thread Fangrui Song via cfe-commits
@@ -2974,6 +2966,39 @@ bool UnwindCursor::getFunctionName(char *buf, size_t bufLen, buf, bufLen, offset); } +#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) +template +bool UnwindCursor::isReadableAddr(const pint_t addr) const { + // T

[clang-tools-extra] [clang] [libunwind] [llvm] [libunwind] Replace process_vm_readv with SYS_rt_sigprocmask (PR #74791)

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

[libunwind] [libunwind] Bump to CXX_STANDARD 17 (PR #75986)

2023-12-19 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/75986 libunwind uses C-style and low-level C++, so the language standard doesn't matter that much, but bumping to C++17 aligns with the rest of LLVM and enables some features that would cause pedantic warnings in C++11

[libunwind] [libunwind] Bump to CXX_STANDARD 17 (PR #75986)

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

[clang] [llvm] DiagnosticHandler: refactor error checking (PR #75889)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[clang] [Driver][LTO] Copy fix empty stats filename to AMDGPU, HIPAMD, MinGW (PR #74178)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

2023-12-01 Thread Fangrui Song via cfe-commits
MaskRay wrote: Perhaps `nostdlib.c` since nostdlib encompasses nodefaultlibs/nostartfiles. However, if we need another test for a `-no*` style option that is less related to `-nostdlib`, reusing `nostdlib.c` maybe slightly strange. https://github.com/llvm/llv

[clang] [Sema] Add -Wc++11-narrowing-const-reference (PR #76094)

2023-12-20 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/76094 https://github.com/llvm/llvm-project/pull/75332 diagnosed narrowing involving const reference. Our depot has hundreds if not thousands of breakages (https://github.com/llvm/llvm-project/pull/75332#issuecomment-186

[clang] [Sema] Add -Wc++11-narrowing-const-reference (PR #76094)

2023-12-20 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/76094 >From cea507db33bc1fe376b4a75c5ff96225a4e0e67e Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 20 Dec 2023 10:57:15 -0800 Subject: [PATCH] [Sema] Add -Wc++11-narrowing-const-reference https://github.com/l

[clang] [Sema] Add -Wc++11-narrowing-const-reference (PR #76094)

2023-12-20 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/76094 >From 132a5293a89d15d3e38c768727723157427f49db Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 20 Dec 2023 10:57:15 -0800 Subject: [PATCH] [Sema] Add -Wc++11-narrowing-const-reference https://github.com/l

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