llvm-analysis-0.3.0: A Haskell library for analyzing LLVM bitcode

Safe HaskellNone

LLVM.Analysis.PointsTo

Contents

Description

This module defines the interface to points-to analysis in this analysis framework. Each points-to analysis returns a result object that is an instance of the PointsToAnalysis typeclass; the results are intended to be consumed through this interface.

All of the points-to analysis implementations expose a single function:

 runPointsToAnalysis :: (PointsToAnalysis a) => Module -> a

This makes it easy to change the points-to analysis you are using: just modify your imports. If you need multiple points-to analyses in the same module (for example, to support command-line selectable points-to analysis precision), use qualified imports.

Synopsis

Classes

class PointsToAnalysis a whereSource

The interface to any points-to analysis.

Methods

mayAlias :: a -> Value -> Value -> BoolSource

Check whether or not two values may alias

pointsTo :: a -> Value -> [Value]Source

Return the list of values that a LoadInst may return. May return targets for other values too (e.g., say that a Function points to itself), but nothing is guaranteed.

Should also give reasonable answers for globals and arguments

resolveIndirectCall :: a -> Instruction -> [Value]Source

Given a Call instruction, determine its possible callees. The default implementation just delegates the called function value to pointsTo and .