|
clang 24.0.0git
|
#include "CGHLSLRuntime.h"#include "CGDebugInfo.h"#include "CGRecordLayout.h"#include "CodeGenFunction.h"#include "CodeGenModule.h"#include "HLSLBufferLayoutBuilder.h"#include "TargetInfo.h"#include "clang/AST/ASTContext.h"#include "clang/AST/Attr.h"#include "clang/AST/Decl.h"#include "clang/AST/Expr.h"#include "clang/AST/HLSLResource.h"#include "clang/AST/MatrixUtils.h"#include "clang/AST/RecursiveASTVisitor.h"#include "clang/AST/Type.h"#include "clang/Basic/DiagnosticDriver.h"#include "clang/Basic/DiagnosticFrontend.h"#include "clang/Basic/SourceManager.h"#include "clang/Basic/TargetOptions.h"#include "llvm/ADT/DenseMap.h"#include "llvm/ADT/Enum.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/SmallPtrSet.h"#include "llvm/ADT/SmallString.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/StringSwitch.h"#include "llvm/Frontend/HLSL/HLSLResource.h"#include "llvm/Frontend/HLSL/HLSLUtils.h"#include "llvm/Frontend/HLSL/RootSignatureMetadata.h"#include "llvm/Frontend/HLSL/SemanticSignaturePacking.h"#include "llvm/IR/Constants.h"#include "llvm/IR/DerivedTypes.h"#include "llvm/IR/GlobalVariable.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/LLVMContext.h"#include "llvm/IR/Metadata.h"#include "llvm/IR/Module.h"#include "llvm/IR/Type.h"#include "llvm/IR/Value.h"#include "llvm/Support/Alignment.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/FormatVariadic.h"#include "llvm/Support/Path.h"#include "llvm/Transforms/Utils/ModuleUtils.h"#include <array>#include <cstdint>#include <optional>Go to the source code of this file.
Classes | |
| class | OpaqueValueVisitor |
Functions | |
| static const clang::HLSLAttributedResourceType * | createBufferHandleType (const HLSLBufferDecl *BufDecl) |
| static void | addSPIRVQuadAllExecutionModes (CodeGenModule &CGM) |
| static Value * | buildVectorInput (IRBuilder<> &B, Function *F, llvm::Type *Ty) |
| static bool | requiresFlatInterpolation (llvm::Type *Ty) |
| static llvm::hlsl::InterpolationMode | getSPIRVInterpolationMode (llvm::hlsl::InterpolationMode InterpMode, llvm::Type *Ty, llvm::Triple::EnvironmentType Stage, llvm::hlsl::IOType IO) |
| static void | addSPIRVInterfaceDecorations (llvm::GlobalVariable *GV, llvm::hlsl::SPIRVInterfaceDecoration Decoration, unsigned Operand, llvm::hlsl::InterpolationMode InterpMode=llvm::hlsl::InterpolationMode::Undefined) |
| static llvm::Value * | createSPIRVInputLoad (IRBuilder<> &B, llvm::Module &M, llvm::Type *Ty, const Twine &Name, llvm::hlsl::SPIRVInterfaceDecoration Decoration, unsigned Operand, llvm::hlsl::InterpolationMode InterpMode) |
| static llvm::Value * | createSPIRVBuiltinDelta (IRBuilder<> &B, llvm::Module &M, llvm::Type *Ty, const Twine &Name, unsigned BuiltInID, unsigned BaseBuiltInID, llvm::hlsl::InterpolationMode InterpMode) |
| static llvm::GlobalVariable * | createSPIRVSampleMaskVariable (CodeGenModule &CGM, llvm::Type *Ty, const Twine &Name, bool IsInput, llvm::hlsl::InterpolationMode InterpMode) |
| static llvm::Value * | createSPIRVSampleMaskLoad (IRBuilder<> &B, CodeGenModule &CGM, llvm::Type *Ty, const Twine &Name, llvm::hlsl::InterpolationMode InterpMode) |
| static void | createSPIRVSampleMaskStore (IRBuilder<> &B, CodeGenModule &CGM, llvm::Value *Source, const Twine &Name, llvm::hlsl::InterpolationMode InterpMode) |
| static void | createSPIRVOutputStore (IRBuilder<> &B, llvm::Module &M, llvm::Value *Source, const Twine &Name, llvm::hlsl::SPIRVInterfaceDecoration Decoration, unsigned Operand, llvm::hlsl::InterpolationMode InterpMode, bool IsSigned=false) |
| static QualType | getSemanticLeafType (const clang::DeclaratorDecl *Decl) |
| static SemanticShape | getSemanticShape (ASTContext &Ctx, QualType Ty) |
| static llvm::dxil::ElementType | getSignatureComponentType (CodeGenModule &CGM, QualType Ty) |
| static llvm::hlsl::SemanticSignatureElement | createSemanticSignatureElement (CodeGenModule &CGM, uint32_t SigId, HLSLAppliedSemanticAttr *Semantic, std::optional< unsigned > Index, const SemanticShape &Shape) |
| static unsigned | getSPIRVVkBuiltinID (StringRef BuiltIn) |
| static void | markArbitrarySignatureElements (SmallVectorImpl< llvm::hlsl::SemanticSignatureElement > &Signature, size_t FirstElement) |
| static void | makeSystemValueSignatureElementsUnsigned (SmallVectorImpl< llvm::hlsl::SemanticSignatureElement > &Signature, size_t FirstElement) |
| static void | gatherFunctions (SmallVectorImpl< Function * > &Fns, llvm::Module &M, bool CtorOrDtor) |
| static void | initializeBuffer (CodeGenModule &CGM, llvm::GlobalVariable *GV, Intrinsic::ID IntrID, ArrayRef< llvm::Value * > Args) |
|
static |
Definition at line 1196 of file CGHLSLRuntime.cpp.
Referenced by createSPIRVInputLoad(), createSPIRVOutputStore(), createSPIRVSampleMaskVariable(), and clang::CodeGen::CGHLSLRuntime::handleGlobalVarDefinition().
|
static |
Definition at line 1010 of file CGHLSLRuntime.cpp.
References clang::Call, clang::CodeGen::CodeGenModule::getDiags(), clang::CodeGen::CodeGenModule::getModule(), clang::DiagnosticsEngine::Report(), and uint64_t.
Referenced by clang::CodeGen::CGHLSLRuntime::finishCodeGen().
|
static |
Definition at line 1146 of file CGHLSLRuntime.cpp.
Referenced by clang::CodeGen::CGHLSLRuntime::emitSystemSemanticLoad().
|
static |
Definition at line 898 of file CGHLSLRuntime.cpp.
References clang::cast(), clang::Decl::getASTContext(), clang::ASTContext::getCanonicalTagType(), clang::ASTContext::getHLSLAttributedResourceType(), clang::HLSLBufferDecl::getLayoutStruct(), and clang::QualType::getTypePtr().
Referenced by clang::CodeGen::CGHLSLRuntime::addBuffer().
|
static |
Definition at line 1482 of file CGHLSLRuntime.cpp.
References getSignatureComponentType(), uint32_t, and uint8_t.
Referenced by clang::CodeGen::CGHLSLRuntime::emitSystemSemanticLoad().
|
static |
Definition at line 1272 of file CGHLSLRuntime.cpp.
References createSPIRVInputLoad().
Referenced by clang::CodeGen::CGHLSLRuntime::emitSystemSemanticLoad().
|
static |
Definition at line 1246 of file CGHLSLRuntime.cpp.
References addSPIRVInterfaceDecorations().
Referenced by createSPIRVBuiltinDelta(), clang::CodeGen::CGHLSLRuntime::emitSystemSemanticLoad(), and clang::CodeGen::CGHLSLRuntime::handleScalarSemanticLoad().
|
static |
Definition at line 1351 of file CGHLSLRuntime.cpp.
References addSPIRVInterfaceDecorations().
Referenced by clang::CodeGen::CGHLSLRuntime::emitSystemSemanticStore(), and clang::CodeGen::CGHLSLRuntime::handleScalarSemanticStore().
|
static |
Definition at line 1308 of file CGHLSLRuntime.cpp.
References createSPIRVSampleMaskVariable().
Referenced by clang::CodeGen::CGHLSLRuntime::emitSystemSemanticLoad().
|
static |
Definition at line 1319 of file CGHLSLRuntime.cpp.
References createSPIRVSampleMaskVariable().
Referenced by clang::CodeGen::CGHLSLRuntime::emitSystemSemanticStore().
|
static |
Definition at line 1289 of file CGHLSLRuntime.cpp.
References addSPIRVInterfaceDecorations(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::getModule(), clang::ASTContext::getTargetAddressSpace(), clang::hlsl_input, and clang::hlsl_output.
Referenced by createSPIRVSampleMaskLoad(), and createSPIRVSampleMaskStore().
|
static |
Definition at line 2571 of file CGHLSLRuntime.cpp.
References clang::cast(), and clang::isa().
Referenced by clang::CodeGen::CGHLSLRuntime::generateGlobalCtorDtorCalls().
|
static |
Definition at line 1441 of file CGHLSLRuntime.cpp.
Referenced by clang::CodeGen::CGHLSLRuntime::emitSystemSemanticLoad(), and clang::CodeGen::CGHLSLRuntime::emitSystemSemanticStore().
|
static |
Definition at line 1449 of file CGHLSLRuntime.cpp.
References clang::Type::getAs(), clang::ASTContext::getAsConstantArrayType(), clang::ASTContext::getExtVectorType(), clang::ASTContext::getLangOpts(), and clang::isMatrixRowMajor().
Referenced by clang::CodeGen::CGHLSLRuntime::emitSystemSemanticLoad().
|
static |
Definition at line 1472 of file CGHLSLRuntime.cpp.
References clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), clang::Type::getAs(), clang::CodeGen::CodeGenModule::getTypes(), and clang::Type::isSignedIntegerOrEnumerationType().
Referenced by createSemanticSignatureElement().
|
static |
Definition at line 1182 of file CGHLSLRuntime.cpp.
References clang::IO, and requiresFlatInterpolation().
Referenced by clang::CodeGen::CGHLSLRuntime::handleScalarSemanticLoad(), and clang::CodeGen::CGHLSLRuntime::handleScalarSemanticStore().
|
static |
Definition at line 2022 of file CGHLSLRuntime.cpp.
Referenced by clang::CodeGen::CGHLSLRuntime::handleScalarSemanticLoad(), and clang::CodeGen::CGHLSLRuntime::handleScalarSemanticStore().
|
static |
Definition at line 2643 of file CGHLSLRuntime.cpp.
References clang::CodeGen::CodeGenModule::AddCXXGlobalInit(), clang::CodeGen::CodeGenModule::getLLVMContext(), clang::CodeGen::CodeGenModule::getModule(), and clang::CodeGen::CodeGenTypeCache::VoidTy.
|
static |
Definition at line 2193 of file CGHLSLRuntime.cpp.
Referenced by clang::CodeGen::CGHLSLRuntime::handleScalarSemanticLoad(), and clang::CodeGen::CGHLSLRuntime::handleScalarSemanticStore().
|
static |
Definition at line 2183 of file CGHLSLRuntime.cpp.
Referenced by clang::CodeGen::CGHLSLRuntime::handleScalarSemanticLoad(), and clang::CodeGen::CGHLSLRuntime::handleScalarSemanticStore().
|
static |
Definition at line 1166 of file CGHLSLRuntime.cpp.
Referenced by getSPIRVInterpolationMode().