================
@@ -0,0 +1,39 @@
+//===- HLSLTargetInfo.h 
---------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "ABIInfoImpl.h"
+#include "TargetInfo.h"
+
+using namespace clang;
+using namespace clang::CodeGen;
+
+//===----------------------------------------------------------------------===//
+// Target codegen info implementation common between DirectX and SPIR/SPIR-V.
+//===----------------------------------------------------------------------===//
+
+class CommonHLSLTargetCodeGenInfo : public TargetCodeGenInfo {
+public:
+  CommonHLSLTargetCodeGenInfo(std::unique_ptr<ABIInfo> Info)
+      : TargetCodeGenInfo(std::move(Info)) {}
+
+  // Returns LLVM target extension type "dx.Layout" or "spv.Layout"
+  // for given structure type and layout data. The first number in
+  // the Layout is the size followed by offsets for each struct element.
+  virtual llvm::Type *getHLSLLayoutType(CodeGenModule &CGM,
+                                        llvm::StructType *LayoutStructTy,
+                                        SmallVector<unsigned> Layout) const {
+    return nullptr;
----------------
hekota wrote:

This method is/will be implemented by the derived classes 
`DirectXTargetCodeGenInfo` and `CommonSPIRTargetCodeGenInfo`. The default 
implementation should return `nullptr`, the same as the default implementation 
of `getHLSLType` on the `TargetCodeGenInfo` class. `nullptr` means "I don't 
know who to convert this type".

https://github.com/llvm/llvm-project/pull/124886
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to