MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / Apply

Method Apply

source/fuzz/transformation_add_global_variable.cpp:93–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93void TransformationAddGlobalVariable::Apply(
94 opt::IRContext* ir_context,
95 TransformationContext* transformation_context) const {
96 opt::Instruction* new_instruction = fuzzerutil::AddGlobalVariable(
97 ir_context, message_.fresh_id(), message_.type_id(),
98 static_cast<spv::StorageClass>(message_.storage_class()),
99 message_.initializer_id());
100
101 // Inform the def-use manager about the new instruction.
102 ir_context->get_def_use_mgr()->AnalyzeInstDefUse(new_instruction);
103
104 if (message_.value_is_irrelevant()) {
105 transformation_context->GetFactManager()->AddFactValueOfPointeeIsIrrelevant(
106 message_.fresh_id());
107 }
108}
109
110protobufs::Transformation TransformationAddGlobalVariable::ToMessage() const {
111 protobufs::Transformation result;

Callers

nothing calls this directly

Calls 7

AddGlobalVariableFunction · 0.85
AnalyzeInstDefUseMethod · 0.80
GetFactManagerMethod · 0.80
type_idMethod · 0.45
storage_classMethod · 0.45
get_def_use_mgrMethod · 0.45

Tested by

no test coverage detected