Fix GraphTraits for "const CallGraphNode *" and "const CallGraph *"
authorRafael Espindola <rafael.espindola@gmail.com>
Mon, 17 Nov 2014 17:51:45 +0000 (17:51 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Mon, 17 Nov 2014 17:51:45 +0000 (17:51 +0000)
commiteaa3dccfafec4b7fadc1fe994ce1225c27f66082
treea78c34285b5d011397ed12d517d55e430e9fc3fb
parent119767db851033a09030e416dcc62bf1d5118485
Fix GraphTraits for "const CallGraphNode *" and "const CallGraph *"

The specializations were broken. For example,

void foo(const CallGraph *G) {
  auto I = GraphTraits<const CallGraph *>::nodes_begin(G);
  auto K = I++;

  ...
}

or

void bar(const CallGraphNode *N) {
  auto I = GraphTraits<const CallGraphNode *>::nodes_begin(G);
  auto K = I++;

  ....
}

would not compile.

Patch by Speziale Ettore!

llvm-svn: 222149
llvm/include/llvm/Analysis/CallGraph.h
llvm/unittests/Analysis/CMakeLists.txt
llvm/unittests/Analysis/CallGraphTest.cpp [new file with mode: 0644]
llvm/unittests/Analysis/Makefile