1 //===- Target/DirectX/CBufferDataLayout.h - Cbuffer layout helper ---------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Utils to help cbuffer layout.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_TARGET_DIRECTX_CBUFFERDATALAYOUT_H
14 #define LLVM_TARGET_DIRECTX_CBUFFERDATALAYOUT_H
15 
16 #include "llvm/Support/TypeSize.h"
17 
18 #include <memory>
19 #include <stdint.h>
20 
21 namespace llvm {
22 class DataLayout;
23 class Type;
24 
25 namespace dxil {
26 
27 class LegacyCBufferLayout;
28 
29 class CBufferDataLayout {
30   const DataLayout &DL;
31   const bool IsLegacyLayout;
32   std::unique_ptr<LegacyCBufferLayout> LegacyDL;
33 
34 public:
35   CBufferDataLayout(const DataLayout &DL, const bool IsLegacy);
36   ~CBufferDataLayout();
37   llvm::TypeSize getTypeAllocSizeInBytes(Type *Ty);
38 };
39 
40 } // namespace dxil
41 } // namespace llvm
42 
43 #endif
44