[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)

2025-01-15 Thread Nick Desaulniers via cfe-commits
@@ -1060,236 +1061,355 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } -const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset( -ASTContext &Ctx, const

[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)

2025-01-15 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers edited https://github.com/llvm/llvm-project/pull/122198 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)

2025-01-15 Thread Nick Desaulniers via cfe-commits
@@ -1060,236 +1061,355 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } -const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset( -ASTContext &Ctx, const

[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)

2025-01-15 Thread Nick Desaulniers via cfe-commits
@@ -1060,236 +1061,355 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } -const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset( -ASTContext &Ctx, const

[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)

2025-01-15 Thread Nick Desaulniers via cfe-commits
@@ -1060,236 +1061,355 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } -const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset( -ASTContext &Ctx, const

[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)

2025-01-15 Thread Nick Desaulniers via cfe-commits
@@ -1060,236 +1061,355 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } -const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset( -ASTContext &Ctx, const

[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)

2025-01-15 Thread Nick Desaulniers via cfe-commits
@@ -1060,236 +1061,355 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } -const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset( -ASTContext &Ctx, const

[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)

2025-01-15 Thread Nick Desaulniers via cfe-commits
@@ -1060,238 +1061,348 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } -const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset( -ASTContext &Ctx, const

[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)

2025-01-15 Thread Nick Desaulniers via cfe-commits
@@ -1060,238 +1061,348 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } -const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset( -ASTContext &Ctx, const

[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)

2025-01-15 Thread Nick Desaulniers via cfe-commits
@@ -1060,238 +1061,348 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } -const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset( -ASTContext &Ctx, const

[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)

2025-01-15 Thread Nick Desaulniers via cfe-commits
@@ -1060,238 +1061,348 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } -const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset( -ASTContext &Ctx, const

[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)

2025-01-15 Thread Nick Desaulniers via cfe-commits
@@ -1060,238 +1061,348 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } -const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset( -ASTContext &Ctx, const

[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)

2025-01-15 Thread Nick Desaulniers via cfe-commits
@@ -1060,238 +1061,348 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } -const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset( -ASTContext &Ctx, const

[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)

2025-01-15 Thread Nick Desaulniers via cfe-commits
@@ -1060,238 +1061,348 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } -const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset( -ASTContext &Ctx, const

[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)

2025-01-14 Thread Nick Desaulniers via cfe-commits
@@ -1060,238 +1061,348 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } -const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset( -ASTContext &Ctx, const

[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)

2025-01-14 Thread Nick Desaulniers via cfe-commits
@@ -1060,238 +1061,348 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } -const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset( -ASTContext &Ctx, const

[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)

2025-01-14 Thread Nick Desaulniers via cfe-commits
@@ -1060,238 +1061,348 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } -const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset( -ASTContext &Ctx, const

[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)

2025-01-14 Thread Nick Desaulniers via cfe-commits
@@ -1060,238 +1061,348 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } -const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset( -ASTContext &Ctx, const

[clang] [libc] [libc] Support baremetal libc on aarch64 (PR #118691)

2024-12-04 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers approved this pull request. https://github.com/llvm/llvm-project/pull/118691 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [libc] remove references to LIBC_HDRGEN_ONLY (PR #118670)

2024-12-04 Thread Nick Desaulniers via cfe-commits
@@ -69,8 +69,8 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype) "-DLLVM_EXTERNAL_${name}_SOURCE_DIR=${LLVM_EXTERNAL_${name}_SOURCE_DIR}") endforeach() - if("libc" IN_LIST LLVM_ENABLE_PROJECTS AND NOT LIBC_HDRGEN_EXE) -set(lib

[clang] [llvm] [libc] remove references to LIBC_HDRGEN_ONLY (PR #118670)

2024-12-04 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers updated https://github.com/llvm/llvm-project/pull/118670 >From ebb64d56b04182104f90783b86cf30e74ab00c3c Mon Sep 17 00:00:00 2001 From: Nick Desaulniers Date: Wed, 4 Dec 2024 09:20:01 -0800 Subject: [PATCH 1/2] [libc] remove references to LIBC_HDRGEN_ONLY Furt

[clang] [llvm] [libc] remove references to LIBC_HDRGEN_ONLY (PR #118670)

2024-12-04 Thread Nick Desaulniers via cfe-commits
@@ -69,8 +69,8 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype) "-DLLVM_EXTERNAL_${name}_SOURCE_DIR=${LLVM_EXTERNAL_${name}_SOURCE_DIR}") endforeach() - if("libc" IN_LIST LLVM_ENABLE_PROJECTS AND NOT LIBC_HDRGEN_EXE) -set(lib

[clang] [llvm] [libc] remove references to LIBC_HDRGEN_ONLY (PR #118670)

2024-12-04 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers created https://github.com/llvm/llvm-project/pull/118670 Further cleanups from old hdrgen removal. I didn't realize there were cmake variables related to old hdrgen spread out throughout more of the source tree. Link: #117220 Link: #117208 >From ebb64d56b041

[clang] [clang][ARM] disable frame pointers by default for bare metal ARM targets (PR #117140)

2024-12-02 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers approved this pull request. https://github.com/llvm/llvm-project/pull/117140 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ARM] disable frame pointers by default for bare metal ARM targets (PR #117140)

2024-11-21 Thread Nick Desaulniers via cfe-commits
@@ -151,6 +152,10 @@ static bool useFramePointerForTargetByDefault(const llvm::opt::ArgList &Args, } } + if (toolchains::isARMBareMetal(Triple)) { +return false; + } nickdesaulniers wrote: https://llvm.org/docs/CodingStandards.html#don-t-use-brac

[clang] [lld] [llvm] Reapply "Deprecate the `-fbasic-block-sections=labels` option." (PR #110039)

2024-11-07 Thread Nick Desaulniers via cfe-commits
nickdesaulniers wrote: Cross referencing this with an LKML thread: https://lore.kernel.org/all/CAF1bQ=TNOs7shXMbgY3UYzDZyF3ge=6hudfejvhv4loo--t...@mail.gmail.com/ https://github.com/llvm/llvm-project/pull/110039 ___ cfe-commits mailing list cfe-commit

[clang] [libunwind] [llvm] Replace documentation mentions of IRC with Discord (PR #114276)

2024-11-07 Thread Nick Desaulniers via cfe-commits
nickdesaulniers wrote: LGTM https://github.com/llvm/llvm-project/pull/114276 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][C++23] Core language changes from P1467R9 extended floating-point types and standard names. (PR #78503)

2024-10-17 Thread Nick Desaulniers via cfe-commits
nickdesaulniers wrote: Hi @codemzs are you still working on this PR? If not, please consider closing it. https://github.com/llvm/llvm-project/pull/78503 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[clang] [clang-tools-extra] [libc] [libc][c11] implement ctime (PR #107285)

2024-09-27 Thread Nick Desaulniers via cfe-commits
=?utf-8?b?0JfQuNGI0LDQvSDQnNC40YDQtw==?=, =?utf-8?b?0JfQuNGI0LDQvSDQnNC40YDQtw==?=, =?utf-8?b?0JfQuNGI0LDQvSDQnNC40YDQtw==?=, =?utf-8?b?0JfQuNGI0LDQvSDQnNC40YDQtw==?=, =?utf-8?b?0JfQuNGI0LDQvSDQnNC40YDQtw==?=, =?utf-8?b?0JfQuNGI0LDQvSDQnNC40YDQtw==?=, =?utf-8?b?0JfQuNGI0LDQvSDQnNC40YDQtw==?=, =?utf

[clang] [Driver] Support using toolchain libc and libc++ for baremetal (PR #96736)

2024-06-26 Thread Nick Desaulniers via cfe-commits
@@ -296,6 +300,47 @@ void BareMetal::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs, return; const Driver &D = getDriver(); + std::string Target = getTripleString(); + + auto AddCXXIncludePath = [&](StringRef Path) { +std::string Version = detectLibcxxVers

[clang] [Driver] Support using toolchain libc and libc++ for baremetal (PR #96736)

2024-06-26 Thread Nick Desaulniers via cfe-commits
@@ -296,6 +300,47 @@ void BareMetal::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs, return; const Driver &D = getDriver(); + std::string Target = getTripleString(); + + auto AddCXXIncludePath = [&](StringRef Path) { +std::string Version = detectLibcxxVers

[clang] [Driver] Support using toolchain libc and libc++ for baremetal (PR #96736)

2024-06-26 Thread Nick Desaulniers via cfe-commits
@@ -296,6 +300,47 @@ void BareMetal::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs, return; const Driver &D = getDriver(); + std::string Target = getTripleString(); + + auto AddCXXIncludePath = [&](StringRef Path) { nickdesaulniers wrote: Is

[clang] [Driver] Support using toolchain libc and libc++ for baremetal (PR #96736)

2024-06-26 Thread Nick Desaulniers via cfe-commits
@@ -296,6 +300,47 @@ void BareMetal::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs, return; const Driver &D = getDriver(); + std::string Target = getTripleString(); + + auto AddCXXIncludePath = [&](StringRef Path) { +std::string Version = detectLibcxxVers

[clang] [Driver] Support using toolchain libc and libc++ for baremetal (PR #96736)

2024-06-26 Thread Nick Desaulniers via cfe-commits
@@ -296,6 +300,47 @@ void BareMetal::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs, return; const Driver &D = getDriver(); + std::string Target = getTripleString(); + + auto AddCXXIncludePath = [&](StringRef Path) { +std::string Version = detectLibcxxVers

[clang] [libc] [llvm] [libc] Implement (v|f)printf on the GPU (PR #96369)

2024-06-25 Thread Nick Desaulniers via cfe-commits
nickdesaulniers wrote: > Do we want some sort of optimization for constant printf? 99% of the time, we > could parse the string at compile-time. (This sort of optimization is common > for embedded targets.) Yes! @michaelrj-google has some ideas. Orthogonal to this PR though. https://github.co

[clang] [llvm] [X86] Support EGPR for inline assembly. (PR #92338)

2024-05-23 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers approved this pull request. someone with more knowledge about EGPR should approve this as well, but I'm happy with the code style for the additions. https://github.com/llvm/llvm-project/pull/92338 ___ cfe-commits mai

[clang] [Clang] [CodeGen] Perform derived-to-base conversion on explicit object parameter in lambda (PR #89828)

2024-05-22 Thread Nick Desaulniers via cfe-commits
@@ -4693,6 +4694,17 @@ LValue CodeGenFunction::EmitLValueForLambdaField(const FieldDecl *Field, else LambdaLV = MakeAddrLValue(AddrOfExplicitObject, D->getType().getNonReferenceType()); + +// Make sure we have an lvalue to the lamb

[clang] [Clang] [CodeGen] Perform derived-to-base conversion on explicit object parameter in lambda (PR #89828)

2024-05-22 Thread Nick Desaulniers via cfe-commits
@@ -4693,6 +4694,17 @@ LValue CodeGenFunction::EmitLValueForLambdaField(const FieldDecl *Field, else LambdaLV = MakeAddrLValue(AddrOfExplicitObject, D->getType().getNonReferenceType()); + +// Make sure we have an lvalue to the lamb

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-22 Thread Nick Desaulniers via cfe-commits
@@ -909,6 +909,24 @@ void PPCAsmPrinter::emitInstruction(const MachineInstr *MI) { // Lower multi-instruction pseudo operations. switch (MI->getOpcode()) { default: break; + case TargetOpcode::PATCHABLE_FUNCTION_ENTER: { +assert(!Subtarget->isAIXABI() && +

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-22 Thread Nick Desaulniers via cfe-commits
@@ -909,6 +909,24 @@ void PPCAsmPrinter::emitInstruction(const MachineInstr *MI) { // Lower multi-instruction pseudo operations. switch (MI->getOpcode()) { default: break; + case TargetOpcode::PATCHABLE_FUNCTION_ENTER: { +assert(!Subtarget->isAIXABI() && +

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-22 Thread Nick Desaulniers via cfe-commits
@@ -0,0 +1,4 @@ +// RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -fsyntax-only -verify %s + +// expected-error@+1 {{'patchable_function_entry' attribute is not yet supported on AIX}} +__attribute__((patchable_function_entry(0))) void f(); nickdesaulniers wrote

[clang] [llvm] [X86] Support EGPR for inline assembly. (PR #92338)

2024-05-22 Thread Nick Desaulniers via cfe-commits
@@ -58016,15 +58035,27 @@ X86TargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, break; case 'r': // GENERAL_REGS case 'l': // INDEX_REGS + if (Subtarget.useInlineAsmGPR32()) { +if (VT == MVT::i8 || VT == MVT::i1) +

[clang] [llvm] [X86] Support EGPR for inline assembly. (PR #92338)

2024-05-21 Thread Nick Desaulniers via cfe-commits
@@ -0,0 +1,29 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: not llc -mtriple=x86_64 < %s 2>&1 | FileCheck %s --check-prefix=ERR +; RUN: not llc -mtriple=x86_64 -mattr=+egpr < %s 2>&1 | FileCheck %s --check-prefix=ERR +; RUN: llc -mtripl

[clang] [llvm] [X86] Support EGPR for inline assembly. (PR #92338)

2024-05-21 Thread Nick Desaulniers via cfe-commits
@@ -0,0 +1,19 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: not llc -mtriple=x86_64 %s 2>&1 | FileCheck %s --check-prefix=ERR +; RUN: llc -mtriple=x86_64 -mattr=+egpr < %s | FileCheck %s --check-prefix=EGPR +; RUN: llc -mtriple=x86_64

[clang] [clang][CodeGen][NFC] Make ConstExprEmitter a ConstStmtVisitor (PR #89041)

2024-04-22 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers approved this pull request. https://github.com/llvm/llvm-project/pull/89041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-04-12 Thread Nick Desaulniers via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -triple %ms_abi_triple -Wunused -x c -verify %s +// RUN: %clang_cc1 -triple %ms_abi_triple -Wunused -verify=expected,cxx %s + +#ifdef __cplusplus +extern "C" { +#endif +static int f(void) { return 42; } // cxx-warning{{unused function 'f'}} +in

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

2024-04-12 Thread Nick Desaulniers via cfe-commits
@@ -0,0 +1,47 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c -verify %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c++ -verify=expected,cxx %s + +#ifdef __cplusplus +extern "C" { +#endif +static int f(void) { return 42; } +int g(void) __attribut

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

2024-04-12 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers approved this pull request. LGTM; though I have a strong preference to get bugs on file and linked to regarding: - issues with non-itanium mangling - issues with namespaced identifiers. https://github.com/llvm/llvm-project/pull/87130 __

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

2024-04-12 Thread Nick Desaulniers via cfe-commits
@@ -0,0 +1,47 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c -verify %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c++ -verify=expected,cxx %s + +#ifdef __cplusplus +extern "C" { +#endif +static int f(void) { return 42; } +int g(void) __attribut

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

2024-04-12 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers edited https://github.com/llvm/llvm-project/pull/87130 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [llvm] Fix typos (PR #88565)

2024-04-12 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers closed https://github.com/llvm/llvm-project/pull/88565 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [llvm] Fix typos (PR #88565)

2024-04-12 Thread Nick Desaulniers via cfe-commits
nickdesaulniers wrote: Thanks for the patch. Do you need one of us to merge this for you? https://github.com/llvm/llvm-project/pull/88565 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [libc] [llvm] Fix typos (PR #88565)

2024-04-12 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers approved this pull request. https://github.com/llvm/llvm-project/pull/88565 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-04-05 Thread Nick Desaulniers via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -triple %ms_abi_triple -Wunused -x c -verify %s +// RUN: %clang_cc1 -triple %ms_abi_triple -Wunused -verify=expected,cxx %s + +#ifdef __cplusplus +extern "C" { +#endif +static int f(void) { return 42; } // cxx-warning{{unused function 'f'}} +in

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

2024-04-05 Thread Nick Desaulniers via cfe-commits
@@ -1980,6 +1981,36 @@ static void handleWeakRefAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL)); } +// Mark alias/ifunc target as used. Due to name mangling, we look up the +// demangled name ignoring parameters. This

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

2024-04-05 Thread Nick Desaulniers via cfe-commits
@@ -0,0 +1,47 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c -verify %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c++ -verify=expected,cxx %s + +#ifdef __cplusplus +extern "C" { +#endif +static int f(void) { return 42; } +int g(void) __attribut

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

2024-04-05 Thread Nick Desaulniers via cfe-commits
@@ -0,0 +1,47 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c -verify %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c++ -verify=expected,cxx %s + +#ifdef __cplusplus +extern "C" { +#endif +static int f(void) { return 42; } +int g(void) __attribut

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

2024-04-05 Thread Nick Desaulniers via cfe-commits
@@ -0,0 +1,47 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c -verify %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c++ -verify=expected,cxx %s + +#ifdef __cplusplus +extern "C" { +#endif +static int f(void) { return 42; } +int g(void) __attribut

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

2024-04-05 Thread Nick Desaulniers via cfe-commits
@@ -0,0 +1,47 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c -verify %s nickdesaulniers wrote: > but git does not preserve file move history... Sure it does; isn't that the point of the `--follow` flag to `git log `? https://github.com/llvm/ll

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

2024-04-05 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers edited https://github.com/llvm/llvm-project/pull/87130 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

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

2024-04-05 Thread Nick Desaulniers via cfe-commits
@@ -0,0 +1,47 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c -verify %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c++ -verify=expected,cxx %s + +#ifdef __cplusplus +extern "C" { +#endif +static int f(void) { return 42; } +int g(void) __attribut

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

2024-04-05 Thread Nick Desaulniers via cfe-commits
@@ -0,0 +1,47 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c -verify %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c++ -verify=expected,cxx %s + +#ifdef __cplusplus +extern "C" { +#endif +static int f(void) { return 42; } +int g(void) __attribut

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

2024-04-05 Thread Nick Desaulniers via cfe-commits
@@ -1980,6 +1981,36 @@ static void handleWeakRefAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL)); } +// Mark alias/ifunc target as used. Due to name mangling, we look up the +// demangled name ignoring parameters. This

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

2024-04-05 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers edited https://github.com/llvm/llvm-project/pull/87130 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-04-05 Thread Nick Desaulniers via cfe-commits
@@ -0,0 +1,47 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c -verify %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c++ -verify=expected,cxx %s + +#ifdef __cplusplus +extern "C" { +#endif +static int f(void) { return 42; } +int g(void) __attribut

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

2024-04-05 Thread Nick Desaulniers via cfe-commits
@@ -0,0 +1,47 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c -verify %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c++ -verify=expected,cxx %s + +#ifdef __cplusplus +extern "C" { +#endif +static int f(void) { return 42; } +int g(void) __attribut

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

2024-04-05 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers commented: Progressing in the right direction and I'm in favor of fixing this issue in clang, with similar levels of caution as my fellow reviewers. I think we can support Microsoft ABI mangling trivially here. That we mangle globals with static linkage in `e

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

2024-04-05 Thread Nick Desaulniers via cfe-commits
@@ -0,0 +1,47 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c -verify %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c++ -verify=expected,cxx %s + +#ifdef __cplusplus +extern "C" { +#endif +static int f(void) { return 42; } +int g(void) __attribut

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

2024-04-04 Thread Nick Desaulniers via cfe-commits
@@ -0,0 +1,47 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c -verify %s nickdesaulniers wrote: consider using `git mv` when you rename files or move test cases. Makes it very obvious in code review when existing test cases are deleted vs moved

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

2024-04-01 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers commented: As the author of https://reviews.llvm.org/D54188 and the TODO added from there, this patch is the right thing to do. I fixed a false positive diagnostic for C and knew that the fix was insufficient for C++. I do appreciate the abundance of caution

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

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

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

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

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

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

[clang] [clang][ExprConst] Fix second arg of __builtin_{clzg,ctzg} not always being evaluated (PR #86742)

2024-03-29 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers approved this pull request. https://github.com/llvm/llvm-project/pull/86742 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Headers] Don't declare unreachable() from stddef.h in C++ (PR #86748)

2024-03-29 Thread Nick Desaulniers via cfe-commits
nickdesaulniers wrote: > I think I am generally deeply confused about what should be provided by the > compiler and what should be provided by the C Standard Library on any given > platform. +1 > Doing otherwise and trying to be "helpful" in Clang only creates confusion > and forces C librar

[clang] [clang][ExprConst] Fix second arg of __builtin_{clzg,ctzg} not always being evaluated (PR #86742)

2024-03-26 Thread Nick Desaulniers via cfe-commits
@@ -0,0 +1,39 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// expected-no-diagnostics + +constexpr int increment(int& x) { + x++; + return x; +} + +constexpr int test_clzg_0() { + int x = 0; + [[maybe_unused]] int unused = __builtin_clzg(0U, increment(x)); + return x; +}

[clang] [clang][ExprConst] Fix second arg of __builtin_{clzg,ctzg} not always being evaluated (PR #86742)

2024-03-26 Thread Nick Desaulniers via cfe-commits
@@ -0,0 +1,39 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// expected-no-diagnostics + +constexpr int increment(int& x) { + x++; + return x; +} + +constexpr int test_clzg_0() { + int x = 0; + [[maybe_unused]] int unused = __builtin_clzg(0U, increment(x)); + return x; +}

[clang] [clang] Implement constexpr support for __builtin_{clzg, ctzg} (PR #86577)

2024-03-26 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers closed https://github.com/llvm/llvm-project/pull/86577 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement constexpr support for __builtin_{clzg, ctzg} (PR #86577)

2024-03-26 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers approved this pull request. thanks! are you able to merge or do you need me to? https://github.com/llvm/llvm-project/pull/86577 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [clang] Implement constexpr support for __builtin_{clzg, ctzg} (PR #86577)

2024-03-25 Thread Nick Desaulniers via cfe-commits
@@ -12367,8 +12368,17 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, BuiltinOp != Builtin::BI__lzcnt && BuiltinOp != Builtin::BI__lzcnt64; -if (ZeroIsUndefined && !Val) - return Error(E); +i

[clang] [clang] Implement constexpr support for __builtin_{clzg, ctzg} (PR #86577)

2024-03-25 Thread Nick Desaulniers via cfe-commits
@@ -12410,12 +12420,22 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, case Builtin::BI__builtin_ctz: case Builtin::BI__builtin_ctzl: case Builtin::BI__builtin_ctzll: - case Builtin::BI__builtin_ctzs: { + case Builtin::BI__builtin_ctzs: + case Builti

[clang] [clang] Implement constexpr support for __builtin_{clzg, ctzg} (PR #86577)

2024-03-25 Thread Nick Desaulniers via cfe-commits
@@ -12367,8 +12368,17 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, BuiltinOp != Builtin::BI__lzcnt && BuiltinOp != Builtin::BI__lzcnt64; -if (ZeroIsUndefined && !Val) - return Error(E); +i

[clang] [clang] Implement constexpr support for __builtin_{clzg, ctzg} (PR #86577)

2024-03-25 Thread Nick Desaulniers via cfe-commits
@@ -12367,8 +12368,17 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, BuiltinOp != Builtin::BI__lzcnt && BuiltinOp != Builtin::BI__lzcnt64; -if (ZeroIsUndefined && !Val) - return Error(E); +i

[clang] [clang] Implement constexpr support for __builtin_{clzg, ctzg} (PR #86577)

2024-03-25 Thread Nick Desaulniers via cfe-commits
@@ -12367,8 +12368,17 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, BuiltinOp != Builtin::BI__lzcnt && BuiltinOp != Builtin::BI__lzcnt64; -if (ZeroIsUndefined && !Val) - return Error(E); +i

[clang] [clang] Implement constexpr support for __builtin_{clzg, ctzg} (PR #86577)

2024-03-25 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers edited https://github.com/llvm/llvm-project/pull/86577 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement constexpr support for __builtin_{clzg, ctzg} (PR #86577)

2024-03-25 Thread Nick Desaulniers via cfe-commits
@@ -12367,8 +12368,17 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, BuiltinOp != Builtin::BI__lzcnt && BuiltinOp != Builtin::BI__lzcnt64; -if (ZeroIsUndefined && !Val) - return Error(E); +i

[clang] [clang] Implement constexpr support for __builtin_{clzg, ctzg} (PR #86577)

2024-03-25 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers edited https://github.com/llvm/llvm-project/pull/86577 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement constexpr support for __builtin_{clzg, ctzg} (PR #86577)

2024-03-25 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers edited https://github.com/llvm/llvm-project/pull/86577 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement constexpr support for __builtin_{clzg, ctzg} (PR #86577)

2024-03-25 Thread Nick Desaulniers via cfe-commits
@@ -12367,8 +12368,17 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, BuiltinOp != Builtin::BI__lzcnt && BuiltinOp != Builtin::BI__lzcnt64; -if (ZeroIsUndefined && !Val) - return Error(E); +i

  1   2   3   4   5   >