https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/93336
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/93336
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota ready_for_review
https://github.com/llvm/llvm-project/pull/93336
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/93847
>From dd175a247480396b9d35cb995333fcd14152e347 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Wed, 29 May 2024 18:38:45 -0700
Subject: [PATCH 1/4] [HLSL] Use llvm::Triple::EnvironmentType instead of
ShaderType
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/93847
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/93860
>From 532f10f77c862f6d429366f0d6903773da8fa79b Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Thu, 30 May 2024 11:40:27 -0700
Subject: [PATCH 1/3] Implement HLSL strict diagnostic mode
---
clang/include/clang
@@ -108,3 +108,16 @@ behavior between Clang and DXC. Some examples include:
diagnostic notifying the user of the conversion rather than silently altering
precision relative to the other overloads (as FXC does) or generating code
that will fail validation (as DXC does).
+
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/95331
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/95849
Add lowering of `rsqrt` to SPIRV.
Fixes #88949
>From b10aa2317f566febdf4cd3630a972be58fea515b Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Mon, 17 Jun 2024 14:03:03 -0700
Subject: [PATCH] [SPIRV][HLSL] Add
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/95849
>From b10aa2317f566febdf4cd3630a972be58fea515b Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Mon, 17 Jun 2024 14:03:03 -0700
Subject: [PATCH 1/2] [SPIRV][HLSL] Add lowering of `rsqrt` to SPIRV
---
clang/lib/
@@ -157,6 +157,18 @@ static bool ShouldDiagnoseAvailabilityInContext(
}
}
+ // In HLSL, emit diagnostic during parsing only if the diagnostic
+ // mode is set to strict (-fhlsl-strict-availability), and either the decl
+ // availability is not restricted to a specific
@@ -210,13 +222,16 @@ static bool ShouldDiagnoseAvailabilityInContext(
return true;
}
-static bool
-shouldDiagnoseAvailabilityByDefault(const ASTContext &Context,
-const VersionTuple &DeploymentVersion,
-
@@ -536,9 +536,34 @@ DiagnoseHLSLAvailability::FindAvailabilityAttr(const Decl
*D) {
void DiagnoseHLSLAvailability::CheckDeclAvailability(NamedDecl *D,
const AvailabilityAttr
*AA,
@@ -157,6 +157,18 @@ static bool ShouldDiagnoseAvailabilityInContext(
}
}
+ // In HLSL, emit diagnostic during parsing only if the diagnostic
+ // mode is set to strict (-fhlsl-strict-availability), and either the decl
+ // availability is not restricted to a specific
@@ -536,9 +536,34 @@ DiagnoseHLSLAvailability::FindAvailabilityAttr(const Decl
*D) {
void DiagnoseHLSLAvailability::CheckDeclAvailability(NamedDecl *D,
const AvailabilityAttr
*AA,
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/93860
>From 532f10f77c862f6d429366f0d6903773da8fa79b Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Thu, 30 May 2024 11:40:27 -0700
Subject: [PATCH 1/4] Implement HLSL strict diagnostic mode
---
clang/include/clang
@@ -536,9 +536,34 @@ DiagnoseHLSLAvailability::FindAvailabilityAttr(const Decl
*D) {
void DiagnoseHLSLAvailability::CheckDeclAvailability(NamedDecl *D,
const AvailabilityAttr
*AA,
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/93860
>From 532f10f77c862f6d429366f0d6903773da8fa79b Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Thu, 30 May 2024 11:40:27 -0700
Subject: [PATCH 1/5] Implement HLSL strict diagnostic mode
---
clang/include/clang
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/95849
>From b10aa2317f566febdf4cd3630a972be58fea515b Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Mon, 17 Jun 2024 14:03:03 -0700
Subject: [PATCH 1/3] [SPIRV][HLSL] Add lowering of `rsqrt` to SPIRV
---
clang/lib/
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/93860
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/95849
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota converted_to_draft
https://github.com/llvm/llvm-project/pull/93336
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/95999
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -290,3 +294,295 @@ void SemaHLSL::DiagnoseAttrStageMismatch(
<< A << HLSLShaderAttr::ConvertShaderTypeToStr(Stage)
<< (AllowedStages.size() != 1) << join(StageStrings, ", ");
}
+
+namespace {
+
+/// This class implements HLSL availability diagnostics for default
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/92704
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/93847
`HLSLShaderAttr::ShaderType` enum is a subset of
`llvm::Triple::EnvironmentType`. We can use `llvm::Triple::EnvironmentType`
directly and avoid converting one enum to another.
>From dd175a247480396b9d35cb995333f
@@ -4469,36 +4469,20 @@ def HLSLShader : InheritableAttr {
let Subjects = SubjectList<[HLSLEntry]>;
let LangOpts = [HLSL];
let Args = [
-EnumArgument<"Type", "ShaderType", /*is_string=*/true,
+EnumArgument<"Type", "llvm::Triple::EnvironmentType", /*is_string=*/tru
https://github.com/hekota ready_for_review
https://github.com/llvm/llvm-project/pull/93860
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1060,11 +1060,6 @@ static llvm::StringRef
canonicalizePlatformName(llvm::StringRef Platform) {
.Case("ShaderModel", "shadermodel")
.Default(Platform);
}
-static llvm::StringRef getPrettyEnviromentName(llvm::Triple::EnvironmentType
EnvironmentType
@@ -834,34 +829,55 @@ void
DiagnoseUnguardedAvailability::DiagnoseDeclAvailability(
OffendingDecl))
return;
-// We would like to emit the diagnostic even if -Wunguarded-availability is
-// not specified for deployment
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/93860
>From 532f10f77c862f6d429366f0d6903773da8fa79b Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Thu, 30 May 2024 11:40:27 -0700
Subject: [PATCH 1/2] Implement HLSL strict diagnostic mode
---
clang/include/clang
hekota wrote:
Thanks @pow2clk !
https://github.com/llvm/llvm-project/pull/100017
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/97362
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/97362
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -8001,6 +8001,12 @@ NamedDecl *Sema::ActOnVariableDeclarator(
}
}
+ if (getLangOpts().HLSL) {
+if (R->isHLSLSpecificType() && !NewVD->isImplicit()) {
+ Diag(D.getBeginLoc(), diag::err_hlsl_intangible_type_cannot_be_declared);
hekota wrote:
@@ -290,3 +294,296 @@ void SemaHLSL::DiagnoseAttrStageMismatch(
<< A << HLSLShaderAttr::ConvertShaderTypeToStr(Stage)
<< (AllowedStages.size() != 1) << join(StageStrings, ", ");
}
+
+namespace {
+
+/// This class implements HLSL availability diagnostics for default
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/100778
Improves readability and removes static verifier trigger.
>From 1f1c082e0337209534f2f3ed77c410c0e2f81893 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Fri, 26 Jul 2024 10:10:38 -0700
Subject: [PATCH] [HLSL]
@@ -650,7 +650,10 @@ class DiagnoseHLSLAvailability
bool HasMatchingEnvironmentOrNone(const AvailabilityAttr *AA);
public:
- DiagnoseHLSLAvailability(Sema &SemaRef) : SemaRef(SemaRef) {}
+ DiagnoseHLSLAvailability(Sema &SemaRef)
+ : SemaRef(SemaRef),
+CurrentS
hekota wrote:
> Does this have any behavior change that can be tested?
No, it does not. I'll add [NFC] to the title.
https://github.com/llvm/llvm-project/pull/100778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bi
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/100778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -290,3 +294,296 @@ void SemaHLSL::DiagnoseAttrStageMismatch(
<< A << HLSLShaderAttr::ConvertShaderTypeToStr(Stage)
<< (AllowedStages.size() != 1) << join(StageStrings, ", ");
}
+
+namespace {
+
+/// This class implements HLSL availability diagnostics for default
@@ -8001,6 +8001,12 @@ NamedDecl *Sema::ActOnVariableDeclarator(
}
}
+ if (getLangOpts().HLSL) {
+if (R->isHLSLSpecificType() && !NewVD->isImplicit()) {
+ Diag(D.getBeginLoc(), diag::err_hlsl_intangible_type_cannot_be_declared);
hekota wrote:
https://github.com/hekota closed
https://github.com/llvm/llvm-project/pull/100778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/93336
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/89809
Fixes #89802
>From 22b67d30ca087d6a912183039c87fd1790eedfe4 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 23 Apr 2024 00:49:28 -0700
Subject: [PATCH] Add environment parameter to clang availability attr
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/89809
>From 22b67d30ca087d6a912183039c87fd1790eedfe4 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 23 Apr 2024 00:49:28 -0700
Subject: [PATCH 1/2] Add environment parameter to clang availability attribute
---
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/89836
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/89836
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -7314,6 +7314,47 @@ static void handleHLSLSV_DispatchThreadIDAttr(Sema &S,
Decl *D,
D->addAttr(::new (S.Context) HLSLSV_DispatchThreadIDAttr(S.Context, AL));
}
+static void handleHLSLPackOffsetAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
+ if (!isa(D)) {
+S.Diag(A
@@ -183,6 +183,86 @@ void Parser::ParseHLSLAnnotations(ParsedAttributes &Attrs,
return;
}
} break;
+ case ParsedAttr::AT_HLSLPackOffset: {
+// Parse 'packoffset( c[Subcomponent][.component] )'.
+// Check '('.
+if (ExpectAndConsume(tok::l_paren, diag::er
@@ -183,6 +183,86 @@ void Parser::ParseHLSLAnnotations(ParsedAttributes &Attrs,
return;
}
} break;
+ case ParsedAttr::AT_HLSLPackOffset: {
+// Parse 'packoffset( c[Subcomponent][.component] )'.
+// Check '('.
+if (ExpectAndConsume(tok::l_paren, diag::er
@@ -42,6 +42,54 @@ Decl *SemaHLSL::ActOnStartBuffer(Scope *BufferScope, bool
CBuffer,
void SemaHLSL::ActOnFinishBuffer(Decl *Dcl, SourceLocation RBrace) {
auto *BufDecl = cast(Dcl);
BufDecl->setRBraceLoc(RBrace);
+
+ // Validate packoffset.
+ llvm::SmallVector> PackOffse
@@ -7398,6 +7398,26 @@ The full documentation is available here:
https://docs.microsoft.com/en-us/windo
}];
}
+def HLSLPackOffsetDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The packoffset attribute is used to change the layout of a cbuffer.
@@ -42,6 +42,54 @@ Decl *SemaHLSL::ActOnStartBuffer(Scope *BufferScope, bool
CBuffer,
void SemaHLSL::ActOnFinishBuffer(Decl *Dcl, SourceLocation RBrace) {
auto *BufDecl = cast(Dcl);
BufDecl->setRBraceLoc(RBrace);
+
+ // Validate packoffset.
+ llvm::SmallVector> PackOffse
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/89836
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -42,6 +42,54 @@ Decl *SemaHLSL::ActOnStartBuffer(Scope *BufferScope, bool
CBuffer,
void SemaHLSL::ActOnFinishBuffer(Decl *Dcl, SourceLocation RBrace) {
auto *BufDecl = cast(Dcl);
BufDecl->setRBraceLoc(RBrace);
+
+ // Validate packoffset.
+ llvm::SmallVector> PackOffse
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/89836
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/89836
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/89836
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/89836
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota approved this pull request.
LGMT!
https://github.com/llvm/llvm-project/pull/89836
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/89836
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/89809
>From 22b67d30ca087d6a912183039c87fd1790eedfe4 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 23 Apr 2024 00:49:28 -0700
Subject: [PATCH 1/3] Add environment parameter to clang availability attribute
---
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/89809
>From 22b67d30ca087d6a912183039c87fd1790eedfe4 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 23 Apr 2024 00:49:28 -0700
Subject: [PATCH 1/3] Add environment parameter to clang availability attribute
---
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/89809
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota ready_for_review
https://github.com/llvm/llvm-project/pull/89809
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3859,7 +3862,7 @@ def warn_availability_fuchsia_unavailable_minor : Warning<
InGroup;
def warn_unguarded_availability :
- Warning<"%0 is only available on %1 %2 or newer">,
+ Warning<"%0 %select{is only|is not}5 available %select{|in %4 environment
}3on %1 %2 %select{
@@ -1016,7 +1016,34 @@ static llvm::StringRef
canonicalizePlatformName(llvm::StringRef Platform) {
.Case("visionos_app_extension", "xros_app_extension")
.Case("ShaderModel", "shadermodel")
.Default(Platform);
-} }];
+}
+static llvm::Strin
https://github.com/hekota approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/90276
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/90277
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/89809
>From 22b67d30ca087d6a912183039c87fd1790eedfe4 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 23 Apr 2024 00:49:28 -0700
Subject: [PATCH 1/3] Add environment parameter to clang availability attribute
---
hekota wrote:
Thanks @ian-twilightcoder! Would you also like to add a note that the
environment parameter is currently supported only for the ShaderModel platform?
https://github.com/llvm/llvm-project/pull/104653
___
cfe-commits mailing list
cfe-commi
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/106181
Introducing `HLSLAttributedResourceType` - a new type that is similar to
`AttributedType` but with additional data specific to HLSL resources.
`AttributeType` currently only stores an attribute kind and no addit
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/106181
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/106181
>From 11a6b3aac44889d39911a6704a9a963f29e92388 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Mon, 26 Aug 2024 12:13:09 -0700
Subject: [PATCH 1/3] Add HLSLAttributedResourceType - WIP
---
clang/include/clang
https://github.com/hekota ready_for_review
https://github.com/llvm/llvm-project/pull/106181
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/106181
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/106181
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/106181
>From 11a6b3aac44889d39911a6704a9a963f29e92388 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Mon, 26 Aug 2024 12:13:09 -0700
Subject: [PATCH 1/4] Add HLSLAttributedResourceType - WIP
---
clang/include/clang
@@ -2048,6 +2049,17 @@ void TypePrinter::printBTFTagAttributedAfter(const
BTFTagAttributedType *T,
printAfter(T->getWrappedType(), OS);
}
+void TypePrinter::printHLSLAttributedResourceBefore(
+const HLSLAttributedResourceType *T, raw_ostream &OS) {
+ printBefore(T->get
@@ -6155,6 +6155,63 @@ class BTFTagAttributedType : public Type, public
llvm::FoldingSetNode {
}
};
+class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode {
+public:
+ struct Attributes {
+// This is where data gathered from HLSL resource attribut
@@ -5683,6 +5685,14 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait
UTT,
return true;
return false;
}
+ case UTT_IsIntangibleType:
+if (!T->isVoidType() && !T->isIncompleteArrayType())
+ if (Self.RequireCompleteType(TInfo->getTypeLoc().getBe
@@ -1154,3 +1156,70 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
}
return false;
}
+
+static bool calculateIsIntangibleType(QualType Ty) {
+ Ty = Ty->getCanonicalTypeUnqualified();
+ if (Ty->isBuiltinType())
+return Ty->isHLSLSp
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/106181
>From 11a6b3aac44889d39911a6704a9a963f29e92388 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Mon, 26 Aug 2024 12:13:09 -0700
Subject: [PATCH 1/5] Add HLSLAttributedResourceType - WIP
---
clang/include/clang
@@ -8803,6 +8821,12 @@ static void processTypeAttrs(TypeProcessingState &state,
QualType &type,
attr.setUsedAsTypeAttr();
break;
}
+case ParsedAttr::AT_HLSLResourceClass:
hekota wrote:
Correct, we will be adding quite a few new attributes
@@ -6067,6 +6082,9 @@ namespace {
void VisitBTFTagAttributedTypeLoc(BTFTagAttributedTypeLoc TL) {
// nothing
}
+void VisitHLSLResourcedAttributedTypeLoc(HLSLAttributedResourceTypeLoc TL)
{
hekota wrote:
Good catch! This should not be there.
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/106181
>From 11a6b3aac44889d39911a6704a9a963f29e92388 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Mon, 26 Aug 2024 12:13:09 -0700
Subject: [PATCH 1/6] Add HLSLAttributedResourceType - WIP
---
clang/include/clang
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/104544
>From 6d5f8991a4ef9e79bc1bed30addf7b29b7ed0d2e Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Thu, 15 Aug 2024 19:03:29 -0700
Subject: [PATCH 1/9] Implement `__builtin_is_intangible`
---
clang/include/clang/
@@ -5683,6 +5685,14 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait
UTT,
return true;
return false;
}
+ case UTT_IsIntangibleType:
+if (!T->isVoidType() && !T->isIncompleteArrayType())
+ if (Self.RequireCompleteType(TInfo->getTypeLoc().getBe
@@ -1154,3 +1156,70 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
}
return false;
}
+
+static bool calculateIsIntangibleType(QualType Ty) {
+ Ty = Ty->getCanonicalTypeUnqualified();
+ if (Ty->isBuiltinType())
+return Ty->isHLSLSp
@@ -1154,3 +1156,70 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
}
return false;
}
+
+static bool calculateIsIntangibleType(QualType Ty) {
+ Ty = Ty->getCanonicalTypeUnqualified();
+ if (Ty->isBuiltinType())
+return Ty->isHLSLSp
@@ -27,7 +29,7 @@
using namespace clang;
-SemaHLSL::SemaHLSL(Sema &S) : SemaBase(S) {}
+SemaHLSL::SemaHLSL(Sema &S) : SemaBase(S), IsIntangibleTypeCache(8) {}
hekota wrote:
Fixed. I thought it is required.
https://github.com/llvm/llvm-project/pull/104544
__
@@ -1154,3 +1156,70 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
}
return false;
}
+
+static bool calculateIsIntangibleType(QualType Ty) {
+ Ty = Ty->getCanonicalTypeUnqualified();
+ if (Ty->isBuiltinType())
+return Ty->isHLSLSp
@@ -1154,3 +1156,70 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
}
return false;
}
+
+static bool calculateIsIntangibleType(QualType Ty) {
+ Ty = Ty->getCanonicalTypeUnqualified();
+ if (Ty->isBuiltinType())
+return Ty->isHLSLSp
@@ -1154,3 +1156,70 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
}
return false;
}
+
+static bool calculateIsIntangibleType(QualType Ty) {
+ Ty = Ty->getCanonicalTypeUnqualified();
+ if (Ty->isBuiltinType())
+return Ty->isHLSLSp
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/104544
>From 6d5f8991a4ef9e79bc1bed30addf7b29b7ed0d2e Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Thu, 15 Aug 2024 19:03:29 -0700
Subject: [PATCH 01/10] Implement `__builtin_is_intangible`
---
clang/include/clan
@@ -5683,6 +5685,14 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait
UTT,
return true;
return false;
}
+ case UTT_IsIntangibleType:
+if (!T->isVoidType() && !T->isIncompleteArrayType())
+ if (Self.RequireCompleteType(TInfo->getTypeLoc().getBe
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/104544
>From 6d5f8991a4ef9e79bc1bed30addf7b29b7ed0d2e Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Thu, 15 Aug 2024 19:03:29 -0700
Subject: [PATCH 01/11] Implement `__builtin_is_intangible`
---
clang/include/clan
@@ -6155,6 +6155,53 @@ class BTFTagAttributedType : public Type, public
llvm::FoldingSetNode {
}
};
+class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode {
+public:
+ struct Attributes {
+// Data gathered from HLSL resource attributes
+uint8_
@@ -7459,6 +7459,13 @@ QualType
TreeTransform::TransformBTFTagAttributedType(
llvm_unreachable("Unexpected TreeTransform for BTFTagAttributedType");
}
+template
+QualType TreeTransform::TransformHLSLAttributedResourceType(
+TypeLocBuilder &TLB, HLSLAttributedResourceTy
101 - 200 of 890 matches
Mail list logo