OSDN Git Service

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)
commit95764ec6ed9d399703b8730f5471e779fe864415
treef2df89a20a7f58fe71631524d73347bdb281dd66
parent29e8a627ba757eb9140cd3b1d550c35580308405
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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222149 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/CallGraph.h
unittests/Analysis/CMakeLists.txt
unittests/Analysis/CallGraphTest.cpp [new file with mode: 0644]
unittests/Analysis/Makefile