29.01.2014 Views

A CIL Tutorial - Department of Computer Science - ETH Zürich

A CIL Tutorial - Department of Computer Science - ETH Zürich

A CIL Tutorial - Department of Computer Science - ETH Zürich

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 13. WHOLE-PROGRAM ANALYSIS 113<br />

foo<br />

main<br />

bar<br />

Figure 13.1: The call-graph for tut13a.c and tut13b.c<br />

13.3 Exercises<br />

1. Extend <strong>CIL</strong>'s call-graph analysis to correctly handle function pointers by using the Ptranal<br />

module dened in cil/src/ext/pta/ptranal.ml. Note the function Ptranal.resolve funptr.<br />

13.4 Further Reading<br />

The Capriccio [?] project uses a whole-program call-graph analysis to estimate the amount <strong>of</strong> stack<br />

space needed by threads in C programs. Then, in server programs that use multithreading to hide<br />

IO latency, lightweight user-level threads can be used to concurrently process a massive number<br />

<strong>of</strong> incoming client requests. The threads can be very lightweight thanks to the call-graph analysis<br />

putting an upper bound on the amount <strong>of</strong> stack space required.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!