From 795cf94e56b33e179bc06704ab9e507efb4428f3 Mon Sep 17 00:00:00 2001 From: Jack Elliott Date: Tue, 4 Nov 2025 13:24:21 +1300 Subject: [PATCH 1/8] Add GroupSharedLimit as a shader attribute --- include/dxc/DXIL/DxilFunctionProps.h | 3 +++ include/dxc/DXIL/DxilMetadataHelper.h | 1 + lib/DXIL/DxilMetadataHelper.cpp | 9 +++++++++ lib/DxilValidation/DxilValidation.cpp | 12 ++++++++++++ tools/clang/include/clang/Basic/Attr.td | 5 +++++ tools/clang/lib/CodeGen/CGHLSLMS.cpp | 15 +++++++++++++++ tools/clang/lib/Parse/ParseDecl.cpp | 1 + tools/clang/lib/Sema/SemaHLSL.cpp | 5 +++++ 8 files changed, 51 insertions(+) diff --git a/include/dxc/DXIL/DxilFunctionProps.h b/include/dxc/DXIL/DxilFunctionProps.h index 425ec4e391..e0223e9dd5 100644 --- a/include/dxc/DXIL/DxilFunctionProps.h +++ b/include/dxc/DXIL/DxilFunctionProps.h @@ -117,6 +117,7 @@ struct DxilFunctionProps { memset(&Node, 0, sizeof(Node)); Node.LaunchType = DXIL::NodeLaunchType::Invalid; Node.LocalRootArgumentsTableIndex = -1; + groupSharedLimitBytes = 0; } union { // Geometry shader. @@ -174,6 +175,8 @@ struct DxilFunctionProps { // numThreads shared between multiple shader types and node shaders. unsigned numThreads[3]; + unsigned groupSharedLimitBytes; + struct NodeProps { DXIL::NodeLaunchType LaunchType = DXIL::NodeLaunchType::Invalid; bool IsProgramEntry; diff --git a/include/dxc/DXIL/DxilMetadataHelper.h b/include/dxc/DXIL/DxilMetadataHelper.h index e17db016d8..2df42eaa03 100644 --- a/include/dxc/DXIL/DxilMetadataHelper.h +++ b/include/dxc/DXIL/DxilMetadataHelper.h @@ -320,6 +320,7 @@ class DxilMDHelper { static const unsigned kDxilNodeOutputsTag = 21; static const unsigned kDxilNodeMaxDispatchGridTag = 22; static const unsigned kDxilRangedWaveSizeTag = 23; + static const unsigned kDxilMaxGroupSharedMemTag = 24; // Node Input/Output State. static const unsigned kDxilNodeOutputIDTag = 0; diff --git a/lib/DXIL/DxilMetadataHelper.cpp b/lib/DXIL/DxilMetadataHelper.cpp index c1282a980a..4d60696edf 100644 --- a/lib/DXIL/DxilMetadataHelper.cpp +++ b/lib/DXIL/DxilMetadataHelper.cpp @@ -1624,6 +1624,10 @@ MDTuple *DxilMDHelper::EmitDxilEntryProperties(uint64_t rawShaderFlag, } MDVals.emplace_back(MDNode::get(m_Ctx, WaveSizeVal)); } + + MDVals.emplace_back(Uint32ToConstMD(DxilMDHelper::kDxilMaxGroupSharedMemTag)); + MDVals.emplace_back( + Uint32ToConstMD(props.groupSharedLimitBytes)); } break; // Geometry shader. case DXIL::ShaderKind::Geometry: { @@ -1773,6 +1777,11 @@ void DxilMDHelper::LoadDxilEntryProperties(const MDOperand &MDO, props.numThreads[2] = ConstMDToUint32(pNode->getOperand(2)); } break; + case DxilMDHelper::kDxilMaxGroupSharedMemTag: { + DXASSERT(props.IsCS(), "else invalid shader kind"); + props.groupSharedLimitBytes = ConstMDToUint32(MDO); + } break; + case DxilMDHelper::kDxilGSStateTag: { DXASSERT(props.IsGS(), "else invalid shader kind"); auto &GS = props.ShaderProps.GS; diff --git a/lib/DxilValidation/DxilValidation.cpp b/lib/DxilValidation/DxilValidation.cpp index 2ea6701581..2d603706ce 100644 --- a/lib/DxilValidation/DxilValidation.cpp +++ b/lib/DxilValidation/DxilValidation.cpp @@ -3921,6 +3921,18 @@ static void ValidateGlobalVariables(ValidationContext &ValCtx) { Rule = ValidationRule::SmMaxMSSMSize; MaxSize = DXIL::kMaxMSSMSize; } + + // Check if the entry function has attribute to override TGSM size. + if (M.HasDxilEntryProps(M.GetEntryFunction())) { + DxilEntryProps &EntryProps = M.GetDxilEntryProps(M.GetEntryFunction()); + if (EntryProps.props.IsCS()) { + unsigned SpecifiedTGSMSize = EntryProps.props.groupSharedLimitBytes; + if (SpecifiedTGSMSize > 0) { + MaxSize = SpecifiedTGSMSize; + } + } + } + if (TGSMSize > MaxSize) { Module::global_iterator GI = M.GetModule()->global_end(); GlobalVariable *GV = &*GI; diff --git a/tools/clang/include/clang/Basic/Attr.td b/tools/clang/include/clang/Basic/Attr.td index 83137dbc3a..33f1594cac 100644 --- a/tools/clang/include/clang/Basic/Attr.td +++ b/tools/clang/include/clang/Basic/Attr.td @@ -671,6 +671,11 @@ def HLSLNumThreads: InheritableAttr { let Args = [IntArgument<"X">, IntArgument<"Y">, IntArgument<"Z">]; let Documentation = [Undocumented]; } +def HLSLGroupSharedLimit: InheritableAttr { + let Spellings = [CXX11<"", "GroupSharedLimit", 2017>]; + let Args = [IntArgument<"Limit">]; + let Documentation = [Undocumented]; +} def HLSLRootSignature: InheritableAttr { let Spellings = [CXX11<"", "RootSignature", 2015>]; let Args = [StringArgument<"SignatureName">]; diff --git a/tools/clang/lib/CodeGen/CGHLSLMS.cpp b/tools/clang/lib/CodeGen/CGHLSLMS.cpp index 6c68381a20..697f49a9c7 100644 --- a/tools/clang/lib/CodeGen/CGHLSLMS.cpp +++ b/tools/clang/lib/CodeGen/CGHLSLMS.cpp @@ -1646,6 +1646,21 @@ void CGMSHLSLRuntime::AddHLSLFunctionInfo(Function *F, const FunctionDecl *FD) { } } + if (const HLSLGroupSharedLimitAttr *Attr = FD->getAttr()) { + funcProps->groupSharedLimitBytes = Attr->getLimit(); + + if (isEntry && !SM->IsCS() && !SM->IsMS() && !SM->IsAS()) { + unsigned DiagID = Diags.getCustomDiagID( + DiagnosticsEngine::Error, + "attribute GroupSharedLimit only valid for CS/MS/AS."); + Diags.Report(Attr->getLocation(), DiagID); + return; + } + + } else { + funcProps->groupSharedLimitBytes = DXIL::kMaxTGSMSize; + } + // Hull shader. if (const HLSLPatchConstantFuncAttr *Attr = FD->getAttr()) { diff --git a/tools/clang/lib/Parse/ParseDecl.cpp b/tools/clang/lib/Parse/ParseDecl.cpp index 59be41a484..e8bea488a9 100644 --- a/tools/clang/lib/Parse/ParseDecl.cpp +++ b/tools/clang/lib/Parse/ParseDecl.cpp @@ -833,6 +833,7 @@ void Parser::ParseGNUAttributeArgs(IdentifierInfo *AttrName, case AttributeList::AT_HLSLMaxVertexCount: case AttributeList::AT_HLSLUnroll: case AttributeList::AT_HLSLWaveSize: + case AttributeList::AT_HLSLGroupSharedLimit: case AttributeList::AT_NoInline: // The following are not accepted in [attribute(param)] syntax: // case AttributeList::AT_HLSLCentroid: diff --git a/tools/clang/lib/Sema/SemaHLSL.cpp b/tools/clang/lib/Sema/SemaHLSL.cpp index e9c8c90a2d..0a0234d392 100644 --- a/tools/clang/lib/Sema/SemaHLSL.cpp +++ b/tools/clang/lib/Sema/SemaHLSL.cpp @@ -14656,6 +14656,11 @@ void hlsl::HandleDeclAttributeForHLSL(Sema &S, Decl *D, const AttributeList &A, S.Context.getAddrSpaceQualType(VD->getType(), DXIL::kTGSMAddrSpace)); } break; + case AttributeList::AT_HLSLGroupSharedLimit: + declAttr = ::new (S.Context) HLSLGroupSharedLimitAttr( + A.getRange(), S.Context, ValidateAttributeIntArg(S, A), + A.getAttributeSpellingListIndex()); + break; case AttributeList::AT_HLSLUniform: declAttr = ::new (S.Context) HLSLUniformAttr( A.getRange(), S.Context, A.getAttributeSpellingListIndex()); From 214553db1c5737afdf9174c33c2cb65ef80d725d Mon Sep 17 00:00:00 2001 From: Jack Elliott Date: Wed, 5 Nov 2025 11:34:22 +1300 Subject: [PATCH 2/8] Initial implementation of GroupSharedLimit --- include/dxc/DXIL/DxilModule.h | 2 ++ .../DxilPipelineStateValidation.h | 23 +++++++++--- lib/DXIL/DxilModule.cpp | 10 ++++++ lib/DxilContainer/DxilContainerAssembler.cpp | 4 +++ .../DxilPipelineStateValidation.cpp | 35 +++++++++++++++++-- .../DxilContainerValidation.cpp | 7 ++-- 6 files changed, 70 insertions(+), 11 deletions(-) diff --git a/include/dxc/DXIL/DxilModule.h b/include/dxc/DXIL/DxilModule.h index 3f1ba12f86..732ce27c54 100644 --- a/include/dxc/DXIL/DxilModule.h +++ b/include/dxc/DXIL/DxilModule.h @@ -254,6 +254,8 @@ class DxilModule { void SetNumThreads(unsigned x, unsigned y, unsigned z); unsigned GetNumThreads(unsigned idx) const; + unsigned GetGroupSharedLimit() const; + // Compute shader DxilWaveSize &GetWaveSize(); const DxilWaveSize &GetWaveSize() const; diff --git a/include/dxc/DxilContainer/DxilPipelineStateValidation.h b/include/dxc/DxilContainer/DxilPipelineStateValidation.h index 83d0dae6e9..fc90e14182 100644 --- a/include/dxc/DxilContainer/DxilPipelineStateValidation.h +++ b/include/dxc/DxilContainer/DxilPipelineStateValidation.h @@ -175,6 +175,10 @@ struct PSVRuntimeInfo3 : public PSVRuntimeInfo2 { uint32_t EntryFunctionName; }; +struct PSVRuntimeInfo4 : public PSVRuntimeInfo3 { + uint32_t GroupSharedMemoryLimit; +}; + enum class PSVResourceType { Invalid = 0, @@ -474,7 +478,7 @@ class PSVSignatureElement { const uint32_t *SemanticIndexes) const; }; -#define MAX_PSV_VERSION 3 +#define MAX_PSV_VERSION 4 struct PSVInitInfo { PSVInitInfo(uint32_t psvVersion) : PSVVersion(psvVersion) {} @@ -491,7 +495,7 @@ struct PSVInitInfo { uint8_t SigPatchConstOrPrimVectors = 0; uint8_t SigOutputVectors[PSV_GS_MAX_STREAMS] = {0, 0, 0, 0}; - static_assert(MAX_PSV_VERSION == 3, "otherwise this needs updating."); + static_assert(MAX_PSV_VERSION == 4, "otherwise this needs updating."); uint32_t RuntimeInfoSize() const { switch (PSVVersion) { case 0: @@ -500,10 +504,12 @@ struct PSVInitInfo { return sizeof(PSVRuntimeInfo1); case 2: return sizeof(PSVRuntimeInfo2); + case 3: + return sizeof(PSVRuntimeInfo3); default: break; } - return sizeof(PSVRuntimeInfo3); + return sizeof(PSVRuntimeInfo4); } uint32_t ResourceBindInfoSize() const { if (PSVVersion < 2) @@ -519,6 +525,7 @@ class DxilPipelineStateValidation { PSVRuntimeInfo1 *m_pPSVRuntimeInfo1 = nullptr; PSVRuntimeInfo2 *m_pPSVRuntimeInfo2 = nullptr; PSVRuntimeInfo3 *m_pPSVRuntimeInfo3 = nullptr; + PSVRuntimeInfo4 *m_pPSVRuntimeInfo4 = nullptr; uint32_t m_uResourceCount = 0; uint32_t m_uPSVResourceBindInfoSize = 0; void *m_pPSVResourceBindInfo = nullptr; @@ -634,6 +641,8 @@ class DxilPipelineStateValidation { PSVRuntimeInfo3 *GetPSVRuntimeInfo3() const { return m_pPSVRuntimeInfo3; } + PSVRuntimeInfo4 *GetPSVRuntimeInfo4() const { return m_pPSVRuntimeInfo4; } + uint32_t GetBindCount() const { return m_uResourceCount; } template @@ -949,6 +958,8 @@ DxilPipelineStateValidation::ReadOrWrite(const void *pBits, uint32_t *pSize, m_uPSVRuntimeInfoSize); // failure ok AssignDerived(&m_pPSVRuntimeInfo3, m_pPSVRuntimeInfo0, m_uPSVRuntimeInfoSize); // failure ok + AssignDerived(&m_pPSVRuntimeInfo4, m_pPSVRuntimeInfo0, + m_uPSVRuntimeInfoSize); // failure ok // In RWMode::CalcSize, use temp runtime info to hold needed values from // initInfo @@ -1137,11 +1148,13 @@ void SetupPSVInitInfo(PSVInitInfo &InitInfo, const DxilModule &DM); void SetShaderProps(PSVRuntimeInfo0 *pInfo, const DxilModule &DM); void SetShaderProps(PSVRuntimeInfo1 *pInfo1, const DxilModule &DM); void SetShaderProps(PSVRuntimeInfo2 *pInfo2, const DxilModule &DM); +void SetShaderProps(PSVRuntimeInfo4 *pInfo4, const DxilModule &DM); void PrintPSVRuntimeInfo(llvm::raw_ostream &OS, PSVRuntimeInfo0 *pInfo0, PSVRuntimeInfo1 *pInfo1, PSVRuntimeInfo2 *pInfo2, - PSVRuntimeInfo3 *pInfo3, uint8_t ShaderKind, - const char *EntryName, const char *Comment); + PSVRuntimeInfo3 *pInfo3, PSVRuntimeInfo4 *pInfo4, + uint8_t ShaderKind, const char *EntryName, + const char *Comment); } // namespace hlsl diff --git a/lib/DXIL/DxilModule.cpp b/lib/DXIL/DxilModule.cpp index f4abdd15aa..707258875d 100644 --- a/lib/DXIL/DxilModule.cpp +++ b/lib/DXIL/DxilModule.cpp @@ -412,6 +412,16 @@ unsigned DxilModule::GetNumThreads(unsigned idx) const { return props.numThreads[idx]; } +unsigned DxilModule::GetGroupSharedLimit() const { + DXASSERT(m_DxilEntryPropsMap.size() == 1 && + (m_pSM->IsCS() || m_pSM->IsMS() || m_pSM->IsAS()), + "only works for CS/MS/AS profiles"); + const DxilFunctionProps &props = m_DxilEntryPropsMap.begin()->second->props; + DXASSERT_NOMSG(m_pSM->GetKind() == props.shaderKind); + return props.groupSharedLimitBytes; + } + + DxilWaveSize &DxilModule::GetWaveSize() { return const_cast( static_cast(this)->GetWaveSize()); diff --git a/lib/DxilContainer/DxilContainerAssembler.cpp b/lib/DxilContainer/DxilContainerAssembler.cpp index 48d8872733..736940b325 100644 --- a/lib/DxilContainer/DxilContainerAssembler.cpp +++ b/lib/DxilContainer/DxilContainerAssembler.cpp @@ -798,6 +798,8 @@ class DxilPSVWriter : public DxilPartWriter { PSVRuntimeInfo1 *pInfo1 = m_PSV.GetPSVRuntimeInfo1(); PSVRuntimeInfo2 *pInfo2 = m_PSV.GetPSVRuntimeInfo2(); PSVRuntimeInfo3 *pInfo3 = m_PSV.GetPSVRuntimeInfo3(); + PSVRuntimeInfo4 *pInfo4 = m_PSV.GetPSVRuntimeInfo4(); + if (pInfo) hlsl::SetShaderProps(pInfo, m_Module); if (pInfo1) @@ -806,6 +808,8 @@ class DxilPSVWriter : public DxilPartWriter { hlsl::SetShaderProps(pInfo2, m_Module); if (pInfo3) pInfo3->EntryFunctionName = EntryFunctionName; + if (pInfo4) + hlsl::SetShaderProps(pInfo4, m_Module); // Set resource binding information UINT uResIndex = 0; diff --git a/lib/DxilContainer/DxilPipelineStateValidation.cpp b/lib/DxilContainer/DxilPipelineStateValidation.cpp index 66186549f2..7d1cb60ccf 100644 --- a/lib/DxilContainer/DxilPipelineStateValidation.cpp +++ b/lib/DxilContainer/DxilPipelineStateValidation.cpp @@ -305,6 +305,21 @@ void hlsl::SetShaderProps(PSVRuntimeInfo2 *pInfo2, const DxilModule &DM) { } } +void hlsl::SetShaderProps(PSVRuntimeInfo4 *pInfo4, const DxilModule &DM) { + assert(pInfo4); + const ShaderModel* SM = DM.GetShaderModel(); + switch (SM->GetKind()) + { + case ShaderModel::Kind::Compute: + case ShaderModel::Kind::Mesh: + case ShaderModel::Kind::Amplification: + pInfo4->GroupSharedMemoryLimit = DM.GetGroupSharedLimit(); + break; + default: + break; + } +} + void PSVResourceBindInfo0::Print(raw_ostream &OS) const { OS << "PSVResourceBindInfo:\n"; OS << " Space: " << Space << "\n"; @@ -584,8 +599,9 @@ void PSVDependencyTable::Print(raw_ostream &OS, const char *InputSetName, void hlsl::PrintPSVRuntimeInfo(llvm::raw_ostream &OS, PSVRuntimeInfo0 *pInfo0, PSVRuntimeInfo1 *pInfo1, PSVRuntimeInfo2 *pInfo2, - PSVRuntimeInfo3 *pInfo3, uint8_t ShaderKind, - const char *EntryName, const char *Comment) { + PSVRuntimeInfo3 *pInfo3, PSVRuntimeInfo4 *pInfo4, + uint8_t ShaderKind, const char *EntryName, + const char *Comment) { if (pInfo1 && pInfo1->ShaderStage != ShaderKind) ShaderKind = pInfo1->ShaderStage; OS << Comment << "PSVRuntimeInfo:\n"; @@ -808,6 +824,10 @@ void hlsl::PrintPSVRuntimeInfo(llvm::raw_ostream &OS, PSVRuntimeInfo0 *pInfo0, OS << Comment << " NumThreads=(" << pInfo2->NumThreadsX << "," << pInfo2->NumThreadsY << "," << pInfo2->NumThreadsZ << ")\n"; } + if (pInfo4) { + OS << Comment << " GroupSharedMemoryLimit=" + << pInfo4->GroupSharedMemoryLimit << "\n"; + } break; case PSVShaderKind::Amplification: OS << Comment << " Amplification Shader\n"; @@ -815,6 +835,10 @@ void hlsl::PrintPSVRuntimeInfo(llvm::raw_ostream &OS, PSVRuntimeInfo0 *pInfo0, OS << Comment << " NumThreads=(" << pInfo2->NumThreadsX << "," << pInfo2->NumThreadsY << "," << pInfo2->NumThreadsZ << ")\n"; } + if (pInfo4) { + OS << Comment << " GroupSharedMemoryLimit=" + << pInfo4->GroupSharedMemoryLimit << "\n"; + } break; case PSVShaderKind::Mesh: OS << Comment << " Mesh Shader\n"; @@ -841,6 +865,10 @@ void hlsl::PrintPSVRuntimeInfo(llvm::raw_ostream &OS, PSVRuntimeInfo0 *pInfo0, OS << Comment << " NumThreads=(" << pInfo2->NumThreadsX << "," << pInfo2->NumThreadsY << "," << pInfo2->NumThreadsZ << ")\n"; } + if (pInfo4) { + OS << Comment << " GroupSharedMemoryLimit=" + << pInfo4->GroupSharedMemoryLimit << "\n"; + } break; case PSVShaderKind::Library: case PSVShaderKind::Invalid: @@ -887,9 +915,10 @@ void DxilPipelineStateValidation::PrintPSVRuntimeInfo( PSVRuntimeInfo1 *pInfo1 = m_pPSVRuntimeInfo1; PSVRuntimeInfo2 *pInfo2 = m_pPSVRuntimeInfo2; PSVRuntimeInfo3 *pInfo3 = m_pPSVRuntimeInfo3; + PSVRuntimeInfo4 *pInfo4 = m_pPSVRuntimeInfo4; hlsl::PrintPSVRuntimeInfo( - OS, pInfo0, pInfo1, pInfo2, pInfo3, ShaderKind, + OS, pInfo0, pInfo1, pInfo2, pInfo3, pInfo4, ShaderKind, m_pPSVRuntimeInfo3 ? m_StringTable.Get(pInfo3->EntryFunctionName) : "", Comment); } diff --git a/lib/DxilValidation/DxilContainerValidation.cpp b/lib/DxilValidation/DxilContainerValidation.cpp index 89e23767fe..ec5e69aa0a 100644 --- a/lib/DxilValidation/DxilContainerValidation.cpp +++ b/lib/DxilValidation/DxilContainerValidation.cpp @@ -413,12 +413,13 @@ void PSVContentVerifier::VerifyEntryProperties(const ShaderModel *SM, PSVRuntimeInfo0 *PSV0, PSVRuntimeInfo1 *PSV1, PSVRuntimeInfo2 *PSV2) { - PSVRuntimeInfo3 DMPSV; - memset(&DMPSV, 0, sizeof(PSVRuntimeInfo3)); + PSVRuntimeInfo4 DMPSV; + memset(&DMPSV, 0, sizeof(PSVRuntimeInfo4)); hlsl::SetShaderProps((PSVRuntimeInfo0 *)&DMPSV, DM); hlsl::SetShaderProps((PSVRuntimeInfo1 *)&DMPSV, DM); hlsl::SetShaderProps((PSVRuntimeInfo2 *)&DMPSV, DM); + hlsl::SetShaderProps((PSVRuntimeInfo4 *)&DMPSV, DM); if (PSV1) { // Init things not set in InitPSVRuntimeInfo. DMPSV.ShaderStage = static_cast(SM->GetKind()); @@ -447,7 +448,7 @@ void PSVContentVerifier::VerifyEntryProperties(const ShaderModel *SM, if (Mismatched) { std::string Str; raw_string_ostream OS(Str); - hlsl::PrintPSVRuntimeInfo(OS, &DMPSV, &DMPSV, &DMPSV, &DMPSV, + hlsl::PrintPSVRuntimeInfo(OS, &DMPSV, &DMPSV, &DMPSV, &DMPSV, &DMPSV, static_cast(SM->GetKind()), DM.GetEntryFunctionName().c_str(), ""); OS.flush(); From 9b2e89dd5252510092279f5218f38baaaceeea33 Mon Sep 17 00:00:00 2001 From: Jack Elliott Date: Thu, 6 Nov 2025 10:03:43 +1300 Subject: [PATCH 3/8] Handle difference between MS and CS/AS and add a simple test --- .../DxilPipelineStateValidation.h | 2 +- .../DxilPipelineStateValidation.cpp | 14 +-- tools/clang/lib/CodeGen/CGHLSLMS.cpp | 20 ++++- .../entry/attributes/GroupSharedLimit.hlsl | 85 +++++++++++++++++++ 4 files changed, 110 insertions(+), 11 deletions(-) create mode 100644 tools/clang/test/HLSLFileCheck/hlsl/entry/attributes/GroupSharedLimit.hlsl diff --git a/include/dxc/DxilContainer/DxilPipelineStateValidation.h b/include/dxc/DxilContainer/DxilPipelineStateValidation.h index fc90e14182..2cf13f3a84 100644 --- a/include/dxc/DxilContainer/DxilPipelineStateValidation.h +++ b/include/dxc/DxilContainer/DxilPipelineStateValidation.h @@ -176,7 +176,7 @@ struct PSVRuntimeInfo3 : public PSVRuntimeInfo2 { }; struct PSVRuntimeInfo4 : public PSVRuntimeInfo3 { - uint32_t GroupSharedMemoryLimit; + uint32_t GroupSharedLimit; }; enum class PSVResourceType { diff --git a/lib/DxilContainer/DxilPipelineStateValidation.cpp b/lib/DxilContainer/DxilPipelineStateValidation.cpp index 7d1cb60ccf..b92be998bf 100644 --- a/lib/DxilContainer/DxilPipelineStateValidation.cpp +++ b/lib/DxilContainer/DxilPipelineStateValidation.cpp @@ -313,7 +313,7 @@ void hlsl::SetShaderProps(PSVRuntimeInfo4 *pInfo4, const DxilModule &DM) { case ShaderModel::Kind::Compute: case ShaderModel::Kind::Mesh: case ShaderModel::Kind::Amplification: - pInfo4->GroupSharedMemoryLimit = DM.GetGroupSharedLimit(); + pInfo4->GroupSharedLimit = DM.GetGroupSharedLimit(); break; default: break; @@ -825,8 +825,8 @@ void hlsl::PrintPSVRuntimeInfo(llvm::raw_ostream &OS, PSVRuntimeInfo0 *pInfo0, << pInfo2->NumThreadsY << "," << pInfo2->NumThreadsZ << ")\n"; } if (pInfo4) { - OS << Comment << " GroupSharedMemoryLimit=" - << pInfo4->GroupSharedMemoryLimit << "\n"; + OS << Comment << " GroupSharedLimit=" + << pInfo4->GroupSharedLimit << "\n"; } break; case PSVShaderKind::Amplification: @@ -836,8 +836,8 @@ void hlsl::PrintPSVRuntimeInfo(llvm::raw_ostream &OS, PSVRuntimeInfo0 *pInfo0, << pInfo2->NumThreadsY << "," << pInfo2->NumThreadsZ << ")\n"; } if (pInfo4) { - OS << Comment << " GroupSharedMemoryLimit=" - << pInfo4->GroupSharedMemoryLimit << "\n"; + OS << Comment << " GroupSharedLimit=" + << pInfo4->GroupSharedLimit << "\n"; } break; case PSVShaderKind::Mesh: @@ -866,8 +866,8 @@ void hlsl::PrintPSVRuntimeInfo(llvm::raw_ostream &OS, PSVRuntimeInfo0 *pInfo0, << pInfo2->NumThreadsY << "," << pInfo2->NumThreadsZ << ")\n"; } if (pInfo4) { - OS << Comment << " GroupSharedMemoryLimit=" - << pInfo4->GroupSharedMemoryLimit << "\n"; + OS << Comment << " GroupSharedLimit=" + << pInfo4->GroupSharedLimit << "\n"; } break; case PSVShaderKind::Library: diff --git a/tools/clang/lib/CodeGen/CGHLSLMS.cpp b/tools/clang/lib/CodeGen/CGHLSLMS.cpp index 697f49a9c7..c66407fded 100644 --- a/tools/clang/lib/CodeGen/CGHLSLMS.cpp +++ b/tools/clang/lib/CodeGen/CGHLSLMS.cpp @@ -1647,8 +1647,6 @@ void CGMSHLSLRuntime::AddHLSLFunctionInfo(Function *F, const FunctionDecl *FD) { } if (const HLSLGroupSharedLimitAttr *Attr = FD->getAttr()) { - funcProps->groupSharedLimitBytes = Attr->getLimit(); - if (isEntry && !SM->IsCS() && !SM->IsMS() && !SM->IsAS()) { unsigned DiagID = Diags.getCustomDiagID( DiagnosticsEngine::Error, @@ -1657,8 +1655,24 @@ void CGMSHLSLRuntime::AddHLSLFunctionInfo(Function *F, const FunctionDecl *FD) { return; } + // Only valid for SM6.10+ + if (!SM->IsSM610Plus()) { + unsigned DiagID = Diags.getCustomDiagID( + DiagnosticsEngine::Error, + "attribute GroupSharedLimit only valid for Shader Model 6.10 and above."); + Diags.Report(Attr->getLocation(), DiagID); + return; + } + + funcProps->groupSharedLimitBytes = Attr->getLimit(); } else { - funcProps->groupSharedLimitBytes = DXIL::kMaxTGSMSize; + if (SM->IsMS()) { // Fallback to default limits + funcProps->groupSharedLimitBytes = DXIL::kMaxMSSMSize; // 28k For MS + } else if (SM->IsAS() || SM->IsCS()) { + funcProps->groupSharedLimitBytes = DXIL::kMaxTGSMSize; // 32k For AS/CS + } else { + funcProps->groupSharedLimitBytes = 0; + } } // Hull shader. diff --git a/tools/clang/test/HLSLFileCheck/hlsl/entry/attributes/GroupSharedLimit.hlsl b/tools/clang/test/HLSLFileCheck/hlsl/entry/attributes/GroupSharedLimit.hlsl new file mode 100644 index 0000000000..cc91801263 --- /dev/null +++ b/tools/clang/test/HLSLFileCheck/hlsl/entry/attributes/GroupSharedLimit.hlsl @@ -0,0 +1,85 @@ +// RUN: %dxc -E MainPass -T cs_6_10 %s | FileCheck %s + +#define NUM_BYTES_OF_SHARED_MEM (32*1024) +#define NUM_DWORDS_SHARED_MEM (NUM_BYTES_OF_SHARED_MEM / 4) +#define THREAD_GROUP_SIZE_X 1024 + +groupshared uint g_testBufferPASS[NUM_DWORDS_SHARED_MEM]; + +RWStructuredBuffer g_output : register(u0); + +// CHECK: @MainPass + +[GroupSharedLimit(NUM_BYTES_OF_SHARED_MEM)] +[numthreads(THREAD_GROUP_SIZE_X, 1, 1)] +void MainPass( uint3 DTid : SV_DispatchThreadID ) +{ + uint iterations = NUM_DWORDS_SHARED_MEM / THREAD_GROUP_SIZE_X; + + for (uint i = 0; i < iterations; i++) + { + uint index = DTid.x + i * THREAD_GROUP_SIZE_X; + g_testBufferPASS[index] = index; + } + + // synchronize all threads in the group + GroupMemoryBarrierWithGroupSync(); + + // write the shared data to the output buffer + for (uint i = 0; i < iterations; i++) + { + uint index = DTid.x + i * THREAD_GROUP_SIZE_X; + g_output[index] = g_testBufferPASS[index]; + } +} + +// RUN: not %dxc -E MainFail -T cs_6_10 %s 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR +// CHECK-ERROR: Total Thread Group Shared Memory storage is 32772, exceeded 32768. + +groupshared uint g_testBufferFAIL[NUM_DWORDS_SHARED_MEM + 1]; + +[GroupSharedLimit(NUM_BYTES_OF_SHARED_MEM)] +[numthreads(THREAD_GROUP_SIZE_X, 1, 1)] +void MainFail( uint3 DTid : SV_DispatchThreadID ) +{ + uint iterations = NUM_DWORDS_SHARED_MEM / THREAD_GROUP_SIZE_X; + + for (uint i = 0; i < iterations; i++) + { + uint index = DTid.x + i * THREAD_GROUP_SIZE_X; + g_testBufferFAIL[index] = index; + } + + // synchronize all threads in the group + GroupMemoryBarrierWithGroupSync(); + + // write the shared data to the output buffer + for (uint i = 0; i < iterations; i++) + { + uint index = DTid.x + i * THREAD_GROUP_SIZE_X; + g_output[index] = g_testBufferFAIL[index]; + } +} + +// RUN: not %dxc -E MainFail2 -T cs_6_10 %s 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR +[numthreads(THREAD_GROUP_SIZE_X, 1, 1)] +void MainFail2( uint3 DTid : SV_DispatchThreadID ) +{ + uint iterations = NUM_DWORDS_SHARED_MEM / THREAD_GROUP_SIZE_X; + + for (uint i = 0; i < iterations; i++) + { + uint index = DTid.x + i * THREAD_GROUP_SIZE_X; + g_testBufferFAIL[index] = index; + } + + // synchronize all threads in the group + GroupMemoryBarrierWithGroupSync(); + + // write the shared data to the output buffer + for (uint i = 0; i < iterations; i++) + { + uint index = DTid.x + i * THREAD_GROUP_SIZE_X; + g_output[index] = g_testBufferFAIL[index]; + } +} \ No newline at end of file From 1084671dfbb66cc17725a3780fdb443d843332a3 Mon Sep 17 00:00:00 2001 From: Jack Elliott Date: Fri, 7 Nov 2025 07:09:07 +1300 Subject: [PATCH 4/8] clang format --- .../DxilPipelineStateValidation.h | 2 +- lib/DXIL/DxilMetadataHelper.cpp | 4 +- lib/DXIL/DxilModule.cpp | 7 +- .../DxilPipelineStateValidation.cpp | 34 +- lib/DxilValidation/DxilValidation.cpp | 5 +- tools/clang/include/clang/Basic/Attr.td | 559 +++--- tools/clang/lib/CodeGen/CGHLSLMS.cpp | 51 +- tools/clang/lib/Parse/ParseDecl.cpp | 1593 +++++++++-------- tools/clang/lib/Sema/SemaHLSL.cpp | 44 +- 9 files changed, 1212 insertions(+), 1087 deletions(-) diff --git a/include/dxc/DxilContainer/DxilPipelineStateValidation.h b/include/dxc/DxilContainer/DxilPipelineStateValidation.h index 2cf13f3a84..1a8229e783 100644 --- a/include/dxc/DxilContainer/DxilPipelineStateValidation.h +++ b/include/dxc/DxilContainer/DxilPipelineStateValidation.h @@ -1148,7 +1148,7 @@ void SetupPSVInitInfo(PSVInitInfo &InitInfo, const DxilModule &DM); void SetShaderProps(PSVRuntimeInfo0 *pInfo, const DxilModule &DM); void SetShaderProps(PSVRuntimeInfo1 *pInfo1, const DxilModule &DM); void SetShaderProps(PSVRuntimeInfo2 *pInfo2, const DxilModule &DM); -void SetShaderProps(PSVRuntimeInfo4 *pInfo4, const DxilModule &DM); +void SetShaderProps(PSVRuntimeInfo4 *Info4, const DxilModule &DM); void PrintPSVRuntimeInfo(llvm::raw_ostream &OS, PSVRuntimeInfo0 *pInfo0, PSVRuntimeInfo1 *pInfo1, PSVRuntimeInfo2 *pInfo2, diff --git a/lib/DXIL/DxilMetadataHelper.cpp b/lib/DXIL/DxilMetadataHelper.cpp index 4d60696edf..2edf33b41e 100644 --- a/lib/DXIL/DxilMetadataHelper.cpp +++ b/lib/DXIL/DxilMetadataHelper.cpp @@ -1625,9 +1625,9 @@ MDTuple *DxilMDHelper::EmitDxilEntryProperties(uint64_t rawShaderFlag, MDVals.emplace_back(MDNode::get(m_Ctx, WaveSizeVal)); } - MDVals.emplace_back(Uint32ToConstMD(DxilMDHelper::kDxilMaxGroupSharedMemTag)); MDVals.emplace_back( - Uint32ToConstMD(props.groupSharedLimitBytes)); + Uint32ToConstMD(DxilMDHelper::kDxilMaxGroupSharedMemTag)); + MDVals.emplace_back(Uint32ToConstMD(props.groupSharedLimitBytes)); } break; // Geometry shader. case DXIL::ShaderKind::Geometry: { diff --git a/lib/DXIL/DxilModule.cpp b/lib/DXIL/DxilModule.cpp index 707258875d..15b4079b4d 100644 --- a/lib/DXIL/DxilModule.cpp +++ b/lib/DXIL/DxilModule.cpp @@ -413,14 +413,13 @@ unsigned DxilModule::GetNumThreads(unsigned idx) const { } unsigned DxilModule::GetGroupSharedLimit() const { - DXASSERT(m_DxilEntryPropsMap.size() == 1 && - (m_pSM->IsCS() || m_pSM->IsMS() || m_pSM->IsAS()), + DXASSERT(m_DxilEntryPropsMap.size() == 1 && + (m_pSM->IsCS() || m_pSM->IsMS() || m_pSM->IsAS()), "only works for CS/MS/AS profiles"); const DxilFunctionProps &props = m_DxilEntryPropsMap.begin()->second->props; DXASSERT_NOMSG(m_pSM->GetKind() == props.shaderKind); return props.groupSharedLimitBytes; - } - +} DxilWaveSize &DxilModule::GetWaveSize() { return const_cast( diff --git a/lib/DxilContainer/DxilPipelineStateValidation.cpp b/lib/DxilContainer/DxilPipelineStateValidation.cpp index b92be998bf..6aeff10e06 100644 --- a/lib/DxilContainer/DxilPipelineStateValidation.cpp +++ b/lib/DxilContainer/DxilPipelineStateValidation.cpp @@ -305,19 +305,18 @@ void hlsl::SetShaderProps(PSVRuntimeInfo2 *pInfo2, const DxilModule &DM) { } } -void hlsl::SetShaderProps(PSVRuntimeInfo4 *pInfo4, const DxilModule &DM) { - assert(pInfo4); - const ShaderModel* SM = DM.GetShaderModel(); - switch (SM->GetKind()) - { - case ShaderModel::Kind::Compute: - case ShaderModel::Kind::Mesh: - case ShaderModel::Kind::Amplification: - pInfo4->GroupSharedLimit = DM.GetGroupSharedLimit(); - break; - default: - break; - } +void hlsl::SetShaderProps(PSVRuntimeInfo4 *Info4, const DxilModule &DM) { + assert(Info4); + const ShaderModel *SM = DM.GetShaderModel(); + switch (SM->GetKind()) { + case ShaderModel::Kind::Compute: + case ShaderModel::Kind::Mesh: + case ShaderModel::Kind::Amplification: + Info4->GroupSharedLimit = DM.GetGroupSharedLimit(); + break; + default: + break; + } } void PSVResourceBindInfo0::Print(raw_ostream &OS) const { @@ -825,8 +824,7 @@ void hlsl::PrintPSVRuntimeInfo(llvm::raw_ostream &OS, PSVRuntimeInfo0 *pInfo0, << pInfo2->NumThreadsY << "," << pInfo2->NumThreadsZ << ")\n"; } if (pInfo4) { - OS << Comment << " GroupSharedLimit=" - << pInfo4->GroupSharedLimit << "\n"; + OS << Comment << " GroupSharedLimit=" << pInfo4->GroupSharedLimit << "\n"; } break; case PSVShaderKind::Amplification: @@ -836,8 +834,7 @@ void hlsl::PrintPSVRuntimeInfo(llvm::raw_ostream &OS, PSVRuntimeInfo0 *pInfo0, << pInfo2->NumThreadsY << "," << pInfo2->NumThreadsZ << ")\n"; } if (pInfo4) { - OS << Comment << " GroupSharedLimit=" - << pInfo4->GroupSharedLimit << "\n"; + OS << Comment << " GroupSharedLimit=" << pInfo4->GroupSharedLimit << "\n"; } break; case PSVShaderKind::Mesh: @@ -866,8 +863,7 @@ void hlsl::PrintPSVRuntimeInfo(llvm::raw_ostream &OS, PSVRuntimeInfo0 *pInfo0, << pInfo2->NumThreadsY << "," << pInfo2->NumThreadsZ << ")\n"; } if (pInfo4) { - OS << Comment << " GroupSharedLimit=" - << pInfo4->GroupSharedLimit << "\n"; + OS << Comment << " GroupSharedLimit=" << pInfo4->GroupSharedLimit << "\n"; } break; case PSVShaderKind::Library: diff --git a/lib/DxilValidation/DxilValidation.cpp b/lib/DxilValidation/DxilValidation.cpp index 2d603706ce..b065fe5e29 100644 --- a/lib/DxilValidation/DxilValidation.cpp +++ b/lib/DxilValidation/DxilValidation.cpp @@ -3927,9 +3927,8 @@ static void ValidateGlobalVariables(ValidationContext &ValCtx) { DxilEntryProps &EntryProps = M.GetDxilEntryProps(M.GetEntryFunction()); if (EntryProps.props.IsCS()) { unsigned SpecifiedTGSMSize = EntryProps.props.groupSharedLimitBytes; - if (SpecifiedTGSMSize > 0) { - MaxSize = SpecifiedTGSMSize; - } + if (SpecifiedTGSMSize > 0) + MaxSize = SpecifiedTGSMSize; } } diff --git a/tools/clang/include/clang/Basic/Attr.td b/tools/clang/include/clang/Basic/Attr.td index 33f1594cac..1697efe86d 100644 --- a/tools/clang/include/clang/Basic/Attr.td +++ b/tools/clang/include/clang/Basic/Attr.td @@ -47,9 +47,7 @@ class Documentation { // Specifies that the attribute is explicitly undocumented. This can be a // helpful placeholder for the attribute while working on the implementation, // but should not be used once feature work has been completed. -def Undocumented : Documentation { - let Category = DocCatUndocumented; -} +def Undocumented : Documentation { let Category = DocCatUndocumented; } include "clang/Basic/AttrDocs.td" @@ -75,34 +73,29 @@ class SubsetSubject : AttrSubject { // This is the type of a variable which C++11 allows alignas(...) to appertain // to. -def NormalVar : SubsetSubjectgetStorageClass() != VarDecl::Register && +def NormalVar + : SubsetSubjectgetStorageClass() != VarDecl::Register && S->getKind() != Decl::ImplicitParam && S->getKind() != Decl::ParmVar && S->getKind() != Decl::NonTypeTemplateParm}]>; -def NonBitField : SubsetSubjectisBitField()}]>; +def NonBitField : SubsetSubjectisBitField()}]>; -def ObjCInstanceMethod : SubsetSubjectisInstanceMethod()}]>; +def ObjCInstanceMethod : SubsetSubjectisInstanceMethod()}]>; -def ObjCInterfaceDeclInitMethod : SubsetSubjectgetMethodFamily() == OMF_init && +def ObjCInterfaceDeclInitMethod + : SubsetSubjectgetMethodFamily() == OMF_init && (isa(S->getDeclContext()) || (isa(S->getDeclContext()) && cast(S->getDeclContext())->IsClassExtension()))}]>; -def Struct : SubsetSubjectisUnion()}]>; +def Struct : SubsetSubjectisUnion()}]>; -def TLSVar : SubsetSubjectgetTLSKind() != 0}]>; +def TLSVar : SubsetSubjectgetTLSKind() != 0}]>; -def SharedVar : SubsetSubjecthasGlobalStorage() && !S->getTLSKind()}]>; +def SharedVar + : SubsetSubjecthasGlobalStorage() && !S->getTLSKind()}]>; -def GlobalVar : SubsetSubjecthasGlobalStorage()}]>; +def GlobalVar : SubsetSubjecthasGlobalStorage()}]>; // FIXME: this hack is needed because DeclNodes.td defines the base Decl node // type to be a class, not a definition. This makes it impossible to create an @@ -110,8 +103,8 @@ def GlobalVar : SubsetSubjectgetFunctionType(false) != NULL}]>; +def FunctionLike + : SubsetSubjectgetFunctionType(false) != NULL}]>; def OpenCLKernelFunction : SubsetSubjecthasAttr() @@ -120,8 +113,8 @@ def OpenCLKernelFunction : SubsetSubjectgetFunctionType(true) != NULL && +def HasFunctionProto + : SubsetSubjectgetFunctionType(true) != NULL && isa(S->getFunctionType())) || isa(S) || isa(S)}]>; @@ -174,7 +167,7 @@ class EnumArgument values, // FIXME: There should be a VariadicArgument type that takes any other type // of argument and generates the appropriate type. class VariadicEnumArgument values, - list enums> : Argument { + list enums> : Argument { string Type = type; list Values = values; list Enums = enums; @@ -202,18 +195,14 @@ class Pragma : Spelling { // The GCC spelling implies GNU and CXX11<"gnu", name> and also // sets KnownToGCC to 1. This spelling should be used for any GCC-compatible // attributes. -class GCC : Spelling { - let KnownToGCC = 1; -} +class GCC : Spelling { let KnownToGCC = 1; } class Accessor spellings> { string Name = name; list Spellings = spellings; } -class SubjectDiag { - bit Warn = warn; -} +class SubjectDiag { bit Warn = warn; } def WarnDiag : SubjectDiag<1>; def ErrorDiag : SubjectDiag<0>; @@ -354,13 +343,13 @@ def Alias : Attr { def Aligned : InheritableAttr { let Spellings = [GCC<"aligned">, Declspec<"align">, Keyword<"alignas">, Keyword<"_Alignas">]; -// let Subjects = SubjectList<[NonBitField, NormalVar, Tag]>; + // let Subjects = SubjectList<[NonBitField, NormalVar, Tag]>; let Args = [AlignedArgument<"Alignment", 1>]; let Accessors = [Accessor<"isGNU", [GCC<"aligned">]>, Accessor<"isC11", [Keyword<"_Alignas">]>, Accessor<"isAlignas", [Keyword<"alignas">, Keyword<"_Alignas">]>, - Accessor<"isDeclspec",[Declspec<"align">]>]; + Accessor<"isDeclspec", [Declspec<"align">]>]; let Documentation = [Undocumented]; } @@ -377,8 +366,8 @@ def AlignValue : Attr { // , Declspec<"align_value"> ]; let Args = [ExprArgument<"Alignment">]; - let Subjects = SubjectList<[Var, TypedefName], WarnDiag, - "ExpectedVariableOrTypedef">; + let Subjects = + SubjectList<[Var, TypedefName], WarnDiag, "ExpectedVariableOrTypedef">; let Documentation = [AlignValueDocs]; } @@ -417,10 +406,9 @@ def ARMInterrupt : InheritableAttr, TargetSpecificAttr { // NOTE: If you add any additional spellings, MSP430Interrupt's spellings // must match. let Spellings = [GNU<"interrupt">]; - let Args = [EnumArgument<"Interrupt", "InterruptType", - ["IRQ", "FIQ", "SWI", "ABORT", "UNDEF", ""], - ["IRQ", "FIQ", "SWI", "ABORT", "UNDEF", "Generic"], - 1>]; + let Args = [EnumArgument< + "Interrupt", "InterruptType", ["IRQ", "FIQ", "SWI", "ABORT", "UNDEF", ""], + ["IRQ", "FIQ", "SWI", "ABORT", "UNDEF", "Generic"], 1>]; let ParseKind = "Interrupt"; let HasCustomParsing = 1; let Documentation = [ARMInterruptDocs]; @@ -439,7 +427,7 @@ def Availability : InheritableAttr { VersionArgument<"deprecated">, VersionArgument<"obsoleted">, BoolArgument<"unavailable">, StringArgument<"message">]; let AdditionalMembers = -[{static llvm::StringRef getPrettyPlatformName(llvm::StringRef Platform) { + [{static llvm::StringRef getPrettyPlatformName(llvm::StringRef Platform) { return llvm::StringSwitch(Platform) .Case("android", "Android") .Case("ios", "iOS") @@ -450,7 +438,7 @@ def Availability : InheritableAttr { } }]; let HasCustomParsing = 1; let DuplicatesAllowedWhileMerging = 1; -// let Subjects = SubjectList<[Named]>; + // let Subjects = SubjectList<[Named]>; let Documentation = [AvailabilityDocs]; } @@ -460,20 +448,18 @@ def Blocks : InheritableAttr { let Documentation = [Undocumented]; } -def Bounded : IgnoredAttr { - let Spellings = [GNU<"bounded">]; -} +def Bounded : IgnoredAttr { let Spellings = [GNU<"bounded">]; } def CarriesDependency : InheritableParamAttr { let Spellings = [GNU<"carries_dependency">, - CXX11<"","carries_dependency", 200809>]; + CXX11<"", "carries_dependency", 200809>]; let Subjects = SubjectList<[ParmVar, ObjCMethod, Function], ErrorDiag>; let Documentation = [CarriesDependencyDocs]; } def CDecl : InheritableAttr { let Spellings = [GCC<"cdecl">, Keyword<"__cdecl">, Keyword<"_cdecl">]; -// let Subjects = [Function, ObjCMethod]; + // let Subjects = [Function, ObjCMethod]; let Documentation = [Undocumented]; } @@ -498,13 +484,13 @@ def CFUnknownTransfer : InheritableAttr { def CFReturnsRetained : InheritableAttr { let Spellings = [GNU<"cf_returns_retained">]; -// let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>; + // let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>; let Documentation = [Undocumented]; } def CFReturnsNotRetained : InheritableAttr { let Spellings = [GNU<"cf_returns_not_retained">]; -// let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>; + // let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>; let Documentation = [Undocumented]; } @@ -639,12 +625,9 @@ def HLSLUnroll : Attr { // HLSL Function Attributes def HLSLClipPlanes : InheritableAttr { let Spellings = [CXX11<"", "clipplanes", 2015>]; - let Args = [ExprArgument<"ClipPlane1">, - ExprArgument<"ClipPlane2", 1>, - ExprArgument<"ClipPlane3", 1>, - ExprArgument<"ClipPlane4", 1>, - ExprArgument<"ClipPlane5", 1>, - ExprArgument<"ClipPlane6", 1>]; + let Args = [ExprArgument<"ClipPlane1">, ExprArgument<"ClipPlane2", 1>, + ExprArgument<"ClipPlane3", 1>, ExprArgument<"ClipPlane4", 1>, + ExprArgument<"ClipPlane5", 1>, ExprArgument<"ClipPlane6", 1>]; let Documentation = [Undocumented]; } def HLSLDomain : InheritableAttr { @@ -656,59 +639,62 @@ def HLSLEarlyDepthStencil : InheritableAttr { let Spellings = [CXX11<"", "earlydepthstencil", 2015>]; let Documentation = [Undocumented]; } -def HLSLInstance: InheritableAttr { +def HLSLInstance : InheritableAttr { let Spellings = [CXX11<"", "instance", 2015>]; let Args = [IntArgument<"Count">]; let Documentation = [Undocumented]; } -def HLSLMaxTessFactor: InheritableAttr { +def HLSLMaxTessFactor : InheritableAttr { let Spellings = [CXX11<"", "maxtessfactor", 2015>]; let Args = [IntArgument<"Factor">]; let Documentation = [Undocumented]; } -def HLSLNumThreads: InheritableAttr { +def HLSLNumThreads : InheritableAttr { let Spellings = [CXX11<"", "numthreads", 2015>]; let Args = [IntArgument<"X">, IntArgument<"Y">, IntArgument<"Z">]; let Documentation = [Undocumented]; } -def HLSLGroupSharedLimit: InheritableAttr { +def HLSLGroupSharedLimit : InheritableAttr { let Spellings = [CXX11<"", "GroupSharedLimit", 2017>]; let Args = [IntArgument<"Limit">]; let Documentation = [Undocumented]; } -def HLSLRootSignature: InheritableAttr { +def HLSLRootSignature : InheritableAttr { let Spellings = [CXX11<"", "RootSignature", 2015>]; let Args = [StringArgument<"SignatureName">]; let Documentation = [Undocumented]; } -def HLSLOutputControlPoints: InheritableAttr { +def HLSLOutputControlPoints : InheritableAttr { let Spellings = [CXX11<"", "outputcontrolpoints", 2015>]; let Args = [IntArgument<"Count">]; let Documentation = [Undocumented]; } -def HLSLOutputTopology: InheritableAttr { +def HLSLOutputTopology : InheritableAttr { let Spellings = [CXX11<"", "outputtopology", 2015>]; - let Args = [StringArgument<"Topology">]; // one of point, line, triangle_cw or triangle_ccw + let Args = [StringArgument<"Topology">]; // one of point, line, triangle_cw or + // triangle_ccw let Documentation = [Undocumented]; } -def HLSLPartitioning: InheritableAttr { +def HLSLPartitioning : InheritableAttr { let Spellings = [CXX11<"", "partitioning", 2015>]; - let Args = [StringArgument<"Scheme">]; // one of integer, fractional_even, fractional_odd or pow2 + let Args = [StringArgument<"Scheme">]; // one of integer, fractional_even, + // fractional_odd or pow2 let Documentation = [Undocumented]; } -def HLSLPatchConstantFunc: InheritableAttr { +def HLSLPatchConstantFunc : InheritableAttr { let Spellings = [CXX11<"", "patchconstantfunc", 2015>]; let Args = [StringArgument<"FunctionName">]; let Documentation = [Undocumented]; } -def HLSLMaxVertexCount: InheritableAttr { +def HLSLMaxVertexCount : InheritableAttr { let Spellings = [CXX11<"", "maxvertexcount", 2015>]; let Args = [IntArgument<"Count">]; let Documentation = [Undocumented]; } -def HLSLIntrinsic: InheritableAttr { +def HLSLIntrinsic : InheritableAttr { let Spellings = [CXX11<"", "intrinsic", 2015>]; - let Args = [StringArgument<"group">, StringArgument<"lowering">, IntArgument<"opcode">]; + let Args = [StringArgument<"group">, StringArgument<"lowering">, + IntArgument<"opcode">]; let Documentation = [Undocumented]; } def HLSLPrecise : InheritableAttr { @@ -864,11 +850,13 @@ def HLSLReorderCoherent : InheritableAttr { def HLSLShader : InheritableAttr { let Spellings = [CXX11<"", "shader", 2017>]; - let Args = [StringArgument<"stage">]; // one of compute, pixel, vertex, hull, domain, geometry, node + let Args = [StringArgument<"stage">]; // one of compute, pixel, vertex, hull, + // domain, geometry, node let Documentation = [Undocumented]; } -// Add experimental target-dependent attribute to function for backend ("exp-name"="value") +// Add experimental target-dependent attribute to function for backend +// ("exp-name"="value") def HLSLExperimental : InheritableAttr { let Spellings = [CXX11<"", "experimental", 2017>]; let Args = [StringArgument<"name">, StringArgument<"value">]; @@ -919,7 +907,8 @@ def HLSLWaveSensitive : InheritableAttr { def HLSLWaveSize : InheritableAttr { let Spellings = [CXX11<"", "wavesize", 2017>]; - let Args = [IntArgument<"Min">, DefaultIntArgument<"Max", 0>, DefaultIntArgument<"Preferred", 0>]; + let Args = [IntArgument<"Min">, DefaultIntArgument<"Max", 0>, + DefaultIntArgument<"Preferred", 0>]; let Documentation = [Undocumented]; let AdditionalMembers = [{ @@ -1010,7 +999,8 @@ def HLSLResource : InheritableAttr { def HLSLNodeLaunch : InheritableAttr { let Spellings = [CXX11<"", "nodelaunch", 2017>]; - let Args = [StringArgument<"LaunchType">]; // one of broadcasting, coalescing, thread + let Args = [StringArgument<"LaunchType">]; // one of broadcasting, coalescing, + // thread let Documentation = [Undocumented]; } @@ -1021,7 +1011,7 @@ def HLSLNodeIsProgramEntry : InheritableAttr { def HLSLNodeId : InheritableAttr { let Spellings = [CXX11<"", "nodeid", 2017>]; - let Args = [StringArgument<"Name">,DefaultIntArgument<"ArrayIndex", 0>]; + let Args = [StringArgument<"Name">, DefaultIntArgument<"ArrayIndex", 0>]; let Documentation = [Undocumented]; } @@ -1033,19 +1023,21 @@ def HLSLNodeLocalRootArgumentsTableIndex : InheritableAttr { def HLSLNodeShareInputOf : InheritableAttr { let Spellings = [CXX11<"", "nodeshareinputof", 2017>]; - let Args = [StringArgument<"Name">,UnsignedArgument<"ArrayIndex", 1>]; + let Args = [StringArgument<"Name">, UnsignedArgument<"ArrayIndex", 1>]; let Documentation = [Undocumented]; } -def HLSLNodeDispatchGrid: InheritableAttr { +def HLSLNodeDispatchGrid : InheritableAttr { let Spellings = [CXX11<"", "nodedispatchgrid", 2015>]; - let Args = [UnsignedArgument<"X">, UnsignedArgument<"Y">, UnsignedArgument<"Z">]; + let Args = [UnsignedArgument<"X">, UnsignedArgument<"Y">, + UnsignedArgument<"Z">]; let Documentation = [Undocumented]; } -def HLSLNodeMaxDispatchGrid: InheritableAttr { +def HLSLNodeMaxDispatchGrid : InheritableAttr { let Spellings = [CXX11<"", "nodemaxdispatchgrid", 2015>]; - let Args = [UnsignedArgument<"X">, UnsignedArgument<"Y">, UnsignedArgument<"Z">]; + let Args = [UnsignedArgument<"X">, UnsignedArgument<"Y">, + UnsignedArgument<"Z">]; let Documentation = [Undocumented]; } @@ -1066,36 +1058,22 @@ def HLSLNodeObject : InheritableAttr { let Subjects = SubjectList<[CXXRecord]>; let Documentation = [Undocumented]; - let Args = [EnumArgument<"Type", "RecordType", - ["DispatchNodeInputRecord", - "RWDispatchNodeInputRecord", - "GroupNodeInputRecords", - "RWGroupNodeInputRecords", - "ThreadNodeInputRecord", - "RWThreadNodeInputRecord", - "EmptyNodeInput", - "NodeOutput", - "EmptyNodeOutput", - "NodeOutputArray", - "EmptyNodeOutputArray", - "GroupNodeOutputRecords", - "ThreadNodeOutputRecords"], - ["DispatchNodeInputRecord", - "RWDispatchNodeInputRecord", - "GroupNodeInputRecords", - "RWGroupNodeInputRecords", - "ThreadNodeInputRecord", - "RWThreadNodeInputRecord", - "EmptyNodeInput", - "NodeOutput", - "EmptyNodeOutput", - "NodeOutputArray", - "EmptyNodeOutputArray", - "GroupNodeOutputRecords", - "ThreadNodeOutputRecords"]>]; - - let AdditionalMembers = - [{hlsl::DXIL::NodeIOKind getNodeIOType() const { + let Args = [EnumArgument< + "Type", "RecordType", + ["DispatchNodeInputRecord", "RWDispatchNodeInputRecord", + "GroupNodeInputRecords", "RWGroupNodeInputRecords", + "ThreadNodeInputRecord", "RWThreadNodeInputRecord", "EmptyNodeInput", + "NodeOutput", "EmptyNodeOutput", "NodeOutputArray", + "EmptyNodeOutputArray", "GroupNodeOutputRecords", + "ThreadNodeOutputRecords"], + ["DispatchNodeInputRecord", "RWDispatchNodeInputRecord", + "GroupNodeInputRecords", "RWGroupNodeInputRecords", + "ThreadNodeInputRecord", "RWThreadNodeInputRecord", "EmptyNodeInput", + "NodeOutput", "EmptyNodeOutput", "NodeOutputArray", + "EmptyNodeOutputArray", "GroupNodeOutputRecords", + "ThreadNodeOutputRecords"]>]; + + let AdditionalMembers = [{hlsl::DXIL::NodeIOKind getNodeIOType() const { switch (type) { case DispatchNodeInputRecord: return hlsl::DXIL::NodeIOKind::DispatchNodeInputRecord; @@ -1184,7 +1162,8 @@ def HLSLSubObject : InheritableAttr { let Spellings = []; // No spellings! let Subjects = SubjectList<[CXXRecord]>; let Documentation = [Undocumented]; - let Args = [UnsignedArgument<"SubObjKindUint">, UnsignedArgument<"HitGroupType">]; + let Args = [UnsignedArgument<"SubObjKindUint">, + UnsignedArgument<"HitGroupType">]; } // HLSL HitObject Attribute @@ -1233,9 +1212,9 @@ def HLSLUnboundedSparseNodes : InheritableParamAttr { // SPIRV Change Starts // StructuredBuffer types that can have associated counters -def CounterStructuredBuffer : SubsetSubject< - Var, - [{S->hasGlobalStorage() && S->getType()->getAs() && +def CounterStructuredBuffer + : SubsetSubject< + Var, [{S->hasGlobalStorage() && S->getType()->getAs() && (S->getType()->getAs()->getDecl()->getName() == "RWStructuredBuffer" || S->getType()->getAs()->getDecl()->getName() == "AppendStructuredBuffer" || S->getType()->getAs()->getDecl()->getName() == "ConsumeStructuredBuffer")}]>; @@ -1243,7 +1222,8 @@ def CounterStructuredBuffer : SubsetSubject< // Array of StructuredBuffer types that can have associated counters def ArrayOfCounterStructuredBuffer : SubsetSubject< - Var, [{S->hasGlobalStorage() && S->getType()->getAsArrayTypeUnsafe() && + Var, + [{S->hasGlobalStorage() && S->getType()->getAsArrayTypeUnsafe() && S->getType()->getAsArrayTypeUnsafe()->getElementType()->getAs() && S->getType()->getAsArrayTypeUnsafe()->getElementType()->getAs()->getDecl() && (S->getType()->getAsArrayTypeUnsafe()->getElementType()->getAs()->getDecl()->getName() == @@ -1300,7 +1280,8 @@ def RWTexture // Global variable of array of "(RW|RasterizerOrdered)Texture" type def ArrayOfRWTexture : SubsetSubject< - Var, [{S->hasGlobalStorage() && S->getType()->getAsArrayTypeUnsafe() && + Var, + [{S->hasGlobalStorage() && S->getType()->getAsArrayTypeUnsafe() && S->getType()->getAsArrayTypeUnsafe()->getElementType()->getAs() && S->getType()->getAsArrayTypeUnsafe()->getElementType()->getAs()->getDecl() && (S->getType()->getAsArrayTypeUnsafe()->getElementType()->getAs()->getDecl()->getName() == @@ -1339,7 +1320,8 @@ def Buffer // Global variable or array of "[RW|RasterizerOrdered]Buffer" type def ArrayOfBuffer : SubsetSubject< - Var, [{S->hasGlobalStorage() && S->getType()->getAsArrayTypeUnsafe() && + Var, + [{S->hasGlobalStorage() && S->getType()->getAsArrayTypeUnsafe() && S->getType()->getAsArrayTypeUnsafe()->getElementType()->getAs() && S->getType()->getAsArrayTypeUnsafe()->getElementType()->getAs()->getDecl() && (S->getType()->getAsArrayTypeUnsafe()->getElementType()->getAs()->getDecl()->getName() == @@ -1408,7 +1390,8 @@ def VKBinding : InheritableAttr { def VKCapabilityExt : InheritableAttr { let Spellings = [CXX11<"vk", "ext_capability">]; - let Subjects = SubjectList<[Function, Var, ParmVar, Field, TypedefName], ErrorDiag>; + let Subjects = + SubjectList<[Function, Var, ParmVar, Field, TypedefName], ErrorDiag>; let Args = [IntArgument<"capability">]; let LangOpts = [SPIRV]; let Documentation = [Undocumented]; @@ -1416,7 +1399,9 @@ def VKCapabilityExt : InheritableAttr { def VKCounterBinding : InheritableAttr { let Spellings = [CXX11<"vk", "counter_binding">]; - let Subjects = SubjectList<[ArrayOfCounterStructuredBuffer, CounterStructuredBuffer], ErrorDiag, "ExpectedCounterStructuredBuffer">; + let Subjects = + SubjectList<[ArrayOfCounterStructuredBuffer, CounterStructuredBuffer], + ErrorDiag, "ExpectedCounterStructuredBuffer">; let Args = [IntArgument<"Binding">]; let LangOpts = [SPIRV]; let Documentation = [Undocumented]; @@ -1424,8 +1409,10 @@ def VKCounterBinding : InheritableAttr { def VKDecorateExt : InheritableAttr { let Spellings = [CXX11<"vk", "ext_decorate">]; - let Subjects = SubjectList<[Function, Var, ParmVar, Field, TypedefName], ErrorDiag>; - let Args = [UnsignedArgument<"decorate">, VariadicUnsignedArgument<"literals">]; + let Subjects = + SubjectList<[Function, Var, ParmVar, Field, TypedefName], ErrorDiag>; + let Args = [UnsignedArgument<"decorate">, + VariadicUnsignedArgument<"literals">]; let LangOpts = [SPIRV]; let Documentation = [Undocumented]; } @@ -1443,14 +1430,16 @@ def VKDecorateStringExt : InheritableAttr { let Spellings = [CXX11<"vk", "ext_decorate_string">]; let Subjects = SubjectList<[Function, Var, ParmVar, Field, TypedefName], ErrorDiag>; - let Args = [UnsignedArgument<"decorate">, VariadicStringArgument<"arguments">]; + let Args = [UnsignedArgument<"decorate">, + VariadicStringArgument<"arguments">]; let LangOpts = [SPIRV]; let Documentation = [Undocumented]; } def VKExtensionExt : InheritableAttr { let Spellings = [CXX11<"vk", "ext_extension">]; - let Subjects = SubjectList<[Function, Var, ParmVar, Field, TypedefName], ErrorDiag>; + let Subjects = + SubjectList<[Function, Var, ParmVar, Field, TypedefName], ErrorDiag>; let Args = [StringArgument<"name">]; let LangOpts = [SPIRV]; let Documentation = [Undocumented]; @@ -1487,11 +1476,14 @@ def VKAliasedPointer : InheritableAttr { } // Global variables that are of struct type -def StructGlobalVar : SubsetSubjecthasGlobalStorage() && S->getType()->isStructureType()}]>; +def StructGlobalVar + : SubsetSubject< + Var, [{S->hasGlobalStorage() && S->getType()->isStructureType()}]>; def VKPushConstant : InheritableAttr { let Spellings = [CXX11<"vk", "push_constant">]; - let Subjects = SubjectList<[StructGlobalVar], ErrorDiag, "ExpectedStructGlobalVar">; + let Subjects = + SubjectList<[StructGlobalVar], ErrorDiag, "ExpectedStructGlobalVar">; let Args = []; let LangOpts = [SPIRV]; let Documentation = [Undocumented]; @@ -1507,8 +1499,8 @@ def VKOffset : InheritableAttr { def VKCombinedImageSampler : InheritableAttr { let Spellings = [CXX11<"vk", "combinedImageSampler">]; - let Subjects = SubjectList<[TextureOrSampler], - ErrorDiag, "ExpectedTextureOrSamplerState">; + let Subjects = SubjectList<[TextureOrSampler], ErrorDiag, + "ExpectedTextureOrSamplerState">; let Args = []; let LangOpts = [SPIRV]; let Documentation = [Undocumented]; @@ -1516,30 +1508,30 @@ def VKCombinedImageSampler : InheritableAttr { def VKImageFormat : InheritableAttr { let Spellings = [CXX11<"vk", "image_format">]; - let Subjects = SubjectList<[RWTexture, ArrayOfRWTexture, Buffer, ArrayOfBuffer], - ErrorDiag, "ExpectedRWTextureOrBuffer">; - let Args = [EnumArgument<"ImageFormat", "ImageFormatType", - ["unknown", "rgba32f", "rgba16f", "r32f", "rgba8", "rgba8snorm", - "rg32f", "rg16f", "r11g11b10f", "r16f", "rgba16", "rgb10a2", - "rg16", "rg8", "r16", "r8", "rgba16snorm", "rg16snorm", "rg8snorm", - "r16snorm", "r8snorm", "rgba32i", "rgba16i", "rgba8i", "r32i", - "rg32i", "rg16i", "rg8i", "r16i", "r8i", "rgba32ui", "rgba16ui", "rgba8ui", - "r32ui", "rgb10a2ui", "rg32ui", "rg16ui", "rg8ui", "r16ui", - "r8ui", "r64ui", "r64i"], - ["unknown", "rgba32f", "rgba16f", "r32f", "rgba8", "rgba8snorm", - "rg32f", "rg16f", "r11g11b10f", "r16f", "rgba16", "rgb10a2", - "rg16", "rg8", "r16", "r8", "rgba16snorm", "rg16snorm", "rg8snorm", - "r16snorm", "r8snorm", "rgba32i", "rgba16i", "rgba8i", "r32i", - "rg32i", "rg16i", "rg8i", "r16i", "r8i", "rgba32ui", "rgba16ui", "rgba8ui", - "r32ui", "rgb10a2ui", "rg32ui", "rg16ui", "rg8ui", "r16ui", - "r8ui", "r64ui", "r64i"]>]; + let Subjects = + SubjectList<[RWTexture, ArrayOfRWTexture, Buffer, ArrayOfBuffer], + ErrorDiag, "ExpectedRWTextureOrBuffer">; + let Args = [EnumArgument< + "ImageFormat", "ImageFormatType", + ["unknown", "rgba32f", "rgba16f", "r32f", "rgba8", "rgba8snorm", "rg32f", + "rg16f", "r11g11b10f", "r16f", "rgba16", "rgb10a2", "rg16", "rg8", "r16", + "r8", "rgba16snorm", "rg16snorm", "rg8snorm", "r16snorm", "r8snorm", + "rgba32i", "rgba16i", "rgba8i", "r32i", "rg32i", "rg16i", "rg8i", "r16i", + "r8i", "rgba32ui", "rgba16ui", "rgba8ui", "r32ui", "rgb10a2ui", "rg32ui", + "rg16ui", "rg8ui", "r16ui", "r8ui", "r64ui", "r64i"], + ["unknown", "rgba32f", "rgba16f", "r32f", "rgba8", "rgba8snorm", "rg32f", + "rg16f", "r11g11b10f", "r16f", "rgba16", "rgb10a2", "rg16", "rg8", "r16", + "r8", "rgba16snorm", "rg16snorm", "rg8snorm", "r16snorm", "r8snorm", + "rgba32i", "rgba16i", "rgba8i", "r32i", "rg32i", "rg16i", "rg8i", "r16i", + "r8i", "rgba32ui", "rgba16ui", "rgba8ui", "r32ui", "rgb10a2ui", "rg32ui", + "rg16ui", "rg8ui", "r16ui", "r8ui", "r64ui", "r64i"]>]; let LangOpts = [SPIRV]; let Documentation = [Undocumented]; } -def SubpassInput : SubsetSubject< - Var, - [{S->hasGlobalStorage() && S->getType()->getAs() && +def SubpassInput + : SubsetSubject< + Var, [{S->hasGlobalStorage() && S->getType()->getAs() && (S->getType()->getAs()->getDecl()->getName() == "SubpassInput" || S->getType()->getAs()->getDecl()->getName() == "SubpassInputMS")}]>; @@ -1582,11 +1574,14 @@ def VKTypeDefExt : InheritableAttr { } // Global variables that are of scalar type -def ScalarGlobalVar : SubsetSubjecthasGlobalStorage() && S->getType()->isScalarType()}]>; +def ScalarGlobalVar + : SubsetSubjecthasGlobalStorage() && S->getType()->isScalarType()}]>; def VKConstantId : InheritableAttr { let Spellings = [CXX11<"vk", "constant_id">]; - let Subjects = SubjectList<[ScalarGlobalVar], ErrorDiag, "ExpectedScalarGlobalVar">; + let Subjects = + SubjectList<[ScalarGlobalVar], ErrorDiag, "ExpectedScalarGlobalVar">; let Args = [IntArgument<"SpecConstId">]; let LangOpts = [SPIRV]; let Documentation = [Undocumented]; @@ -1682,7 +1677,7 @@ def C11NoReturn : InheritableAttr { } def CXX11NoReturn : InheritableAttr { - let Spellings = [CXX11<"","noreturn", 200809>]; + let Spellings = [CXX11<"", "noreturn", 200809>]; let Subjects = SubjectList<[Function], ErrorDiag>; let Documentation = [CXX11NoReturnDocs]; } @@ -1736,7 +1731,7 @@ def OpenCLGenericAddressSpace : TypeAttr { def Deprecated : InheritableAttr { let Spellings = [GCC<"deprecated">, Declspec<"deprecated">, - CXX11<"","deprecated", 201309>]; + CXX11<"", "deprecated", 201309>]; let Args = [StringArgument<"Message", 1>]; let Documentation = [Undocumented]; } @@ -1766,14 +1761,14 @@ def ExtVectorType : Attr { def FallThrough : Attr { let Spellings = [CXX11<"clang", "fallthrough">]; -// let Subjects = [NullStmt]; + // let Subjects = [NullStmt]; let Documentation = [FallthroughDocs]; } def FastCall : InheritableAttr { let Spellings = [GCC<"fastcall">, Keyword<"__fastcall">, Keyword<"_fastcall">]; -// let Subjects = [Function, ObjCMethod]; + // let Subjects = [Function, ObjCMethod]; let Documentation = [FastCallDocs]; } @@ -1827,8 +1822,8 @@ def Format : InheritableAttr { def FormatArg : InheritableAttr { let Spellings = [GCC<"format_arg">]; let Args = [IntArgument<"FormatIdx">]; - let Subjects = SubjectList<[ObjCMethod, HasFunctionProto], WarnDiag, - "ExpectedFunction">; + let Subjects = + SubjectList<[ObjCMethod, HasFunctionProto], WarnDiag, "ExpectedFunction">; let Documentation = [Undocumented]; } @@ -1848,8 +1843,8 @@ def Hot : InheritableAttr { def IBAction : InheritableAttr { let Spellings = [GNU<"ibaction">]; - let Subjects = SubjectList<[ObjCInstanceMethod], WarnDiag, - "ExpectedObjCInstanceMethod">; + let Subjects = + SubjectList<[ObjCInstanceMethod], WarnDiag, "ExpectedObjCInstanceMethod">; // An AST node is created for this attribute, but is not used by other parts // of the compiler. However, this node needs to exist in the AST because // external tools rely on it. @@ -1858,14 +1853,14 @@ def IBAction : InheritableAttr { def IBOutlet : InheritableAttr { let Spellings = [GNU<"iboutlet">]; -// let Subjects = [ObjCIvar, ObjCProperty]; + // let Subjects = [ObjCIvar, ObjCProperty]; let Documentation = [Undocumented]; } def IBOutletCollection : InheritableAttr { let Spellings = [GNU<"iboutletcollection">]; let Args = [TypeArgument<"Interface", 1>]; -// let Subjects = [ObjCIvar, ObjCProperty]; + // let Subjects = [ObjCIvar, ObjCProperty]; let Documentation = [Undocumented]; } @@ -1891,7 +1886,7 @@ def MayAlias : InheritableAttr { def MSABI : InheritableAttr { let Spellings = [GCC<"ms_abi">]; -// let Subjects = [Function, ObjCMethod]; + // let Subjects = [Function, ObjCMethod]; let Documentation = [MSABIDocs]; } @@ -1960,7 +1955,7 @@ def NoDuplicate : InheritableAttr { def NoInline : InheritableAttr { let Spellings = [GCC<"noinline">, Declspec<"noinline">, - CXX11<"", "noinline", 2017>]; // HLSL Change + CXX11<"", "noinline", 2017>]; // HLSL Change let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; } @@ -1988,19 +1983,17 @@ def AMDGPUNumVGPR : InheritableAttr { let Args = [UnsignedArgument<"NumVGPR">]; let Documentation = [AMDGPUNumVGPRDocs]; -// FIXME: This should be for OpenCLKernelFunction, but is not to -// workaround needing to see kernel attribute before others to know if -// this should be rejected on non-kernels. - let Subjects = SubjectList<[Function], ErrorDiag, - "ExpectedKernelFunction">; + // FIXME: This should be for OpenCLKernelFunction, but is not to + // workaround needing to see kernel attribute before others to know if + // this should be rejected on non-kernels. + let Subjects = SubjectList<[Function], ErrorDiag, "ExpectedKernelFunction">; } def AMDGPUNumSGPR : InheritableAttr { let Spellings = [GNU<"amdgpu_num_sgpr">]; let Args = [UnsignedArgument<"NumSGPR">]; let Documentation = [AMDGPUNumSGPRDocs]; - let Subjects = SubjectList<[Function], ErrorDiag, - "ExpectedKernelFunction">; + let Subjects = SubjectList<[Function], ErrorDiag, "ExpectedKernelFunction">; } def NoSplitStack : InheritableAttr { @@ -2014,8 +2007,7 @@ def NonNull : InheritableAttr { let Subjects = SubjectList<[ObjCMethod, HasFunctionProto, ParmVar], WarnDiag, "ExpectedFunctionMethodOrParameter">; let Args = [VariadicUnsignedArgument<"Args">]; - let AdditionalMembers = -[{bool isNonNull(unsigned idx) const { + let AdditionalMembers = [{bool isNonNull(unsigned idx) const { if (!args_size()) return true; for (const auto &V : args()) @@ -2030,8 +2022,8 @@ def NonNull : InheritableAttr { def ReturnsNonNull : InheritableAttr { let Spellings = [GCC<"returns_nonnull">]; - let Subjects = SubjectList<[ObjCMethod, Function], WarnDiag, - "ExpectedFunctionOrMethod">; + let Subjects = + SubjectList<[ObjCMethod, Function], WarnDiag, "ExpectedFunctionOrMethod">; let Documentation = [ReturnsNonNullDocs]; } @@ -2099,27 +2091,27 @@ def ObjCBridgeRelated : InheritableAttr { let Spellings = [GNU<"objc_bridge_related">]; let Subjects = SubjectList<[Record], ErrorDiag>; let Args = [IdentifierArgument<"RelatedClass">, - IdentifierArgument<"ClassMethod">, - IdentifierArgument<"InstanceMethod">]; + IdentifierArgument<"ClassMethod">, + IdentifierArgument<"InstanceMethod">]; let HasCustomParsing = 1; let Documentation = [Undocumented]; } def NSReturnsRetained : InheritableAttr { let Spellings = [GNU<"ns_returns_retained">]; -// let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>; + // let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>; let Documentation = [Undocumented]; } def NSReturnsNotRetained : InheritableAttr { let Spellings = [GNU<"ns_returns_not_retained">]; -// let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>; + // let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>; let Documentation = [Undocumented]; } def NSReturnsAutoreleased : InheritableAttr { let Spellings = [GNU<"ns_returns_autoreleased">]; -// let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>; + // let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>; let Documentation = [Undocumented]; } @@ -2144,10 +2136,11 @@ def ObjCException : InheritableAttr { def ObjCMethodFamily : InheritableAttr { let Spellings = [GNU<"objc_method_family">]; let Subjects = SubjectList<[ObjCMethod], ErrorDiag>; - let Args = [EnumArgument<"Family", "FamilyKind", - ["none", "alloc", "copy", "init", "mutableCopy", "new"], - ["OMF_None", "OMF_alloc", "OMF_copy", "OMF_init", - "OMF_mutableCopy", "OMF_new"]>]; + let Args = [EnumArgument< + "Family", + "FamilyKind", ["none", "alloc", "copy", "init", "mutableCopy", "new"], + ["OMF_None", "OMF_alloc", "OMF_copy", "OMF_init", "OMF_mutableCopy", + "OMF_new"]>]; let Documentation = [ObjCMethodFamilyDocs]; } @@ -2250,22 +2243,21 @@ def Ownership : InheritableAttr { def Packed : InheritableAttr { let Spellings = [GCC<"packed">]; -// let Subjects = [Tag, Field]; + // let Subjects = [Tag, Field]; let Documentation = [Undocumented]; } def IntelOclBicc : InheritableAttr { let Spellings = [GNU<"intel_ocl_bicc">]; -// let Subjects = [Function, ObjCMethod]; + // let Subjects = [Function, ObjCMethod]; let Documentation = [Undocumented]; } def Pcs : InheritableAttr { let Spellings = [GCC<"pcs">]; - let Args = [EnumArgument<"PCS", "PCSType", - ["aapcs", "aapcs-vfp"], - ["AAPCS", "AAPCS_VFP"]>]; -// let Subjects = [Function, ObjCMethod]; + let Args = [EnumArgument< + "PCS", "PCSType", ["aapcs", "aapcs-vfp"], ["AAPCS", "AAPCS_VFP"]>]; + // let Subjects = [Function, ObjCMethod]; let Documentation = [PcsDocs]; } @@ -2288,10 +2280,9 @@ def ReqdWorkGroupSize : InheritableAttr { let Documentation = [Undocumented]; } -def WorkGroupSizeHint : InheritableAttr { +def WorkGroupSizeHint : InheritableAttr { let Spellings = [GNU<"work_group_size_hint">]; - let Args = [UnsignedArgument<"XDim">, - UnsignedArgument<"YDim">, + let Args = [UnsignedArgument<"XDim">, UnsignedArgument<"YDim">, UnsignedArgument<"ZDim">]; let Subjects = SubjectList<[Function], ErrorDiag>; let Documentation = [Undocumented]; @@ -2307,9 +2298,9 @@ def InitPriority : InheritableAttr { def Section : InheritableAttr { let Spellings = [GCC<"section">, Declspec<"allocate">]; let Args = [StringArgument<"Name">]; - let Subjects = SubjectList<[Function, GlobalVar, - ObjCMethod, ObjCProperty], ErrorDiag, - "ExpectedFunctionGlobalVarMethodOrProperty">; + let Subjects = + SubjectList<[Function, GlobalVar, ObjCMethod, ObjCProperty], ErrorDiag, + "ExpectedFunctionGlobalVarMethodOrProperty">; let Documentation = [SectionDocs]; } @@ -2317,39 +2308,39 @@ def Sentinel : InheritableAttr { let Spellings = [GCC<"sentinel">]; let Args = [DefaultIntArgument<"Sentinel", 0>, DefaultIntArgument<"NullPos", 0>]; -// let Subjects = SubjectList<[Function, ObjCMethod, Block, Var]>; + // let Subjects = SubjectList<[Function, ObjCMethod, Block, Var]>; let Documentation = [Undocumented]; } def StdCall : InheritableAttr { let Spellings = [GCC<"stdcall">, Keyword<"__stdcall">, Keyword<"_stdcall">]; -// let Subjects = [Function, ObjCMethod]; + // let Subjects = [Function, ObjCMethod]; let Documentation = [StdCallDocs]; } def SysVABI : InheritableAttr { let Spellings = [GCC<"sysv_abi">]; -// let Subjects = [Function, ObjCMethod]; + // let Subjects = [Function, ObjCMethod]; let Documentation = [Undocumented]; } def ThisCall : InheritableAttr { let Spellings = [GCC<"thiscall">, Keyword<"__thiscall">, Keyword<"_thiscall">]; -// let Subjects = [Function, ObjCMethod]; + // let Subjects = [Function, ObjCMethod]; let Documentation = [ThisCallDocs]; } def VectorCall : InheritableAttr { let Spellings = [GNU<"vectorcall">, Keyword<"__vectorcall">, Keyword<"_vectorcall">]; -// let Subjects = [Function, ObjCMethod]; + // let Subjects = [Function, ObjCMethod]; let Documentation = [VectorCallDocs]; } def Pascal : InheritableAttr { let Spellings = [GNU<"pascal">, Keyword<"__pascal">, Keyword<"_pascal">]; -// let Subjects = [Function, ObjCMethod]; + // let Subjects = [Function, ObjCMethod]; let Documentation = [Undocumented]; } @@ -2362,7 +2353,7 @@ def Target : InheritableAttr { def TransparentUnion : InheritableAttr { let Spellings = [GCC<"transparent_union">]; -// let Subjects = SubjectList<[Record, TypedefName]>; + // let Subjects = SubjectList<[Record, TypedefName]>; let Documentation = [Undocumented]; } @@ -2399,9 +2390,9 @@ def ObjCRequiresPropertyDefs : InheritableAttr { def Unused : InheritableAttr { let Spellings = [GCC<"unused">]; - let Subjects = SubjectList<[Var, ObjCIvar, Type, Label, Field, ObjCMethod, - FunctionLike], WarnDiag, - "ExpectedVariableFunctionOrLabel">; + let Subjects = + SubjectList<[Var, ObjCIvar, Type, Label, Field, ObjCMethod, FunctionLike], + WarnDiag, "ExpectedVariableFunctionOrLabel">; let Documentation = [Undocumented]; } @@ -2413,7 +2404,7 @@ def Used : InheritableAttr { def Uuid : InheritableAttr { let Spellings = [Declspec<"uuid">]; let Args = [StringArgument<"Guid">]; -// let Subjects = SubjectList<[CXXRecord]>; + // let Subjects = SubjectList<[CXXRecord]>; let LangOpts = [MicrosoftExt, Borland]; let Documentation = [Undocumented]; } @@ -2434,19 +2425,21 @@ def VecTypeHint : InheritableAttr { def Visibility : InheritableAttr { let Clone = 0; let Spellings = [GCC<"visibility">]; - let Args = [EnumArgument<"Visibility", "VisibilityType", - ["default", "hidden", "internal", "protected"], - ["Default", "Hidden", "Hidden", "Protected"]>]; + let Args = [EnumArgument< + "Visibility", + "VisibilityType", ["default", "hidden", "internal", "protected"], + ["Default", "Hidden", "Hidden", "Protected"]>]; let Documentation = [Undocumented]; } def TypeVisibility : InheritableAttr { let Clone = 0; let Spellings = [GNU<"type_visibility">, CXX11<"clang", "type_visibility">]; - let Args = [EnumArgument<"Visibility", "VisibilityType", - ["default", "hidden", "internal", "protected"], - ["Default", "Hidden", "Hidden", "Protected"]>]; -// let Subjects = [Tag, ObjCInterface, Namespace]; + let Args = [EnumArgument< + "Visibility", + "VisibilityType", ["default", "hidden", "internal", "protected"], + ["Default", "Hidden", "Hidden", "Protected"]>]; + // let Subjects = [Tag, ObjCInterface, Namespace]; let Documentation = [Undocumented]; } @@ -2519,8 +2512,7 @@ def NoSanitize : InheritableAttr { // to this list; the no_sanitize attribute should be extended instead. def NoSanitizeSpecific : InheritableAttr { let Spellings = [GCC<"no_address_safety_analysis">, - GCC<"no_sanitize_address">, - GCC<"no_sanitize_thread">, + GCC<"no_sanitize_address">, GCC<"no_sanitize_thread">, GNU<"no_sanitize_memory">]; let Subjects = SubjectList<[Function], ErrorDiag>; let Documentation = [NoSanitizeAddressDocs, NoSanitizeThreadDocs, @@ -2532,15 +2524,15 @@ def NoSanitizeSpecific : InheritableAttr { def GuardedVar : InheritableAttr { let Spellings = [GNU<"guarded_var">]; - let Subjects = SubjectList<[Field, SharedVar], WarnDiag, - "ExpectedFieldOrGlobalVar">; + let Subjects = + SubjectList<[Field, SharedVar], WarnDiag, "ExpectedFieldOrGlobalVar">; let Documentation = [Undocumented]; } def PtGuardedVar : InheritableAttr { let Spellings = [GNU<"pt_guarded_var">]; - let Subjects = SubjectList<[Field, SharedVar], WarnDiag, - "ExpectedFieldOrGlobalVar">; + let Subjects = + SubjectList<[Field, SharedVar], WarnDiag, "ExpectedFieldOrGlobalVar">; let Documentation = [Undocumented]; } @@ -2548,7 +2540,7 @@ def Lockable : InheritableAttr { let Spellings = [GNU<"lockable">]; let Subjects = SubjectList<[Record]>; let Documentation = [Undocumented]; - let ASTNode = 0; // Replaced by Capability + let ASTNode = 0; // Replaced by Capability } def ScopedLockable : InheritableAttr { @@ -2561,12 +2553,11 @@ def Capability : InheritableAttr { let Spellings = [GNU<"capability">, CXX11<"clang", "capability">, GNU<"shared_capability">, CXX11<"clang", "shared_capability">]; - let Subjects = SubjectList<[Struct, TypedefName], ErrorDiag, - "ExpectedStructOrTypedef">; + let Subjects = + SubjectList<[Struct, TypedefName], ErrorDiag, "ExpectedStructOrTypedef">; let Args = [StringArgument<"Name">]; - let Accessors = [Accessor<"isShared", - [GNU<"shared_capability">, - CXX11<"clang","shared_capability">]>]; + let Accessors = [Accessor<"isShared", [GNU<"shared_capability">, + CXX11<"clang", "shared_capability">]>]; let Documentation = [Undocumented]; let AdditionalMembers = [{ bool isMutex() const { return getName().equals_lower("mutex"); } @@ -2585,9 +2576,9 @@ def AssertCapability : InheritableAttr { let ParseArgumentsAsUnevaluated = 1; let DuplicatesAllowedWhileMerging = 1; let Args = [ExprArgument<"Expr">]; - let Accessors = [Accessor<"isShared", - [GNU<"assert_shared_capability">, - CXX11<"clang", "assert_shared_capability">]>]; + let Accessors = [Accessor< + "isShared", [GNU<"assert_shared_capability">, + CXX11<"clang", "assert_shared_capability">]>]; let Documentation = [AssertCapabilityDocs]; } @@ -2596,18 +2587,17 @@ def AcquireCapability : InheritableAttr { CXX11<"clang", "acquire_capability">, GNU<"acquire_shared_capability">, CXX11<"clang", "acquire_shared_capability">, - GNU<"exclusive_lock_function">, - GNU<"shared_lock_function">]; + GNU<"exclusive_lock_function">, GNU<"shared_lock_function">]; let Subjects = SubjectList<[Function]>; let LateParsed = 1; let TemplateDependent = 1; let ParseArgumentsAsUnevaluated = 1; let DuplicatesAllowedWhileMerging = 1; let Args = [VariadicExprArgument<"Args">]; - let Accessors = [Accessor<"isShared", - [GNU<"acquire_shared_capability">, - CXX11<"clang", "acquire_shared_capability">, - GNU<"shared_lock_function">]>]; + let Accessors = [Accessor< + "isShared", [GNU<"acquire_shared_capability">, + CXX11<"clang", "acquire_shared_capability">, + GNU<"shared_lock_function">]>]; let Documentation = [AcquireCapabilityDocs]; } @@ -2616,16 +2606,15 @@ def TryAcquireCapability : InheritableAttr { CXX11<"clang", "try_acquire_capability">, GNU<"try_acquire_shared_capability">, CXX11<"clang", "try_acquire_shared_capability">]; - let Subjects = SubjectList<[Function], - ErrorDiag>; + let Subjects = SubjectList<[Function], ErrorDiag>; let LateParsed = 1; let TemplateDependent = 1; let ParseArgumentsAsUnevaluated = 1; let DuplicatesAllowedWhileMerging = 1; let Args = [ExprArgument<"SuccessValue">, VariadicExprArgument<"Args">]; - let Accessors = [Accessor<"isShared", - [GNU<"try_acquire_shared_capability">, - CXX11<"clang", "try_acquire_shared_capability">]>]; + let Accessors = [Accessor< + "isShared", [GNU<"try_acquire_shared_capability">, + CXX11<"clang", "try_acquire_shared_capability">]>]; let Documentation = [TryAcquireCapabilityDocs]; } @@ -2643,13 +2632,12 @@ def ReleaseCapability : InheritableAttr { let ParseArgumentsAsUnevaluated = 1; let DuplicatesAllowedWhileMerging = 1; let Args = [VariadicExprArgument<"Args">]; - let Accessors = [Accessor<"isShared", - [GNU<"release_shared_capability">, - CXX11<"clang", "release_shared_capability">]>, - Accessor<"isGeneric", - [GNU<"release_generic_capability">, - CXX11<"clang", "release_generic_capability">, - GNU<"unlock_function">]>]; + let Accessors = + [Accessor<"isShared", [GNU<"release_shared_capability">, + CXX11<"clang", "release_shared_capability">]>, + Accessor<"isGeneric", [GNU<"release_generic_capability">, + CXX11<"clang", "release_generic_capability">, + GNU<"unlock_function">]>]; let Documentation = [ReleaseCapabilityDocs]; } @@ -2666,9 +2654,10 @@ def RequiresCapability : InheritableAttr { let ParseArgumentsAsUnevaluated = 1; let DuplicatesAllowedWhileMerging = 1; let Subjects = SubjectList<[Function]>; - let Accessors = [Accessor<"isShared", [GNU<"requires_shared_capability">, - GNU<"shared_locks_required">, - CXX11<"clang","requires_shared_capability">]>]; + let Accessors = [Accessor< + "isShared", [GNU<"requires_shared_capability">, + GNU<"shared_locks_required">, + CXX11<"clang", "requires_shared_capability">]>]; let Documentation = [Undocumented]; } @@ -2685,8 +2674,8 @@ def GuardedBy : InheritableAttr { let TemplateDependent = 1; let ParseArgumentsAsUnevaluated = 1; let DuplicatesAllowedWhileMerging = 1; - let Subjects = SubjectList<[Field, SharedVar], WarnDiag, - "ExpectedFieldOrGlobalVar">; + let Subjects = + SubjectList<[Field, SharedVar], WarnDiag, "ExpectedFieldOrGlobalVar">; let Documentation = [Undocumented]; } @@ -2697,8 +2686,8 @@ def PtGuardedBy : InheritableAttr { let TemplateDependent = 1; let ParseArgumentsAsUnevaluated = 1; let DuplicatesAllowedWhileMerging = 1; - let Subjects = SubjectList<[Field, SharedVar], WarnDiag, - "ExpectedFieldOrGlobalVar">; + let Subjects = + SubjectList<[Field, SharedVar], WarnDiag, "ExpectedFieldOrGlobalVar">; let Documentation = [Undocumented]; } @@ -2709,8 +2698,8 @@ def AcquiredAfter : InheritableAttr { let TemplateDependent = 1; let ParseArgumentsAsUnevaluated = 1; let DuplicatesAllowedWhileMerging = 1; - let Subjects = SubjectList<[Field, SharedVar], WarnDiag, - "ExpectedFieldOrGlobalVar">; + let Subjects = + SubjectList<[Field, SharedVar], WarnDiag, "ExpectedFieldOrGlobalVar">; let Documentation = [Undocumented]; } @@ -2721,8 +2710,8 @@ def AcquiredBefore : InheritableAttr { let TemplateDependent = 1; let ParseArgumentsAsUnevaluated = 1; let DuplicatesAllowedWhileMerging = 1; - let Subjects = SubjectList<[Field, SharedVar], WarnDiag, - "ExpectedFieldOrGlobalVar">; + let Subjects = + SubjectList<[Field, SharedVar], WarnDiag, "ExpectedFieldOrGlobalVar">; let Documentation = [Undocumented]; } @@ -2800,9 +2789,9 @@ def LocksExcluded : InheritableAttr { def Consumable : InheritableAttr { let Spellings = [GNU<"consumable">]; let Subjects = SubjectList<[CXXRecord]>; - let Args = [EnumArgument<"DefaultState", "ConsumedState", - ["unknown", "consumed", "unconsumed"], - ["Unknown", "Consumed", "Unconsumed"]>]; + let Args = [EnumArgument< + "DefaultState", "ConsumedState", ["unknown", "consumed", "unconsumed"], + ["Unknown", "Consumed", "Unconsumed"]>]; let Documentation = [ConsumableDocs]; } @@ -2821,56 +2810,54 @@ def ConsumableSetOnRead : InheritableAttr { def CallableWhen : InheritableAttr { let Spellings = [GNU<"callable_when">]; let Subjects = SubjectList<[CXXMethod]>; - let Args = [VariadicEnumArgument<"CallableStates", "ConsumedState", - ["unknown", "consumed", "unconsumed"], - ["Unknown", "Consumed", "Unconsumed"]>]; + let Args = [VariadicEnumArgument< + "CallableStates", "ConsumedState", ["unknown", "consumed", "unconsumed"], + ["Unknown", "Consumed", "Unconsumed"]>]; let Documentation = [CallableWhenDocs]; } def ParamTypestate : InheritableAttr { let Spellings = [GNU<"param_typestate">]; let Subjects = SubjectList<[ParmVar]>; - let Args = [EnumArgument<"ParamState", "ConsumedState", - ["unknown", "consumed", "unconsumed"], - ["Unknown", "Consumed", "Unconsumed"]>]; + let Args = [EnumArgument< + "ParamState", "ConsumedState", ["unknown", "consumed", "unconsumed"], + ["Unknown", "Consumed", "Unconsumed"]>]; let Documentation = [ParamTypestateDocs]; } def ReturnTypestate : InheritableAttr { let Spellings = [GNU<"return_typestate">]; let Subjects = SubjectList<[Function, ParmVar]>; - let Args = [EnumArgument<"State", "ConsumedState", - ["unknown", "consumed", "unconsumed"], - ["Unknown", "Consumed", "Unconsumed"]>]; + let Args = [EnumArgument< + "State", "ConsumedState", ["unknown", "consumed", "unconsumed"], + ["Unknown", "Consumed", "Unconsumed"]>]; let Documentation = [ReturnTypestateDocs]; } def SetTypestate : InheritableAttr { let Spellings = [GNU<"set_typestate">]; let Subjects = SubjectList<[CXXMethod]>; - let Args = [EnumArgument<"NewState", "ConsumedState", - ["unknown", "consumed", "unconsumed"], - ["Unknown", "Consumed", "Unconsumed"]>]; + let Args = [EnumArgument< + "NewState", "ConsumedState", ["unknown", "consumed", "unconsumed"], + ["Unknown", "Consumed", "Unconsumed"]>]; let Documentation = [SetTypestateDocs]; } def TestTypestate : InheritableAttr { let Spellings = [GNU<"test_typestate">]; let Subjects = SubjectList<[CXXMethod]>; - let Args = [EnumArgument<"TestState", "ConsumedState", - ["consumed", "unconsumed"], - ["Consumed", "Unconsumed"]>]; + let Args = [EnumArgument< + "TestState", + "ConsumedState", ["consumed", "unconsumed"], ["Consumed", "Unconsumed"]>]; let Documentation = [TestTypestateDocs]; } // Type safety attributes for `void *' pointers and type tags. def ArgumentWithTypeTag : InheritableAttr { - let Spellings = [GNU<"argument_with_type_tag">, - GNU<"pointer_with_type_tag">]; + let Spellings = [GNU<"argument_with_type_tag">, GNU<"pointer_with_type_tag">]; let Args = [IdentifierArgument<"ArgumentKind">, - UnsignedArgument<"ArgumentIdx">, - UnsignedArgument<"TypeTagIdx">, + UnsignedArgument<"ArgumentIdx">, UnsignedArgument<"TypeTagIdx">, BoolArgument<"IsPointer">]; let HasCustomParsing = 1; let Documentation = [ArgumentWithTypeTagDocs, PointerWithTypeTagDocs]; @@ -2878,11 +2865,9 @@ def ArgumentWithTypeTag : InheritableAttr { def TypeTagForDatatype : InheritableAttr { let Spellings = [GNU<"type_tag_for_datatype">]; - let Args = [IdentifierArgument<"ArgumentKind">, - TypeArgument<"MatchingCType">, - BoolArgument<"LayoutCompatible">, - BoolArgument<"MustBeNull">]; -// let Subjects = SubjectList<[Var], ErrorDiag>; + let Args = [IdentifierArgument<"ArgumentKind">, TypeArgument<"MatchingCType">, + BoolArgument<"LayoutCompatible">, BoolArgument<"MustBeNull">]; + // let Subjects = SubjectList<[Var], ErrorDiag>; let HasCustomParsing = 1; let Documentation = [TypeTagForDatatypeDocs]; } @@ -2895,9 +2880,7 @@ def MSNoVTable : InheritableAttr { let Documentation = [MSNoVTableDocs]; } -def : IgnoredAttr { - let Spellings = [Declspec<"property">]; -} +def : IgnoredAttr { let Spellings = [Declspec<"property">]; } def MSStruct : InheritableAttr { let Spellings = [GCC<"ms_struct">]; @@ -3017,9 +3000,7 @@ def InitSeg : Attr { }]; } -def Unaligned : IgnoredAttr { - let Spellings = [Keyword<"__unaligned">]; -} +def Unaligned : IgnoredAttr { let Spellings = [Keyword<"__unaligned">]; } def LoopHint : Attr { /// #pragma clang loop