public static Vertex classVarDeclaration(Graph graph, ClassVarDeclNode node) {
return classVarDeclaration(graph, node, null);
}
public static Vertex classVarDeclaration(Graph graph, ClassVarDeclNode node, Vertex src) {
RubyModule klass = graph.getRuntime().getContext().getFrameModule();
if (src == null) {
src = graph.createVertex(node.getValueNode());
}
VertexHolder holder = (VertexHolder) klass.getClassVar(node.getName());
if (holder == null) {
holder = graph.createFreeVertexHolder();
klass.setClassVar(node.getName(), holder);
}
// Clear older types (performance issue)
holder.getVertex().getTypeSet().clear();
graph.addEdgeAndPropagate(src, holder.getVertex());
return src;