Closed jacosro closed 4 years ago
Related but probably not the cause: we are using DefaultDirectedGraph
, but we should be using a DirectedPseudograph
as our base graph:
Class | Directed | Self loops | Repeated edges | Weights |
---|---|---|---|---|
DefaultDirectedGraph | ✅ | ✅ | ❌ | ❌ |
DirectedPseudograph | ✅ | ✅ | ✅ | ❌ |
Source: JGraphT docs
The other problem is that DataDependencyBuilder
bases its analysis on Graph#findNodeByASTNode(Node)
, which compares each vertex until it finds the first node that equals
the argument. This is a problem in programs with multiple instructions that are fundamentally the same, such as the following:
void f() {
int x = 0;
x++;
x++;
}
Possible solution: assuming we have range data (start and end of the instruction) in the AST, we could compare the ranges of both objects, to make sure they are the same element. In reality, the real solution will be solving #18.
Caused by #16
When a PDG is generated, some data dependencies are not shown in the generated images