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

Method getValue

lib/constantanalysis/ASTValue.cpp:224–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224std::string ASTValue::getValue(const StringLiteral &SL) const {
225
226 auto Result = SL.getBytes().str();
227 util::replaceStrAll(Result, "\\", "\\\\");
228 util::replaceStrAll(Result, "\'", "\\\'");
229 util::replaceStrAll(Result, "\"", "\\\"");
230 util::replaceStrAll(Result, "\a", "\\a");
231 util::replaceStrAll(Result, "\b", "\\b");
232 util::replaceStrAll(Result, "\f", "\\f");
233 util::replaceStrAll(Result, "\n", "\\n");
234 util::replaceStrAll(Result, "\r", "\\r");
235 util::replaceStrAll(Result, "\t", "\\t");
236 util::replaceStrAll(Result, "\v", "\\v");
237
238 for (unsigned S = 0; S < Result.size(); ++S) {
239 if (Result[S] != '\0')
240 continue;
241 Result.replace(S, 1, "\\0");
242 S += 1;
243 }
244
245 return Result;
246}
247
248std::vector<ASTValueData>
249ASTValue::getDataForArray(const clang::Expr &E,

Callers

nothing calls this directly

Calls 2

replaceStrAllFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected