[llvm-commits] Call graph printer/viewer

Speziale Ettore speziale.ettore at gmail.com
Fri Jan 11 01:32:06 PST 2013


Hello,

> > Hi,
> > 
> >> The existing code for graph printers follows an odd style. I would add new code using a more standard style...
> >> 
> >> +    : ModulePass(ID) {
> >> +    Name = GraphName;
> >> 
> >> ...use the initializer list.
> > 
> > I kept the old style to be consistent -- I will refactor the whole file.
> > 
> >> +  virtual bool runOnModule(Module &M) {
> >> +    Analysis *Graph;
> >> +    std::string Title;
> >> +    Graph = &getAnalysis<Analysis>();
> >> +    Title = DOTGraphTraits<Analysis*>::getGraphName(Graph);
> >> 
> >> ...declare and initialize your variables on the same line.
> > 
> > Same as above. Moreover, is it OK if I use llvm::StringRef +
> > llvm::SmallString instead of std::string?

Updated patch. I still use std::string because llvm::SmallString lacks
operator+.

Bye,
speziale.ettore at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: call-graph-refactor-v2.diff
Type: text/x-patch
Size: 13036 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130111/eb83d0cf/attachment.bin>


More information about the llvm-commits mailing list