| 91 | } |
| 92 | |
| 93 | void 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 | |
| 110 | protobufs::Transformation TransformationAddGlobalVariable::ToMessage() const { |
| 111 | protobufs::Transformation result; |
nothing calls this directly
no test coverage detected