40 return "DXContainer Global Emitter";
53bool DXContainerGlobals::runOnModule(
Module &M) {
55 Globals.push_back(getShaderFlags(M));
56 Globals.push_back(computeShaderHash(M));
64 (
uint64_t)(getAnalysis<ShaderFlagsAnalysisWrapper>().getShaderFlags());
69 FlagsConstant,
"dx.sfi0");
70 GV->setSection(
"SFI0");
71 GV->setAlignment(
Align(4));
77 cast<ConstantDataArray>(
M.getNamedGlobal(
"dx.dxil")->getInitializer());
79 Digest.
update(DXILConstant->getRawDataValues());
85 if (
M.debug_compile_units_begin() !=
M.debug_compile_units_end())
86 HashData.
Flags =
static_cast<uint32_t>(dxbc::HashFlags::IncludesSource);
88 memcpy(
reinterpret_cast<void *
>(&HashData.
Digest),
Result.data(), 16);
97 ModuleConstant,
"dx.hash");
98 GV->setSection(
"HASH");
99 GV->setAlignment(
Align(4));
103char DXContainerGlobals::ID = 0;
105 "DXContainer Global Emitter",
false,
true)
111 return new DXContainerGlobals();
This file contains the declarations for the subclasses of Constant, which represent the different fla...
dxil DXContainer Global Emitter
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
Class for arbitrary precision integers.
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
void setPreservesAll()
Set by analyses that do not transform their input at all.
static Constant * get(LLVMContext &Context, ArrayRef< ElementTy > Elts)
get() constructor - Return a constant with array type with an element count and element type matching...
static Constant * get(Type *Ty, uint64_t V, bool IsSigned=false)
If Ty is a vector type, return a Constant with a splat of the given value.
This is an important base class in LLVM.
@ PrivateLinkage
Like Internal, but omit from symbol table.
void update(ArrayRef< uint8_t > Data)
Updates the hash for the byte stream provided.
void final(MD5Result &Result)
Finishes off the hash and puts the result in result.
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
virtual bool runOnModule(Module &M)=0
runOnModule - Virtual method overriden by subclasses to process the module being operated on.
A Module instance is used to store all the information related to an LLVM module.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
virtual void getAnalysisUsage(AnalysisUsage &) const
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
Type * getType() const
All values are typed, get the type of this value.
Wrapper pass for the legacy pass manager.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
constexpr bool IsBigEndianHost
This is an optimization pass for GlobalISel generic memory operations.
ModulePass * createDXContainerGlobalsPass()
Pass for generating DXContainer part globals.
@ Global
Append to llvm.global_dtors.
void appendToCompilerUsed(Module &M, ArrayRef< GlobalValue * > Values)
Adds global values to the llvm.compiler.used list.
void initializeDXContainerGlobalsPass(PassRegistry &)
Initializer for DXContainerGlobals pass.
This struct is a compact representation of a valid (non-zero power of two) alignment.