Documentation ¶
Index ¶
- Constants
- Variables
- func ClearChanOpMap()
- func ClearLockerOpMap()
- func ConvertInstToStr(inst ssa.Instruction) string
- func GetCallName(call *ssa.CallCommon) string
- func GetMutexName(inputInst ssa.Instruction) string
- func IsChanClose(inst ssa.Instruction) bool
- func IsDefer(inst ssa.Instruction) bool
- func IsMutexLock(inputInst ssa.Instruction) bool
- func IsMutexMake(inputInst ssa.Instruction) bool
- func IsMutexOperation(inputInst ssa.Instruction) bool
- func IsMutexUnlock(inputInst ssa.Instruction) bool
- func IsRwmutex(inst ssa.Instruction) bool
- func IsRwmutexLock(inputInst ssa.Instruction) bool
- func IsRwmutexMake(inputInst ssa.Instruction) bool
- func IsRwmutexRlock(inputInst ssa.Instruction) bool
- func IsRwmutexRunlock(inputInst ssa.Instruction) bool
- func IsRwmutexUnlock(inputInst ssa.Instruction) bool
- func ScanInstFindChanValue(inst ssa.Instruction) ([]ssa.Value, []string)
- func ScanInstFindLockerValue(inst ssa.Instruction) (v ssa.Value, comment string)
- type ChClose
- type ChMake
- type ChOp
- type ChRecv
- type ChSend
- type ChanOp
- type Channel
- type LockOp
- type Locker
- type LockerOp
- type StOpValue
- type UnlockOp
Constants ¶
const DynamicSize = -999 // If a channel's buffer size can't be computed statically, we give DynamicSize to the Buffer field
const Lock, Unlock = "Lock", "Unlock"
const RWMutex, Mutex = "RWMutex", "Mutex"
const Send, Recv, Close, MakeChan = "Send", "Recv", "Close", "MakeChan"
Variables ¶
var MapInst2ChanOp map[ssa.Instruction][]ChanOp
A map from inst to its corresponding LockerOp
var MapInst2LockerOp map[ssa.Instruction]LockerOp
A map from inst to its corresponding LockerOp
Functions ¶
func ClearChanOpMap ¶
func ClearChanOpMap()
func ClearLockerOpMap ¶
func ClearLockerOpMap()
func ConvertInstToStr ¶
func ConvertInstToStr(inst ssa.Instruction) string
func GetCallName ¶
func GetCallName(call *ssa.CallCommon) string
func GetMutexName ¶
func GetMutexName(inputInst ssa.Instruction) string
func IsChanClose ¶
func IsChanClose(inst ssa.Instruction) bool
func IsDefer ¶
func IsDefer(inst ssa.Instruction) bool
func IsMutexLock ¶
func IsMutexLock(inputInst ssa.Instruction) bool
func IsMutexMake ¶
func IsMutexMake(inputInst ssa.Instruction) bool
func IsMutexOperation ¶
func IsMutexOperation(inputInst ssa.Instruction) bool
func IsMutexUnlock ¶
func IsMutexUnlock(inputInst ssa.Instruction) bool
func IsRwmutex ¶
func IsRwmutex(inst ssa.Instruction) bool
func IsRwmutexLock ¶
func IsRwmutexLock(inputInst ssa.Instruction) bool
func IsRwmutexMake ¶
func IsRwmutexMake(inputInst ssa.Instruction) bool
func IsRwmutexRlock ¶
func IsRwmutexRlock(inputInst ssa.Instruction) bool
func IsRwmutexRunlock ¶
func IsRwmutexRunlock(inputInst ssa.Instruction) bool
func IsRwmutexUnlock ¶
func IsRwmutexUnlock(inputInst ssa.Instruction) bool
func ScanInstFindChanValue ¶
func ScanInstFindChanValue(inst ssa.Instruction) ([]ssa.Value, []string)
ScanInstFindChanValue return multiple values and strings, only when inst is Select
func ScanInstFindLockerValue ¶
func ScanInstFindLockerValue(inst ssa.Instruction) (v ssa.Value, comment string)
Types ¶
type ChClose ¶
type ChClose struct { Name string IsDefer bool WholeLine string Status string // Used for debug ChOp // inst can be *ssa.Call or *ssa.Defer }
Define operation ChClose, a concrete implementation of ChanOp
func AddNotDependClose ¶
func AddNotDependClose(inst ssa.Instruction) *ChClose
Add a special close, belongs to a channel that we don't consider in this run, because it is not a dependent primitive No sync constraint will be generated for this operation.
type ChMake ¶
type ChMake struct {
ChOp // inst can only be MakeChan
}
Define operation ChMake, a concrete implementation of ChanOp
type ChOp ¶
type ChOp struct { Parent *Channel Inst ssa.Instruction }
func (*ChOp) Instr ¶
func (op *ChOp) Instr() ssa.Instruction
type ChRecv ¶
type ChRecv struct { Name string CaseIndex int // If Inst is *ssa.UnOp, CaseIndex = -1; else CaseIndex is the index of case of *ssa.Select IsCaseBlocking bool WholeLine string // Used for debug Status string ChOp // inst can be *ssa.UnOp or *ssa.Select }
Define operation ChRecv, a concrete implementation of ChanOp
func AddNotDependRecv ¶
func AddNotDependRecv(inst ssa.Instruction) *ChRecv
Add a special receive, belongs to a channel that we don't consider in this run, because it is not a dependent primitive No sync constraint will be generated for this operation. Fields like Case_index need to be updated
type ChSend ¶
type ChSend struct { Name string CaseIndex int // If Inst is *ssa.Send, CaseIndex = -1; else CaseIndex is the index of case of *ssa.Select IsCaseBlocking bool WholeLine string // Used for debug Status string ChOp // this can be *ssa.Send or *ssa.Select }
Define operation ChSend, a concrete implementation of ChanOp
func AddNotDependSend ¶
func AddNotDependSend(inst ssa.Instruction) *ChSend
Add a special send, belongs to a channel that we don't consider in this run, because it is not a dependent primitive No sync constraint will be generated for this operation. Fields like Case_index need to be updated
type ChanOp ¶
type ChanOp interface { Prim() *Channel Instr() ssa.Instruction }
Define interface ChanOp, and its implementation ChOp, which is inherited by all concrete implementations
type Channel ¶
type Channel struct { Name string MakeInst *ssa.MakeChan Make *ChMake Pkg string Buffer int Sends []*ChSend Recvs []*ChRecv Closes []*ChClose Status string }
Define Channel
var ChanContext Channel
var ChanNotDepend Channel
var ChanTimer Channel
Define some special channels and its operations
func (*Channel) DebugPrintChan ¶
func (ch *Channel) DebugPrintChan()
type Locker ¶
type Locker struct { Name string Type string Locks []*LockOp Unlocks []*UnlockOp Pkg string // Don't use *ssa.Package here! It's not reliable Value ssa.Value Status string }
Define Locker
func (*Locker) ModifyStatus ¶
type LockerOp ¶
type LockerOp interface { Instr() ssa.Instruction Prim() *Locker }
Define interface LockerOp and its two implementations
Define LockerOp