cond

package
v0.0.0-...-3f344d0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2021 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const BroadC int = 1
View Source
const C_Broadcast = "C_Broadcast"
View Source
const C_Signal = "C_Signal"
View Source
const C_Wait = "C_Wait"
View Source
const Edited = "Edited"
View Source
const Sign int = 0
View Source
const Wait int = 2

Variables

View Source
var Cond_makes []*Cond_make // A global variable used to record all make lines of a conditional variable

Functions

func Scan_cond_inst_return_value_comment

func Scan_cond_inst_return_value_comment(inst ssa.Instruction) (v ssa.Value, comment string)

Types

type Cond

type Cond struct {
	Name      string
	Make_inst ssa.Instruction
	Pkg       string

	Signs  []*Cond_op
	Broadc []*Cond_op
	Waits  []*Cond_op
	All_op []*Cond_op

	Status string
}

func Scan_inst_and_record_to_slice

func Scan_inst_and_record_to_slice(all_conds []*Cond, inst ssa.Instruction) (result []*Cond)

Scan_inst_and_record_to_slice take the original slice of *Cond and an inst as inputs, and returns updated slice of *Cond The update will happen when inst is Signal/Broadcast/Wait of a sync.Cond

type Cond_make

type Cond_make struct {
	Whole_line string
	Locker     string
	Inst       ssa.Instruction
	Pkg        string
}

type Cond_op

type Cond_op struct {
	Name string
	Inst ssa.Instruction
	Type int

	Locks    []*locker.Lock_op // This field is specially designed for C6A
	Wrappers []*Wrapper        // This field is specially designed for C6A

	Whole_line string
	Status     string
	Parent     *Cond
}

type Wrapper

type Wrapper struct {
	Fn     *ssa.Function // When compare two Wrapper, can't directly compare fn or inst, because pointer will change during each compilation
	Fn_str string
	Inst   ssa.Instruction
	Callee *Wrapper // if callee is nil, then inst is the chan_op itself, else inst is calling to another Wrapper
	Op     *Cond_op // the wrapped operation
}

Wrapper records a function that "contains" a cond_op. "Contains" means the function directly uses this cond_op, or its callee (or callee's callee) uses this cond_op. The maximum layer is C6A_call_chain_layer_for_chan_wrapper

func Append_wrappers_if_not_in

func Append_wrappers_if_not_in(old []*Wrapper, add *Wrapper) (result []*Wrapper)

Jump to

Keyboard shortcuts

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