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

Method setIndex

lib/astirmap/IRNode.cpp:47–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47void IRNode::setIndex(const GlobalValue &G) {
48 if (const auto *GVariable = dyn_cast<GlobalVariable>(&G)) {
49 SmallVector<DIGlobalVariableExpression *, 10> Debugs;
50 GVariable->getDebugInfo(Debugs);
51
52 for (auto *Debug : Debugs) {
53 if (!Debug || !Debug->getVariable())
54 continue;
55
56 auto *Var = Debug->getVariable();
57 Name = Var->getDisplayName();
58 if (Name.empty())
59 continue;
60
61 Index = LocIndex(getFullPath(*Var), 0, 0);
62 break;
63 }
64 }
65
66 if (!Name.empty())
67 return;
68
69 Name = G.getName();
70 assert(!Name.empty() && "Unexpected Program State");
71}

Callers

nothing calls this directly

Calls 4

LocIndexClass · 0.85
getFullPathFunction · 0.85
emptyMethod · 0.80
getNameMethod · 0.45

Tested by

no test coverage detected