MCPcopy Create free account
hub / github.com/WebAssembly/wabt / GenAccess

Method GenAccess

include/wabt/decompiler-ls.h:239–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237 }
238
239 std::string GenAccess(uint64_t offset, const Node& addr_exp) const {
240 auto name = AddrExpName(addr_exp);
241 if (name.empty()) {
242 return "";
243 }
244 auto it = vars.find(name);
245 if (it == vars.end()) {
246 return "";
247 }
248 if (it->second.struct_layout) {
249 auto ait = it->second.accesses.find(offset);
250 assert(ait != it->second.accesses.end());
251 return IdxToName(ait->second.idx);
252 }
253 // Not a struct, see if it is a typed pointer.
254 if (it->second.same_type != Type::Void) {
255 return "*";
256 }
257 return "";
258 }
259
260 void Clear() { vars.clear(); }
261

Callers 1

LoadStoreMethod · 0.80

Calls 3

findMethod · 0.80
emptyMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected