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

Method generateAssignStatement

lib/generation/UTModify.cpp:106–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106std::string UTModify::generateAssignStatement(const FuzzInput &Input) const {
107 const auto &Def = Input.getDef();
108
109 auto VarName = Input.getFuzzVarName();
110 auto Identifier = generateIdentifier(Def);
111 auto &T = Def.DataType;
112 assert(T && "Unexpected Program State");
113
114 if (T->isFixedLengthArrayPtr())
115 return util::getFixedLengthArrayAssignStmt(Identifier, VarName);
116
117 if (Def.Declaration == Definition::DeclType_Global ||
118 Def.Declaration == Definition::DeclType_StaticLocal)
119 return Identifier + " = " + VarName + ";";
120
121 if (Def.AssignOperatorRequired)
122 return " = " + VarName;
123
124 return VarName;
125}
126
127void UTModify::generateBottom(
128 const std::map<std::string, std::vector<std::string>> &FuzzVarFlagDecls,

Callers

nothing calls this directly

Calls 4

getDefMethod · 0.80
getFuzzVarNameMethod · 0.80
isFixedLengthArrayPtrMethod · 0.80

Tested by

no test coverage detected