#include "CGHLSLRuntime.h"
#include "CGDebugInfo.h"
#include "CodeGenModule.h"
#include "TargetInfo.h"
#include "clang/AST/Decl.h"
#include "clang/Basic/TargetOptions.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/FormatVariadic.h"
usingnamespaceclang;
usingnamespaceCodeGen;
usingnamespaceclang::hlsl;
usingnamespacellvm;
namespace {
void addDxilValVersion(StringRef ValVersionStr, llvm::Module &M) { … }
void addDisableOptimizations(llvm::Module &M) { … }
void layoutBuffer(CGHLSLRuntime::Buffer &Buf, const DataLayout &DL) { … }
GlobalVariable *replaceBuffer(CGHLSLRuntime::Buffer &Buf) { … }
}
llvm::Type *CGHLSLRuntime::convertHLSLSpecificType(const Type *T) { … }
llvm::Triple::ArchType CGHLSLRuntime::getArch() { … }
void CGHLSLRuntime::addConstant(VarDecl *D, Buffer &CB) { … }
void CGHLSLRuntime::addBufferDecls(const DeclContext *DC, Buffer &CB) { … }
void CGHLSLRuntime::addBuffer(const HLSLBufferDecl *D) { … }
void CGHLSLRuntime::finishCodeGen() { … }
CGHLSLRuntime::Buffer::Buffer(const HLSLBufferDecl *D)
: … { … }
void CGHLSLRuntime::addBufferResourceAnnotation(llvm::GlobalVariable *GV,
llvm::hlsl::ResourceClass RC,
llvm::hlsl::ResourceKind RK,
bool IsROV,
llvm::hlsl::ElementType ET,
BufferResBinding &Binding) { … }
static llvm::hlsl::ElementType
calculateElementType(const ASTContext &Context, const clang::Type *ResourceTy) { … }
void CGHLSLRuntime::annotateHLSLResource(const VarDecl *D, GlobalVariable *GV) { … }
CGHLSLRuntime::BufferResBinding::BufferResBinding(
HLSLResourceBindingAttr *Binding) { … }
void clang::CodeGen::CGHLSLRuntime::setHLSLEntryAttributes(
const FunctionDecl *FD, llvm::Function *Fn) { … }
static Value *buildVectorInput(IRBuilder<> &B, Function *F, llvm::Type *Ty) { … }
llvm::Value *CGHLSLRuntime::emitInputSemantic(IRBuilder<> &B,
const ParmVarDecl &D,
llvm::Type *Ty) { … }
void CGHLSLRuntime::emitEntryFunction(const FunctionDecl *FD,
llvm::Function *Fn) { … }
void CGHLSLRuntime::setHLSLFunctionAttributes(const FunctionDecl *FD,
llvm::Function *Fn) { … }
static void gatherFunctions(SmallVectorImpl<Function *> &Fns, llvm::Module &M,
bool CtorOrDtor) { … }
void CGHLSLRuntime::generateGlobalCtorDtorCalls() { … }