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

Method getDefinition

lib/rootdefanalysis/RDNode.cpp:153–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151const std::set<RDArgIndex> &RDNode::getFirstUses() const { return FirstUses; }
152
153std::pair<Value *, int> RDNode::getDefinition() const {
154
155 assert(Target && Location && "Unexpected Program State");
156
157 if (isa<CallBase>(Location) && Idx >= 0) {
158 return std::make_pair(Location, Idx);
159 }
160
161 assert(Target && "Unexpected Program State");
162 auto &IR = Target->getIR();
163
164 if (isa<Constant>(&IR)) {
165 if (auto *GV = dyn_cast_or_null<GlobalVariable>(&IR)) {
166 if (!GV->hasAtLeastLocalUnnamedAddr())
167 return std::make_pair(&IR, -1);
168 }
169 return std::make_pair(Location, -1);
170 }
171 return std::make_pair(&IR, -1);
172}
173
174bool RDNode::isVisit(const RDTarget &T, const Instruction &I) const {
175 const auto *F = I.getFunction();

Callers 13

isCStyleStructFunction · 0.80
checkMethod · 0.80
collectASTIRNodesMethod · 0.80
isInvalidRDNodeMethod · 0.80
isFilePathMethod · 0.80
existMethod · 0.80
TEST_FFunction · 0.80
existFunction · 0.80
generateASTIRNodeMethod · 0.80
generateASTIRNodesMethod · 0.80

Calls

no outgoing calls

Tested by 6

existMethod · 0.64
TEST_FFunction · 0.64
existFunction · 0.64
generateASTIRNodeMethod · 0.64
generateASTIRNodesMethod · 0.64
getDefMapGeneratorMethod · 0.64