请输入您要查询的百科知识:

 

词条 Pointer analysis
释义

  1. Example

  2. Introduction

  3. Algorithms

  4. References

  5. Bibliography

In computer science, pointer analysis, or points-to analysis, is a static code analysis technique that establishes which pointers, or heap references, can point to which variables, or storage locations. It is often a component of more complex analyses such as escape analysis. A closely related technique is shape analysis.

(This is the most common colloquial use of the term. A secondary use has pointer analysis be the collective name for both points-to analysis, defined as above, and alias analysis. Points-to and alias analysis are closely related but not always equivalent problems.)

Example

For the following example program, a points-to analysis would

compute that the points-to set of p is {x, y}.

int x;

int y;

int* p = unknown() ? &x : &y;

Introduction

Techniques range widely in performance and precision. For large programs, some tradeoffs may be necessary to make the analysis finish in reasonable time and space. Two examples of these tradeoffs are:[1]

  • Treating all references from a structured object as being from the object as a whole. This is known as field insensitivity or structure insensitivity.
  • Ignoring flow of control when analysing which objects are assigned to pointers. This is known as context-insensitive pointer analysis (when ignoring the context in which function calls are made) or flow-insensitive pointer analysis (when ignoring the control flow within a procedure).

The disadvantage of these simplifications is that the calculated set of objects pointed to may become less precise.

Algorithms

  • Steensgaard's algorithm
  • Andersen's algorithm

References

1. ^{{cite conference| title=Dimensions of Precision in Reference Analysis of Object-Oriented Programming Languages| author=Barbara G. Ryder| year=2003| booktitle=Compiler Construction, 12th International Conference, CC 2003 Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2003 Warsaw, Poland, April 7–11, 2003 Proceedings| pages=126–137|doi = 10.1007/3-540-36579-6_10}}

Bibliography

  • {{cite conference

| url =http://www.cs.trinity.edu/~mlewis/CSCI3294-F01/Papers/p54-hind.pdf
| title =Pointer analysis: haven't we solved this problem yet?
| author =Michael Hind
| year =2001
| booktitle =PASTE '01: Proceedings of the 2001 ACM SIGPLAN-SIGSOFT workshop on Program analysis for software tools and engineering
| pages =54–61
| isbn =1-58113-413-4
| publisher =ACM
}}
  • {{cite conference

| url =http://cms.dc.uba.ar/materias/aap/2008/c2/descargas/pointsTo.pdf
| title =Points-to analysis in almost linear time
| last = Steensgaard | first = Bjarne
| year =1996
| booktitle =POPL '96: Proceedings of the 23rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
| pages =32–41
| doi = 10.1145/237721.237727
| isbn =0-89791-769-3
| location = New York, NY, USA
| publisher =ACM
}}
  • {{cite thesis

| degree =PhD
| title =Program Analysis and Specialization for the C Programming Language
| url =http://www.cs.cornell.edu/courses/cs711/2005fa/papers/andersen-thesis94.pdf
| author =Andersen, Lars Ole
| year =1994
}}{{DEFAULTSORT:Pointer Analysis}}

1 : Static program analysis

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/24 4:19:49