<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Hello,</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is it possible to avoid the code duplication?<br></blockquote><div><br></div></span><div>Not sure about that ... I'll try to do some experiments ...</div></div></div></div></blockquote><div><br></div><div>I tried to factorize the const CallGraphNode * with CallGraphNode * specialization and const CallGraph * with CallGraph * specialization. I had to introduce some templates/traits to support that. It is working, but I am not sure if it is the correct approach ... -- I'm not very expert with templates ....</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Since this is just an API change, can you add a unittest?</blockquote></span></div></div></div></blockquote><div><br></div><div>Added some simple unit tests that iterate over all nodes in different call graphs using GraphTraits iterators.</div><div><br></div><div>In the process, I added a couple of member functions to CallGraph -- i.e. CallGraph::size() -- and CallGraph::empty() -- to implement sanity checks in the unit tests.</div><div><br></div><div>To build the test call graphs I used an utility function I found in LazyCallGraphTests.cpp. I moved that function to a separate file to be used by both tests.</div><div><br></div><div>I modified the CMake files in order to build and link the new tests, but I am not very expert of it. I tried to grep the codebase and I did not find an header file being included by any add_llvm_unittest, so I did not add CallGraphTestUtils.h there. Is that OK?</div><div><br></div><div>Thanks,</div><div>Ettore Speziale</div></div></div></div>