10#include "TargetInfo.h"
11#include "llvm/IR/DerivedTypes.h"
30llvm::Type *DirectXTargetCodeGenInfo::getHLSLType(
CodeGenModule &CGM,
31 const Type *Ty)
const {
32 auto *ResType = dyn_cast<HLSLAttributedResourceType>(Ty);
39 case llvm::dxil::ResourceClass::UAV:
40 case llvm::dxil::ResourceClass::SRV: {
42 QualType ContainedTy = ResType->getContainedType();
50 ResAttrs.
RawBuffer ?
"dx.RawBuffer" :
"dx.TypedBuffer";
52 llvm::dxil::ResourceClass::UAV,
57 return llvm::TargetExtType::get(Ctx, TypeName, {ElemType}, Ints);
59 case llvm::dxil::ResourceClass::CBuffer:
60 llvm_unreachable(
"dx.CBuffer handles are not implemented yet");
62 case llvm::dxil::ResourceClass::Sampler:
63 llvm_unreachable(
"dx.Sampler handles are not implemented yet");
66 llvm_unreachable(
"Unknown llvm::dxil::ResourceClass enum");
71std::unique_ptr<TargetCodeGenInfo>
73 return std::make_unique<DirectXTargetCodeGenInfo>(CGM.
getTypes());
This class organizes the cross-function state that is used while generating LLVM code.
CodeGenTypes & getTypes()
llvm::LLVMContext & getLLVMContext()
This class organizes the cross-module state that is used while lowering AST types to LLVM types.
llvm::Type * ConvertType(QualType T)
ConvertType - Convert type T into a llvm::Type.
DefaultABIInfo - The default implementation for ABI specific details.
TargetCodeGenInfo - This class organizes various target-specific codegeneration issues,...
virtual llvm::Type * getHLSLType(CodeGenModule &CGM, const Type *T) const
Return an LLVM type that corresponds to a HLSL type.
A (possibly-)qualified type.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
The base class of the type hierarchy.
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char,...
std::unique_ptr< TargetCodeGenInfo > createDirectXTargetCodeGenInfo(CodeGenModule &CGM)
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
llvm::dxil::ResourceClass ResourceClass