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

Method generateRDNode

tests/inputfilter/TestInputFilter.cpp:42–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40 }
41
42 std::shared_ptr<RDNode> generateRDNode(std::string FuncName, unsigned BIdx,
43 unsigned IIdx, int OIdx) {
44 auto *I = IRAH->getInstruction(FuncName, BIdx, IIdx);
45 if (!I)
46 return nullptr;
47
48 if (OIdx >= (int)I->getNumOperands() || OIdx < -1)
49 return nullptr;
50
51 llvm::Value *V = I;
52 if (OIdx > -1)
53 V = I->getOperand(OIdx);
54
55 auto Node = std::make_shared<RDNode>(*V, *I);
56 auto *CB = llvm::dyn_cast<llvm::CallBase>(&Node->getLocation());
57 if (CB && Node->getIdx() >= 0)
58 Node->setFirstUse(*CB, Node->getIdx());
59 return Node;
60 }
61
62 std::shared_ptr<RDNode> generateRDNode(std::string GlobalName,
63 std::string FuncName, unsigned BIdx,

Callers

nothing calls this directly

Calls 4

getInstructionMethod · 0.80
getIdxMethod · 0.80
setFirstUseMethod · 0.80
getGlobalVariableMethod · 0.80

Tested by

no test coverage detected