Can clang generate a call graph for an Xcode project (in Objective-C? -



Can clang generate a call graph for an Xcode project (in Objective-C? -

i found this example looks outputs want c++. how can done objective-c code in xcode project?

i see mentions of doxygen beingness able create phone call graph, can't find example.

(i want know clang better, it's hard started...)

absolutely. there couple of tricks need understand, it's not bad.

first, need compatible version of opt, since doesn't come llvm apple ships. got mine macports:

port install llvm-3.0

then need compile file. working out parameters can bit of pain. easiest way allow xcode build it, go logs , cutting , paste out giant build line. used able hand-hack these, i've gotten lazy....

take out lastly -o parameter (conveniently @ end of compile line), , substitute:

-s -emit-llvm -o - | opt-mp-3.0 -analyze -dot-callgraph

then, in other example:

$ dot -tpng -ocallgraph.png callgraph.dot

keep in mind there few functions called a lot in objc never care about. in particular, starts objc_. luckily dot format simple text file, , it's pretty easy write post-processing scripts strip out don't want.

there's -print-callgraph parameter out set info in different format if want farther processing.

objective-c xcode clang call-graph

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -