aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/Targets
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/Targets')
-rw-r--r--clang/lib/CodeGen/Targets/SPIR.cpp6
-rw-r--r--clang/lib/CodeGen/Targets/X86.cpp5
2 files changed, 9 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/Targets/SPIR.cpp b/clang/lib/CodeGen/Targets/SPIR.cpp
index 2e3fc53..4aa6314 100644
--- a/clang/lib/CodeGen/Targets/SPIR.cpp
+++ b/clang/lib/CodeGen/Targets/SPIR.cpp
@@ -486,6 +486,12 @@ llvm::Type *CommonSPIRTargetCodeGenInfo::getHLSLType(
return getSPIRVImageTypeFromHLSLResource(ResAttrs, ContainedTy, CGM);
}
+ if (ResAttrs.IsCounter) {
+ llvm::Type *ElemType = llvm::Type::getInt32Ty(Ctx);
+ uint32_t StorageClass = /* StorageBuffer storage class */ 12;
+ return llvm::TargetExtType::get(Ctx, "spirv.VulkanBuffer", {ElemType},
+ {StorageClass, true});
+ }
llvm::Type *ElemType = CGM.getTypes().ConvertTypeForMem(ContainedTy);
llvm::ArrayType *RuntimeArrayType = llvm::ArrayType::get(ElemType, 0);
uint32_t StorageClass = /* StorageBuffer storage class */ 12;
diff --git a/clang/lib/CodeGen/Targets/X86.cpp b/clang/lib/CodeGen/Targets/X86.cpp
index c03ba94..fb78948 100644
--- a/clang/lib/CodeGen/Targets/X86.cpp
+++ b/clang/lib/CodeGen/Targets/X86.cpp
@@ -1343,9 +1343,10 @@ class X86_64ABIInfo : public ABIInfo {
}
bool returnCXXRecordGreaterThan128InMem() const {
- // Clang <= 20.0 did not do this.
+ // Clang <= 20.0 did not do this, and PlayStation does not do this.
if (getContext().getLangOpts().getClangABICompat() <=
- LangOptions::ClangABI::Ver20)
+ LangOptions::ClangABI::Ver20 ||
+ getTarget().getTriple().isPS())
return false;
return true;