[libcxx] [libcxxabi] [libunwind] [NFC][libc++][libc++abi][libunwind][test] Fix/unify AIX triples used in LIT tests (PR #101196)

2024-07-30 Thread Saleem Abdulrasool via cfe-commits
@@ -6,7 +6,7 @@ // //===--===// -// REQUIRES: target={{powerpc.*-ibm-aix.*}} +// REQUIRES: target={{.+}}-aix{{.*}} compnerd wrote: But then we should be able to hoist these tests out of the

[clang] [Driver] Pass correct alignment for -falign-functions with no argument (PR #101257)

2024-07-30 Thread Saleem Abdulrasool via cfe-commits
@@ -1982,7 +1982,7 @@ unsigned tools::ParseFunctionAlignment(const ToolChain &TC, return 0; if (A->getOption().matches(options::OPT_falign_functions)) -return 0; +return 4; // log2(16) compnerd wrote: This is not true. Quoting the documentation

[clang] [Driver] Pass correct alignment for -falign-functions with no argument (PR #101257)

2024-07-31 Thread Saleem Abdulrasool via cfe-commits
@@ -1982,7 +1982,7 @@ unsigned tools::ParseFunctionAlignment(const ToolChain &TC, return 0; if (A->getOption().matches(options::OPT_falign_functions)) -return 0; +return 4; // log2(16) compnerd wrote: @pogo59 that is documented in the GCC docum

[clang] [Driver] Pass correct alignment for -falign-functions with no argument (PR #101257)

2024-07-31 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd approved this pull request. https://github.com/llvm/llvm-project/pull/101257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [APINotes] Reduce memory footprint for Obj-C/C++ contexts (PR #99358)

2024-07-17 Thread Saleem Abdulrasool via cfe-commits
@@ -286,6 +280,31 @@ inline bool operator==(const ContextTableKey &lhs, const ContextTableKey &rhs) { lhs.contextKind == rhs.contextKind && lhs.contextID == rhs.contextID; } +/// A stored Objective-C or C++ declaration, represented by the ID of its parent +/// conte

[clang] [APINotes] Reduce memory footprint for Obj-C/C++ contexts (PR #99358)

2024-07-17 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd approved this pull request. Interesting that we haven't had issues with storing the context kind instead of the decl kind. Perhaps that was not being used? https://github.com/llvm/llvm-project/pull/99358 ___ cfe-commits mai

[clang] [APINotes] Support annotating C++ methods (PR #99512)

2024-07-18 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd approved this pull request. Minor nit on naming, don't think it matters. https://github.com/llvm/llvm-project/pull/99512 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [APINotes] Support annotating C++ methods (PR #99512)

2024-07-18 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd edited https://github.com/llvm/llvm-project/pull/99512 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [APINotes] Support annotating C++ methods (PR #99512)

2024-07-18 Thread Saleem Abdulrasool via cfe-commits
@@ -794,6 +831,33 @@ void APINotesWriter::Implementation::writeObjCMethodBlock( } } +void APINotesWriter::Implementation::writeCXXMethodBlock( +llvm::BitstreamWriter &Stream) { + llvm::BCBlockRAII Scope(Stream, CXX_METHOD_BLOCK_ID, 3); + + if (CXXMethods.empty()) +

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-19 Thread Saleem Abdulrasool via cfe-commits
@@ -958,12 +961,18 @@ class YAMLConverter { ContextInfo CI; auto TagCtxID = Writer.addContext(ParentContextID, T.Name, ContextKind::Tag, CI, SwiftVersion); +Context TagCtx(TagCtxID, ContextKind::Tag); for (const auto &CX

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-19 Thread Saleem Abdulrasool via cfe-commits
@@ -421,9 +424,8 @@ struct Tag { std::optional EnumConvenienceKind; std::optional SwiftCopyable; FunctionsSeq Methods; + TagsSeq Tags; compnerd wrote: This would be confusing as the reader might expect all child tags to be here. https://github.com/llvm

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-19 Thread Saleem Abdulrasool via cfe-commits
@@ -456,6 +458,7 @@ template <> struct MappingTraits { IO.mapOptional("EnumKind", T.EnumConvenienceKind); IO.mapOptional("SwiftCopyable", T.SwiftCopyable); IO.mapOptional("Methods", T.Methods); +IO.mapOptional("Tags", T.Tags); compnerd wrote: S

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-19 Thread Saleem Abdulrasool via cfe-commits
@@ -783,51 +783,76 @@ static void ProcessVersionedAPINotes( } } +static std::optional +UnwindNamespaceContext(DeclContext *DC, api_notes::APINotesManager &APINotes) { + if (auto NamespaceContext = dyn_cast(DC)) { +for (auto Reader : APINotes.findAPINotes(NamespaceContex

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-19 Thread Saleem Abdulrasool via cfe-commits
@@ -899,6 +924,10 @@ void Sema::ProcessAPINotes(Decl *D) { } for (auto Reader : APINotes.findAPINotes(D->getLocation())) { +if (Tag->getName() == "inner_char_box") + llvm::errs(); compnerd wrote: Debugging left overs? https://git

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-19 Thread Saleem Abdulrasool via cfe-commits
@@ -456,6 +458,7 @@ template <> struct MappingTraits { IO.mapOptional("EnumKind", T.EnumConvenienceKind); IO.mapOptional("SwiftCopyable", T.SwiftCopyable); IO.mapOptional("Methods", T.Methods); +IO.mapOptional("Tags", T.Tags); compnerd wrote: H

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-19 Thread Saleem Abdulrasool via cfe-commits
@@ -783,51 +783,76 @@ static void ProcessVersionedAPINotes( } } +static std::optional +UnwindNamespaceContext(DeclContext *DC, api_notes::APINotesManager &APINotes) { + if (auto NamespaceContext = dyn_cast(DC)) { +for (auto Reader : APINotes.findAPINotes(NamespaceContex

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-22 Thread Saleem Abdulrasool via cfe-commits
@@ -783,51 +783,76 @@ static void ProcessVersionedAPINotes( } } +static std::optional +UnwindNamespaceContext(DeclContext *DC, api_notes::APINotesManager &APINotes) { + if (auto NamespaceContext = dyn_cast(DC)) { +for (auto Reader : APINotes.findAPINotes(NamespaceContex

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-22 Thread Saleem Abdulrasool via cfe-commits
@@ -456,6 +458,7 @@ template <> struct MappingTraits { IO.mapOptional("EnumKind", T.EnumConvenienceKind); IO.mapOptional("SwiftCopyable", T.SwiftCopyable); IO.mapOptional("Methods", T.Methods); +IO.mapOptional("Tags", T.Tags); compnerd wrote: I

[clang] [APINotes] Support nested tags (PR #99655)

2024-07-22 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd approved this pull request. https://github.com/llvm/llvm-project/pull/99655 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-25 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd edited https://github.com/llvm/llvm-project/pull/90064 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-25 Thread Saleem Abdulrasool via cfe-commits
@@ -527,6 +527,13 @@ class TagTableInfo Info.EnumExtensibility = static_cast((Payload & 0x3) - 1); +uint8_t Copyable = +endian::readNext(Data); +if (Copyable == 1) + Info.setSwiftCopyable(std::optional(false)); +else if (Copyable == 2)

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-25 Thread Saleem Abdulrasool via cfe-commits
@@ -1125,10 +1125,10 @@ class CommonTypeTableInfo class TagTableInfo : public CommonTypeTableInfo { public: unsigned getUnversionedInfoSize(const TagInfo &TI) { -return 2 + (TI.SwiftImportAs ? TI.SwiftImportAs->size() : 0) + - 2 + (TI.SwiftRetainOp ? TI.SwiftRet

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-25 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd approved this pull request. https://github.com/llvm/llvm-project/pull/90064 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-25 Thread Saleem Abdulrasool via cfe-commits
@@ -1146,6 +1146,12 @@ class TagTableInfo : public CommonTypeTableInfo { writer.write(Flags); +if (auto Copyable = TI.isSwiftCopyable()) { compnerd wrote: Unnecessary braces and we should be able to use the named constants here. https://github.com/

[clang] [clang-tools-extra] [compiler-rt] [flang] [lld] [lldb] [llvm] [mlir] [openmp] [pstl] Finally formalise our defacto line-ending policy (PR #86318)

2024-04-25 Thread Saleem Abdulrasool via cfe-commits
compnerd wrote: > @compnerd I just realised I didn't respond to your concern. Apologies. > > > I think that the concern that I have is that do we have sufficient testing > > for supporting line-ending dependent behaviour in the compiler? > > For the first part: I don't know that it matters, si

[clang] [clang-tools-extra] [compiler-rt] [flang] [lld] [lldb] [llvm] [mlir] [openmp] [pstl] Finally formalise our defacto line-ending policy (PR #86318)

2024-04-25 Thread Saleem Abdulrasool via cfe-commits
compnerd wrote: > changes to `clang/test/CXX/lex/lex.literal/lex.string/p4.cpp` should be > reverted (it's a CRLF related test) This is the type of problems that I am concerned about. We certainly have some tests which are line-ending sensitive, and each test should be audited before we make

[clang] [clang-tools-extra] [compiler-rt] [flang] [lld] [lldb] [llvm] [mlir] [openmp] [pstl] Finally formalise our defacto line-ending policy (PR #86318)

2024-04-25 Thread Saleem Abdulrasool via cfe-commits
compnerd wrote: > Also, it's a bit funny to have .bat files without CRLF endings given that > they run on Windows. I'm not sure about the funny bit - but certainly dangerous. I've had cmd misinterpret batch files with LF vs CRLF. https://github.com/llvm/llvm-project/pull/86318 ___

[clang] [llvm] [CodeView] Flatten cmd args in frontend for LF_BUILDINFO (PR #106369)

2024-09-01 Thread Saleem Abdulrasool via cfe-commits
@@ -322,6 +323,46 @@ static bool actionRequiresCodeGen(BackendAction Action) { Action != Backend_EmitLL; } +static std::string flattenClangCommandLine(ArrayRef Args, + StringRef MainFilename) { + if (Args.empty()) + { ---

[clang] [llvm] [MC] Emit a jump table size section (PR #101962)

2024-08-30 Thread Saleem Abdulrasool via cfe-commits
@@ -2764,10 +2771,59 @@ void AsmPrinter::emitJumpTableInfo() { for (const MachineBasicBlock *MBB : JTBBs) emitJumpTableEntry(MJTI, MBB, JTI); } + + if (EmitJumpTableSizesSection) +emitJumpTableSizesSection(MJTI, F); + if (!JTInDiffSection) OutStreamer->

[clang] [llvm] [CodeView] Flatten cmd args in frontend for LF_BUILDINFO (PR #106369)

2024-09-01 Thread Saleem Abdulrasool via cfe-commits
@@ -321,6 +322,41 @@ static bool actionRequiresCodeGen(BackendAction Action) { Action != Backend_EmitLL; } +static std::string flattenClangCommandLine(ArrayRef Args, + StringRef MainFilename) { + std::string FlatCmdLine; + raw_st

[clang] [llvm] [MC] Emit a jump table size section (PR #101962)

2024-08-30 Thread Saleem Abdulrasool via cfe-commits
@@ -2764,10 +2771,59 @@ void AsmPrinter::emitJumpTableInfo() { for (const MachineBasicBlock *MBB : JTBBs) emitJumpTableEntry(MJTI, MBB, JTI); } + + if (EmitJumpTableSizesSection) +emitJumpTableSizesSection(MJTI, F); + if (!JTInDiffSection) OutStreamer->

[clang] [llvm] [MC] Emit a jump table size section (PR #101962)

2024-09-02 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd approved this pull request. https://github.com/llvm/llvm-project/pull/101962 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [APINotes] Refactor: remove references to `ObjCContext...` (PR #98201)

2024-07-09 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd approved this pull request. https://github.com/llvm/llvm-project/pull/98201 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] fix unwinding from signal handler (PR #92291)

2024-07-09 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd closed https://github.com/llvm/llvm-project/pull/92291 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [APINotes] Remove unused API (PR #98943)

2024-07-15 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd approved this pull request. Sounds good. I wonder if this was used at one point and we removed that? https://github.com/llvm/llvm-project/pull/98943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [llvm] [MC] Emit a jump table size section (PR #101962)

2024-08-05 Thread Saleem Abdulrasool via cfe-commits
compnerd wrote: The `.debug_` prefix is for DEARF content, is this being proposed to the DWARF standard? https://github.com/llvm/llvm-project/pull/101962 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] 16fdc5d - APINotes: annotate dump methods (NFC)

2021-01-08 Thread Saleem Abdulrasool via cfe-commits
Author: Saleem Abdulrasool Date: 2021-01-08T20:49:28Z New Revision: 16fdc5da89068f646c153c6bd6c493b1d666bfbf URL: https://github.com/llvm/llvm-project/commit/16fdc5da89068f646c153c6bd6c493b1d666bfbf DIFF: https://github.com/llvm/llvm-project/commit/16fdc5da89068f646c153c6bd6c493b1d666bfbf.diff

[clang-tools-extra] d0d9e6f - clang-tidy: introduce readability-containter-data-pointer check

2021-09-14 Thread Saleem Abdulrasool via cfe-commits
Author: Saleem Abdulrasool Date: 2021-09-14T08:12:10-07:00 New Revision: d0d9e6f0849b2e76e980e2edf365302f47f4e35f URL: https://github.com/llvm/llvm-project/commit/d0d9e6f0849b2e76e980e2edf365302f47f4e35f DIFF: https://github.com/llvm/llvm-project/commit/d0d9e6f0849b2e76e980e2edf365302f47f4e35f.

[clang-tools-extra] 49992c0 - Revert "Revert "clang-tidy: introduce readability-containter-data-pointer check""

2021-09-14 Thread Saleem Abdulrasool via cfe-commits
Author: Saleem Abdulrasool Date: 2021-09-14T10:52:35-07:00 New Revision: 49992c04148e5327bef9bd2dff53a0d46004b4b4 URL: https://github.com/llvm/llvm-project/commit/49992c04148e5327bef9bd2dff53a0d46004b4b4 DIFF: https://github.com/llvm/llvm-project/commit/49992c04148e5327bef9bd2dff53a0d46004b4b4.

[clang-tools-extra] d249200 - Revert "Re-Revert "clang-tidy: introduce readability-containter-data-pointer check""

2021-09-15 Thread Saleem Abdulrasool via cfe-commits
Author: Saleem Abdulrasool Date: 2021-09-15T20:52:55Z New Revision: d249200fa7d540fb0b3ddc065575293e1da11107 URL: https://github.com/llvm/llvm-project/commit/d249200fa7d540fb0b3ddc065575293e1da11107 DIFF: https://github.com/llvm/llvm-project/commit/d249200fa7d540fb0b3ddc065575293e1da11107.diff

[clang] [llvm] [MC] Emit a jump table size section (PR #101962)

2024-08-20 Thread Saleem Abdulrasool via cfe-commits
@@ -2764,6 +2770,27 @@ void AsmPrinter::emitJumpTableInfo() { for (const MachineBasicBlock *MBB : JTBBs) emitJumpTableEntry(MJTI, MBB, JTI); } + + if (EmitJumpTableSizesSection && TM.getTargetTriple().isOSBinFormatELF() && compnerd wrote: Outside

[clang] [llvm] [MC] Emit a jump table size section (PR #101962)

2024-08-20 Thread Saleem Abdulrasool via cfe-commits
@@ -0,0 +1,97 @@ +; RUN: llc %s -o - -emit-jump-table-sizes-section -verify-machineinstrs --relocation-model=pic | FileCheck --check-prefix=CHECK %s +; RUN: llc %s -o - -verify-machineinstrs --relocation-model=pic | FileCheck --check-prefix=NOFLAG %s compnerd wr

[clang] [Clang] Add explicit visibility symbol macros (PR #108276)

2024-09-11 Thread Saleem Abdulrasool via cfe-commits
@@ -166,7 +166,7 @@ if(ENABLE_SHARED) set_target_properties(libclang PROPERTIES VERSION ${LIBCLANG_LIBRARY_VERSION} - DEFINE_SYMBOL _CINDEX_LIB_) + DEFINE_SYMBOL _CINDEX_LIB_ DEFINE_SYMBOL CLANG_EXPORTS) compnerd wrote: This will ove

[clang] [Clang] Add explicit visibility symbol macros (PR #108276)

2024-09-11 Thread Saleem Abdulrasool via cfe-commits
@@ -108,6 +108,10 @@ macro(add_clang_library name) endif() llvm_add_library(${name} ${LIBTYPE} ${ARG_UNPARSED_ARGUMENTS} ${srcs}) + if(NOT ARG_SHARED AND NOT ARG_STATIC) +target_compile_definitions("obj.${name}" PRIVATE CLANG_EXPORTS) compnerd wrote:

[libunwind] [libunwind][AIX] Call dlclose only when dlsym() fails (PR #112768)

2024-10-17 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd commented: Should the call be prior to the assert? https://github.com/llvm/llvm-project/pull/112768 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-10-03 Thread Saleem Abdulrasool via cfe-commits
@@ -0,0 +1,153 @@ +//===-- amdgpuintrin.h - AMDPGU intrinsic functions ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-10-03 Thread Saleem Abdulrasool via cfe-commits
@@ -0,0 +1,153 @@ +//===-- amdgpuintrin.h - AMDPGU intrinsic functions ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [lld] [llvm] [Windows] Add support for emitting PGO/LTO magic strings in the Windows PE debug directory (PR #114260)

2024-11-03 Thread Saleem Abdulrasool via cfe-commits
@@ -1165,6 +1188,23 @@ void Writer::createMiscChunks() { llvm::TimeTraceScope timeScope("Misc chunks"); Configuration *config = &ctx.config; + auto searchForPgoMagicSection = [this](char sectionName[]) { +for (auto *obj : ctx.objFileInstances) { + for (auto &chun

[clang] Clang tooling generated visibility macros for Clang (PR #109702)

2024-11-04 Thread Saleem Abdulrasool via cfe-commits
compnerd wrote: > pre-commit actions are expensive, but I think we could afford to do something > here. It is not hard to set up a DLL build of an ELF DSO build that uses > these annotations, and it's cheaper than a fully static build. Having a fast incremental build for DLL-enabled LLVM/clang

[clang] Nominate Saleem and myself as maintainers for API Notes (PR #114981)

2024-11-05 Thread Saleem Abdulrasool via cfe-commits
compnerd wrote: Thanks @AaronBallman - @egorzhdan was nice enough to reach out to me earlier and I am fine with co-maintaining the APINotes. https://github.com/llvm/llvm-project/pull/114981 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[clang] [clang] Add preliminary lifetimebound support to APINotes (PR #114830)

2024-11-04 Thread Saleem Abdulrasool via cfe-commits
@@ -444,6 +454,16 @@ class ParamInfo : public VariableInfo { NoEscape = Value.value_or(false); } + std::optional isLifetimebound() const { +if (!LifetimeboundSpecified) + return std::nullopt; +return Lifetimebound; compnerd wrote: ```sugge

[clang] [clang] Add preliminary lifetimebound support to APINotes (PR #114830)

2024-11-04 Thread Saleem Abdulrasool via cfe-commits
@@ -860,13 +868,12 @@ void Sema::ProcessAPINotes(Decl *D) { if (!D) return; + auto *DC = D->getDeclContext(); // Globals. - if (D->getDeclContext()->isFileContext() || - D->getDeclContext()->isNamespace() || - D->getDeclContext()->isExternCContext() || -

[clang] [clang] Add preliminary lifetimebound support to APINotes (PR #114830)

2024-11-04 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd approved this pull request. https://github.com/llvm/llvm-project/pull/114830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Support 'this' position for lifetimebound attribute (PR #115021)

2024-11-05 Thread Saleem Abdulrasool via cfe-commits
@@ -730,7 +731,9 @@ class YAMLConverter { } } - void convertParams(const ParamsSeq &Params, FunctionInfo &OutInfo) { + std::optional convertParams(const ParamsSeq &Params, + FunctionInfo &OutInfo) { compnerd wrot

[clang] [clang] Support 'this' position for lifetimebound attribute (PR #115021)

2024-11-05 Thread Saleem Abdulrasool via cfe-commits
@@ -516,7 +524,17 @@ class CXXMethodTableInfo static CXXMethodInfo readUnversioned(internal_key_type Key, const uint8_t *&Data) { CXXMethodInfo Info; + +uint8_t Payload = *Data++; +bool HasThis = Payload & 0x01; +Payload

[clang] [clang] Support 'this' position for lifetimebound attribute (PR #115021)

2024-11-05 Thread Saleem Abdulrasool via cfe-commits
@@ -926,11 +935,17 @@ class YAMLConverter { TheNamespace.Items, SwiftVersion); } - void convertFunction(const Function &Function, FunctionInfo &FI) { + template + void convertFunction(const Function &Function, FuncOrMethodInfo &FI) { convert

[clang] [clang] Support 'this' position for lifetimebound attribute (PR #115021)

2024-11-05 Thread Saleem Abdulrasool via cfe-commits
@@ -730,7 +731,9 @@ class YAMLConverter { } } - void convertParams(const ParamsSeq &Params, FunctionInfo &OutInfo) { + std::optional convertParams(const ParamsSeq &Params, + FunctionInfo &OutInfo) { +std::optional thisOrSelf;

[clang] [clang] Support 'this' position for lifetimebound attribute (PR #115021)

2024-11-05 Thread Saleem Abdulrasool via cfe-commits
@@ -793,12 +802,22 @@ class CXXMethodTableInfo return static_cast(key.hashValue()); } - unsigned getUnversionedInfoSize(const CXXMethodInfo &OMI) { -return getFunctionInfoSize(OMI); + unsigned getUnversionedInfoSize(const CXXMethodInfo &CxxMI) { +auto size = ge

[clang] [clang] Support 'this' position for lifetimebound attribute (PR #115021)

2024-11-05 Thread Saleem Abdulrasool via cfe-commits
@@ -739,10 +742,16 @@ class YAMLConverter { PI.setLifetimebound(P.Lifetimebound); PI.setType(std::string(P.Type)); PI.setRetainCountConvention(P.RetainCountConvention); - if (OutInfo.Params.size() <= P.Position) + if (static_cast(OutInfo.Params.size(

[clang] [clang] Support 'this' position for lifetimebound attribute (PR #115021)

2024-11-05 Thread Saleem Abdulrasool via cfe-commits
@@ -396,12 +397,19 @@ class ObjCMethodTableInfo const uint8_t *&Data) { ObjCMethodInfo Info; uint8_t Payload = *Data++; +bool HasSelf = Payload & 0x01; +Payload >>= 1; Info.RequiredInit = Payload & 0x01; Payload

[clang] [clang][APINotes] Add support for the SwiftEscapable attribute (PR #115866)

2024-11-12 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd edited https://github.com/llvm/llvm-project/pull/115866 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][APINotes] Add support for the SwiftEscapable attribute (PR #115866)

2024-11-12 Thread Saleem Abdulrasool via cfe-commits
@@ -647,6 +647,13 @@ static void ProcessAPINotes(Sema &S, TagDecl *D, const api_notes::TagInfo &Info, D->addAttr(SwiftAttrAttr::Create(S.Context, "~Copyable")); } + if (auto Escapable = Info.isSwiftEscapable()) { +if (*Escapable) + D->addAttr(SwiftAttrAttr::

[clang] [clang][APINotes] Add support for the SwiftEscapable attribute (PR #115866)

2024-11-12 Thread Saleem Abdulrasool via cfe-commits
@@ -589,10 +589,16 @@ class TagTableInfo uint8_t Copyable = endian::readNext(Data); -if (Copyable == kSwiftNonCopyable) +if (Copyable == kSwiftDoesNotConform) Info.setSwiftCopyable(std::optional(false)); -else if (Copyable == kSwiftCopyable) +

[clang] [clang][APINotes] Add support for the SwiftEscapable attribute (PR #115866)

2024-11-12 Thread Saleem Abdulrasool via cfe-commits
@@ -757,6 +763,15 @@ class TagInfo : public CommonTypeInfo { SwiftCopyable = Value.value_or(false); } + std::optional isSwiftEscapable() const { +return SwiftEscapableSpecified ? std::optional(SwiftEscapable) + : std::nullopt; + }

[clang] [clang][APINotes] Add support for the SwiftEscapable attribute (PR #115866)

2024-11-12 Thread Saleem Abdulrasool via cfe-commits
@@ -1266,11 +1266,11 @@ class CommonTypeTableInfo class TagTableInfo : public CommonTypeTableInfo { public: unsigned getUnversionedInfoSize(const TagInfo &TI) { -return 2 + (TI.SwiftImportAs ? TI.SwiftImportAs->size() : 0) + - 2 + (TI.SwiftRetainOp ? TI.SwiftRet

[clang] [clang][APINotes] Add support for the SwiftEscapable attribute (PR #115866)

2024-11-12 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd approved this pull request. Some minor comments left. https://github.com/llvm/llvm-project/pull/115866 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add explicit visibility symbol macros (PR #108276)

2024-09-23 Thread Saleem Abdulrasool via cfe-commits
@@ -0,0 +1,69 @@ +//===-- clang/Support/Compiler.h - Compiler abstraction support -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [Clang] Add explicit visibility symbol macros (PR #108276)

2024-09-23 Thread Saleem Abdulrasool via cfe-commits
@@ -0,0 +1,69 @@ +//===-- clang/Support/Compiler.h - Compiler abstraction support -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [Clang] Add explicit visibility symbol macros (PR #108276)

2024-09-23 Thread Saleem Abdulrasool via cfe-commits
@@ -7,6 +7,7 @@ # //======// set(LLVM_LINK_COMPONENTS Support) -add_clang_tool(nvptx-arch NVPTXArch.cpp) +add_clang_tool(nvptx-arch DISABLE_CLANG_LINK_DYLIB compnerd wrote: Likewise https:/

[clang] [Clang] Add explicit visibility symbol macros (PR #108276)

2024-09-23 Thread Saleem Abdulrasool via cfe-commits
@@ -8,6 +8,7 @@ set(LLVM_LINK_COMPONENTS Support) -add_clang_tool(amdgpu-arch AMDGPUArch.cpp AMDGPUArchByHSA.cpp AMDGPUArchByHIP.cpp) +add_clang_tool(amdgpu-arch DISABLE_CLANG_LINK_DYLIB compnerd wrote: Why is this not allowed? Can we add a note about this?

[clang] [Clang] Add explicit visibility symbol macros (PR #108276)

2024-09-23 Thread Saleem Abdulrasool via cfe-commits
@@ -26,7 +26,7 @@ if(NOT CLANG_BUILT_STANDALONE) set(tablegen_deps intrinsics_gen LinkerWrapperOpts) endif() -add_clang_tool(clang-linker-wrapper +add_clang_tool(clang-linker-wrapper DISABLE_CLANG_LINK_DYLIB compnerd wrote: Similar https://github.com/llvm/

[clang] [Clang] Include LLVM CodeGen CMake file (PR #109601)

2024-09-23 Thread Saleem Abdulrasool via cfe-commits
@@ -1,3 +1,7 @@ +if(EXISTS ${LLVM_MAIN_SRC_DIR}/include/llvm/CodeGen AND CLANG_BUILT_STANDALONE) compnerd wrote: I think that I would rather have the cases mirrored here - the path should always exist in general, it is only the standalone case that is special.

[clang] [Clang] Include LLVM CodeGen CMake file (PR #109601)

2024-09-23 Thread Saleem Abdulrasool via cfe-commits
@@ -1,3 +1,7 @@ +if(EXISTS ${LLVM_MAIN_SRC_DIR}/include/llvm/CodeGen AND CLANG_BUILT_STANDALONE) + add_subdirectory(${LLVM_MAIN_SRC_DIR}/include/llvm/CodeGen llvm/lib/CodeGen) +endif() compnerd wrote: IIRC, even in the standalone case, you need to identify the L

[clang] [Clang] Replace vt_gen with LLVMCodeGenTypes (PR #109601)

2024-09-24 Thread Saleem Abdulrasool via cfe-commits
@@ -31,6 +31,7 @@ set(LLVM_LINK_COMPONENTS Target TargetParser TransformUtils + CodeGenTypes compnerd wrote: This is duplicated (L6). https://github.com/llvm/llvm-project/pull/109601 ___ cfe-commits mailing l

[clang] [Clang] Replace vt_gen with LLVMCodeGenTypes (PR #109601)

2024-09-24 Thread Saleem Abdulrasool via cfe-commits
@@ -31,6 +31,7 @@ set(LLVM_LINK_COMPONENTS Target TargetParser TransformUtils + LLVMCodeGenTypes compnerd wrote: These are lexicographically sorted, please maintain that invariant. https://github.com/llvm/llvm-project/pull/109601 __

[clang] [Clang] Include LLVM CodeGen CMake file (PR #109601)

2024-09-23 Thread Saleem Abdulrasool via cfe-commits
compnerd wrote: > @compnerd @etcwilde WDYT about conditionalizing the new dependency with an > `if (TARGET vt_gen)` instead of doing the `add_subdirectory()` dance? Ugh, I misread the change as `include_directories`. The `add_subdirectory` is definitely odd and I'm not sure if that is a proper

[clang] [Clang] Include LLVM CodeGen CMake file (PR #109601)

2024-09-23 Thread Saleem Abdulrasool via cfe-commits
@@ -1,3 +1,7 @@ +if(EXISTS ${LLVM_MAIN_SRC_DIR}/include/llvm/CodeGen AND CLANG_BUILT_STANDALONE) + add_subdirectory(${LLVM_MAIN_SRC_DIR}/include/llvm/CodeGen llvm/lib/CodeGen) +endif() compnerd wrote: The issue is that the `vt_gen` target is undefined. This is _

[clang] [Clang] Include LLVM CodeGen CMake file (PR #109601)

2024-09-23 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd edited https://github.com/llvm/llvm-project/pull/109601 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add explicit visibility symbol macros (PR #108276)

2024-09-29 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd approved this pull request. https://github.com/llvm/llvm-project/pull/108276 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Update llvm::Registry to work for LLVM shared library builds on windows (PR #109024)

2024-09-18 Thread Saleem Abdulrasool via cfe-commits
@@ -189,19 +190,23 @@ #define LLVM_TEMPLATE_ABI __declspec(dllimport) #define LLVM_EXPORT_TEMPLATE #endif +#define LLVM_ABI_EXPORT __declspec(dllexport) compnerd wrote: Why is this being added? I'm weary of any macro that is always export only because the val

[clang] [llvm] Update llvm::Registry to work for LLVM shared library builds on windows (PR #109024)

2024-09-18 Thread Saleem Abdulrasool via cfe-commits
@@ -165,4 +166,8 @@ const std::list> &getAttributePluginInstances(); } // namespace clang +namespace llvm { +extern template class CLANG_TEMPLATE_ABI llvm::Registry; compnerd wrote: ```suggestion extern template class CLANG_TEMPLATE_ABI Registry; ``` This

[clang] [Clang] Add explicit visibility symbol macros (PR #108276)

2024-09-20 Thread Saleem Abdulrasool via cfe-commits
compnerd wrote: > One thing I don't understand about this PR is why we need Compiler.h in Clang > -- wouldn't the LLVM definitions in their Compiler.h work for Clang as well? > (This would probably be worth explaining in the patch summary.) The symbol lookup in PE/COFF is two level and symmetr

[clang] [Clang] Include the clang-shlib CMake project when building for MSVC (PR #109457)

2024-09-20 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd approved this pull request. https://github.com/llvm/llvm-project/pull/109457 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add missing deps edge: CodeGenAction.cpp.o -> GenVT.inc (PR #109306)

2024-09-19 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd approved this pull request. https://github.com/llvm/llvm-project/pull/109306 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Include LLVM CodeGen CMake file (PR #109601)

2024-09-23 Thread Saleem Abdulrasool via cfe-commits
@@ -1,3 +1,7 @@ +if(EXISTS ${LLVM_MAIN_SRC_DIR}/include/llvm/CodeGen AND CLANG_BUILT_STANDALONE) + add_subdirectory(${LLVM_MAIN_SRC_DIR}/include/llvm/CodeGen llvm/lib/CodeGen) +endif() compnerd wrote: No, `LLVM_DIR` is passed to the CMake configure step to locat

[clang] [Clang] Include LLVM CodeGen CMake file (PR #109601)

2024-09-23 Thread Saleem Abdulrasool via cfe-commits
@@ -1,3 +1,7 @@ +if(EXISTS ${LLVM_MAIN_SRC_DIR}/include/llvm/CodeGen AND CLANG_BUILT_STANDALONE) + add_subdirectory(${LLVM_MAIN_SRC_DIR}/include/llvm/CodeGen llvm/lib/CodeGen) +endif() compnerd wrote: https://github.com/llvm/llvm-project/blob/main/llvm/cmake/mod

[clang] [Clang] Include LLVM CodeGen CMake file (PR #109601)

2024-09-23 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd edited https://github.com/llvm/llvm-project/pull/109601 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Clang tooling generated visibility macros for Clang (PR #109702)

2024-10-02 Thread Saleem Abdulrasool via cfe-commits
compnerd wrote: > Looking at Format.h (the only file I'm interested in), there feels to me to > be things in the ABI that I wouldn't expect to be called externally, I don't > know enough about what's involved in creating a DLL ABI but I wouldn't want > some of the clang-format functions to be

[clang] [clang] Support 'this' position for lifetimebound attribute (PR #115021)

2024-11-06 Thread Saleem Abdulrasool via cfe-commits
@@ -730,7 +731,9 @@ class YAMLConverter { } } - void convertParams(const ParamsSeq &Params, FunctionInfo &OutInfo) { + std::optional convertParams(const ParamsSeq &Params, + FunctionInfo &OutInfo) { compnerd wrot

[clang] [clang] Support 'this' position for lifetimebound attribute (PR #115021)

2024-11-07 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd approved this pull request. https://github.com/llvm/llvm-project/pull/115021 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Clang tooling generated visibility macros for Clang (PR #109702)

2024-11-25 Thread Saleem Abdulrasool via cfe-commits
compnerd wrote: > > The default behaviour of `ids` is to assume that anything declared in the > > header is public and it will ensure that anything added in the headers is > > annotated properly to say it is exposed, making something private would be > > an explicit decision that the developer

[clang] Clang tooling generated visibility macros for Clang (PR #109702)

2024-11-27 Thread Saleem Abdulrasool via cfe-commits
compnerd wrote: > Well, we're currently approaching this from the angle of "expose everything > and then the user can do whatever they want", but perhaps the discussion we > should be having is "what use cases do we explicitly want to support?" and > then we write plugins to demonstrate that w

[clang] [clang-tools-extra] [clangd] Update clangDaemonTweaks to set symbol visibility macros (PR #112304)

2024-11-19 Thread Saleem Abdulrasool via cfe-commits
@@ -47,7 +47,7 @@ endmacro() macro(add_clang_library name) cmake_parse_arguments(ARG -"SHARED;STATIC;INSTALL_WITH_TOOLCHAIN" +"SHARED;STATIC;INSTALL_WITH_TOOLCHAIN;CLANG_IMPORT" compnerd wrote: We should document the option. Why is it specific to cl

[clang] [clang-tools-extra] [clangd] Update clangDaemonTweaks to set symbol visibility macros (PR #112304)

2024-11-19 Thread Saleem Abdulrasool via cfe-commits
@@ -114,7 +114,7 @@ macro(add_clang_library name) if(TARGET "obj.${name}") target_compile_definitions("obj.${name}" PUBLIC CLANG_BUILD_STATIC) endif() - elseif(NOT ARG_SHARED AND NOT ARG_STATIC) + elseif(NOT ARG_SHARED AND NOT ARG_STATIC AND NOT ARG_CLANG_IMPORT

[clang] [clang-tools-extra] [clangd] Update clangDaemonTweaks to set symbol visibility macros (PR #112304)

2024-11-15 Thread Saleem Abdulrasool via cfe-commits
@@ -47,7 +47,7 @@ endmacro() macro(add_clang_library name) cmake_parse_arguments(ARG -"SHARED;STATIC;INSTALL_WITH_TOOLCHAIN" +"SHARED;STATIC;INSTALL_WITH_TOOLCHAIN;CLANG_IMPORT" compnerd wrote: It is unclear what this new option (`CLANG_IMPORT`) doe

[clang] [clang-tools-extra] [clangd] Update clangDaemonTweaks to set symbol visibility macros (PR #112304)

2024-11-15 Thread Saleem Abdulrasool via cfe-commits
@@ -114,7 +114,7 @@ macro(add_clang_library name) if(TARGET "obj.${name}") target_compile_definitions("obj.${name}" PUBLIC CLANG_BUILD_STATIC) endif() - elseif(NOT ARG_SHARED AND NOT ARG_STATIC) + elseif(NOT ARG_SHARED AND NOT ARG_STATIC AND NOT ARG_CLANG_IMPORT

[clang] Clang tooling generated visibility macros for Clang (PR #109702)

2024-11-25 Thread Saleem Abdulrasool via cfe-commits
compnerd wrote: > > I can absolutely see the value in the opposite - minimise the ABI surface. > > For many projects, there is a split of internal and external headers. The > > idea is that this tool is only run on the external headers, so those are > > meant to be ABI. > > There were multipl

[clang] Clang tooling generated visibility macros for Clang (PR #109702)

2024-12-04 Thread Saleem Abdulrasool via cfe-commits
compnerd wrote: > But this before we do that, we need to have some kind of mechanism in place > so we can actually enumerate the AP However, we already expose everything in > the API, and just adding the annotations doesn't change that (although I > think it may slightly reduce the number of s

[clang] [docs] Add a more detailed description in CXString.h. (PR #119090)

2024-12-08 Thread Saleem Abdulrasool via cfe-commits
@@ -46,6 +46,9 @@ typedef struct { /** * Retrieve the character data associated with the given string. + * + * The caller shouldn't free the returned string data, and the returned string + * data shouldn't be accessed after the \c CXString disposed. compnerd

[clang] [docs] Add a more detailed description in CXString.h. (PR #119090)

2024-12-08 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd edited https://github.com/llvm/llvm-project/pull/119090 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    5   6   7   8   9   10   11   >