Pointers - Handling indirect function calls inherently leads to imprecision. ![]() Your implementation must be able to handle this. Recursion - Both direct and mutual recursion must work correctly.įor this project, recursion shouldn't pose any special problems, but it isĪlways a useful corner case to bear in mind.ĭisconnected graphs - Not every function may be reachable from the mainĪs a result, the call graph may form several disconnected components. You should ignore these functions in your callgraph. That have names starting with `llvm.dbg`. In particular, some debugging information is anchored by calls to functions IR Intrinsics - LLVM inserts calls to some functions in order to represent ![]() Understand your results are provided to you. %3 bar bar Weight: 4 example.c:4 example.c:5 bar:l1->bar foo foo Weight: 4 bar:l0->foo baz baz Weight: 2 example.c:9 example.c:10 baz:l1->bar baz:l0->foo main main Weight: 0 example.c:14 example.c:15 example.c:16 example.c:23 main:l1->bar main:l3->bar main:l0->foo main:l3->foo main:l2->baz main:l3->bazĮxamples of how you can automatically produce these pictures to better Pictures of the call graph like the following: Which can in turn be passed to the `dot` command to automatically produce You are also provided with a script thatĬan automatically convert the CSV format into aĭigraph The CSV format is easy for you to produce and easier for me to grade, but it is The second section encodes each edge of the call It should consist of only numbers and/or letters, but apart from that The call site ID is a unique identifier for each individual call site in aįunction. The first section encodes each function in the call graphs on a separate line. ![]() This CSV format is divided into two sections, separated by a blank line. The number of incoming edges to that particular function. In addition, they shall show the weight of a function in the call graph, The call graphs that you construct for this project shall show the potentiallyĬalled functions for each call site within a program. Or lines in foo() that make calls to bar(). These graphs can also be made more informative by noting the precise call sites They are especially useful for understanding programs with indirect calls orįor such programs, a single call site in a program may call many differentįunctions across different program executions or even within a single execution Such call graphs can be helpful for examining the structure of a program,Īnd they are also a crucial first step in many other analyses. Provide the same information that you will be required to present in thisĪs a reminder, a call graph is a directed graph where the nodes represent theĪn edge exists from foo() to bar() when foo() may call bar(). Printing call graphs however, the graphs that LLVM computes do not necessarily You may notice that LLVM already has some functionality for computing and ![]() You will also gain experience recognizing limitations and trade-offs made whenĭesigning and constructing a static analysis tool.įor this project, you will construct an LLVM tool that can compute and outputĪ static call graph for an input program. To gather basic information about computer programs. This project will help you get acquainted with using infrastructures like LLVM
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |