MCPcopy Create free account
hub / github.com/Samsung/UTopia / generateFuzzVarGlobalSetters

Method generateFuzzVarGlobalSetters

lib/generation/UTModify.cpp:227–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227void UTModify::generateFuzzVarGlobalSetters(
228 std::map<std::string, std::vector<GlobalVarSetter>> &Setters,
229 const FuzzInput &Input) const {
230 const auto &Def = Input.getDef();
231 if (Def.Declaration != Definition::DeclType_Global)
232 return;
233
234 auto Path = Def.Path;
235 auto FuncName = util::getAssignGlobalFuncName(Input.getFuzzVarName());
236 auto FuncBody = util::getIndent(1) + generateAssignStatement(Input);
237 UTModify::GlobalVarSetter Setter = {FuncName, FuncBody};
238 auto Iter = Setters.find(Path);
239 if (Iter == Setters.end()) {
240 Setters.emplace(Path, std::vector<UTModify::GlobalVarSetter>({Setter}));
241 return;
242 }
243 Iter->second.emplace_back(Setter);
244}
245
246void UTModify::generateFuzzVarReplacements(const FuzzInput &Input) {
247 const auto &Def = Input.getDef();

Callers

nothing calls this directly

Calls 6

getAssignGlobalFuncNameFunction · 0.85
getIndentFunction · 0.85
getDefMethod · 0.80
getFuzzVarNameMethod · 0.80
endMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected