ir

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSCallGraph added in v0.2.1

type CSCallGraph struct {
	Nodes        map[string]ContextNode     // key: ContextNode.String()
	Edges        map[string][]ContextNode   // caller → callees
	ReverseEdges map[string][]ContextNode   // callee → callers
	Summaries    map[string]FunctionSummary // key: ContextNode.String()
	SCCs         map[int]*SCC               // SCC ID → SCC
	NodeToSCC    map[string]int             // ContextNode → SCC ID
}

CSCallGraph is a context-sensitive call graph.

func NewCSCallGraph added in v0.2.1

func NewCSCallGraph() *CSCallGraph

NewCSCallGraph creates an empty context-sensitive call graph.

type CallEdge

type CallEdge struct {
	Caller    Symbol
	Callee    Symbol
	File      string
	Line      int
	Synthetic bool // true for virtual/inferred edges
}

CallEdge is a directed edge from Caller to Callee.

type Context added in v0.2.1

type Context struct {
	Caller Symbol
}

Context represents k-CFA calling context (k=1: immediate caller).

func (Context) String added in v0.2.1

func (c Context) String() string

String returns a string representation of the context.

type ContextNode added in v0.2.1

type ContextNode struct {
	Function Symbol
	Context  Context
}

ContextNode is a context-sensitive node in the call graph.

func (ContextNode) String added in v0.2.1

func (cn ContextNode) String() string

String returns a unique identifier for this context node.

type FunctionCaps

type FunctionCaps struct {
	Symbol         Symbol
	DirectCaps     capability.CapabilitySet
	TransitiveCaps capability.CapabilitySet
	Depth          int // max hops to nearest capability sink
}

FunctionCaps holds the direct and transitive capabilities of a single function.

type FunctionSummary added in v0.2.1

type FunctionSummary struct {
	Node       ContextNode
	Sources    capability.CapabilitySet // Direct sources (env, network, fs:read)
	Sinks      capability.CapabilitySet // Direct sinks (exec, unsafe)
	Sanitizers capability.CapabilitySet // Sanitization (crypto)
	Effects    capability.CapabilitySet // All direct capabilities
	Transitive capability.CapabilitySet // Propagated from callees
	Depth      int                      // Max hops from capability
	Confidence float64                  // Min confidence across chain
	CallStack  []CallEdge               // Path to root capability
	Iteration  int                      // Fixpoint iteration when updated
}

FunctionSummary captures taint-relevant information per function.

type IRGraph

type IRGraph struct {
	Calls     []CallEdge
	Functions map[string]FunctionCaps // Symbol.String() → FunctionCaps
}

IRGraph is the normalized intermediate representation for a package.

type SCC added in v0.2.1

type SCC struct {
	ID      int
	Nodes   []ContextNode
	Summary FunctionSummary // Collapsed summary for entire SCC
}

SCC represents a strongly connected component (cycle) in the call graph.

type Symbol

type Symbol struct {
	Package string // fully-qualified import path ("" = current package)
	Name    string // function / method / var / type name
	Kind    string // "func" | "method" | "var" | "type"
}

Symbol identifies a named code entity.

func (Symbol) String

func (s Symbol) String() string

String returns "Package.Name", or ".Name" when Package is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL