44 lines · c
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-exception6//7//===----------------------------------------------------------------------===//8//9// Utils to help cbuffer layout.10//11//===----------------------------------------------------------------------===//12 13#ifndef LLVM_TARGET_DIRECTX_CBUFFERDATALAYOUT_H14#define LLVM_TARGET_DIRECTX_CBUFFERDATALAYOUT_H15 16#include "llvm/Support/TypeSize.h"17 18#include <memory>19#include <stdint.h>20 21namespace llvm {22class DataLayout;23class Type;24 25namespace dxil {26 27class LegacyCBufferLayout;28 29class CBufferDataLayout {30 const DataLayout &DL;31 const bool IsLegacyLayout;32 std::unique_ptr<LegacyCBufferLayout> LegacyDL;33 34public:35 CBufferDataLayout(const DataLayout &DL, const bool IsLegacy);36 ~CBufferDataLayout();37 llvm::TypeSize getTypeAllocSizeInBytes(Type *Ty);38};39 40} // namespace dxil41} // namespace llvm42 43#endif44