MCPcopy Create free account
hub / github.com/Inori/GPCS4 / build

Method build

GPCS4/Graphics/Gcn/ControlFlowGraph/GcnStackifier.cpp:118–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116 }
117
118 void GcnTokenListBuilder::build(GcnTokenList& tokens)
119 {
120 m_insertPtr = tokens.begin();
121 m_tokens = &tokens;
122
123 auto entry = boost::vertex(0, m_cfg);
124
125 m_visitedCounts[entry] = 0;
126 m_visitStack.emplace_back(entry, StackElement::Delayed);
127 m_visitStack.emplace_back(entry, StackElement::Immediate);
128
129 while (!m_visitStack.empty())
130 {
131 auto& element = m_visitStack.back();
132 if (element.m_kind == StackElement::Immediate)
133 {
134 m_visitStack.pop_back();
135 processVertex(element.m_vertex);
136 }
137 else
138 {
139 auto& delayedVertices = m_delayedQueues[element.m_vertex];
140 if (delayedVertices.empty())
141 {
142 m_visitStack.pop_back();
143 continue;
144 }
145
146 auto vtx = delayedVertices.back();
147 delayedVertices.pop_back();
148 processVertex(vtx);
149 }
150 }
151
152 popScopes(entry);
153
154 LOG_ASSERT(m_scopeStack.empty(), "scope not all closed.");
155 }
156
157 void GcnTokenListBuilder::processVertex(GcnCfgVertex vtx)
158 {

Callers 1

structurizeMethod · 0.45

Calls 6

vertexFunction · 0.85
emplace_backMethod · 0.80
backMethod · 0.80
beginMethod · 0.45
emptyMethod · 0.45
pop_backMethod · 0.45

Tested by

no test coverage detected