MCPcopy Create free account
hub / github.com/avast/retdec / insertStackVariable

Method insertStackVariable

src/bin2llvmir/providers/config.cpp:333–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331}
332
333const retdec::common::Object* Config::insertStackVariable(
334 const llvm::AllocaInst* sv,
335 int offset,
336 bool fromDebug,
337 const std::string& realName)
338{
339 auto* cf = getConfigFunction(sv->getFunction());
340
341 if (cf == nullptr)
342 {
343 assert(false);
344 }
345
346 assert(cf);
347 if (cf == nullptr)
348 {
349 return nullptr;
350 }
351
352 retdec::common::Object local(
353 sv->getName(),
354 retdec::common::Storage::onStack(offset));
355 if (realName.empty())
356 {
357 local.setRealName(sv->getName());
358 }
359 else
360 {
361 local.setRealName(realName);
362 }
363 local.setIsFromDebug(fromDebug);
364 local.type.setLlvmIr(llvmObjToString(sv->getType()));
365
366 auto p = cf->locals.insert(local);
367 return &(*p.first);
368}
369
370const retdec::common::Function* Config::insertFunction(
371 const llvm::Function* fnc,

Callers 2

getStackVariableMethod · 0.80
TEST_FFunction · 0.80

Calls 9

setLlvmIrMethod · 0.80
llvmObjToStringFunction · 0.50
getFunctionMethod · 0.45
getNameMethod · 0.45
emptyMethod · 0.45
setRealNameMethod · 0.45
setIsFromDebugMethod · 0.45
getTypeMethod · 0.45
insertMethod · 0.45

Tested by 1

TEST_FFunction · 0.64