bblock

package
Version: v0.0.0-...-433e763 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2016 License: BSD-3-Clause Imports: 6 Imported by: 2

Documentation

Overview

Copyright (c) 2015-2016 The GoAnalysis Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintBasicBlocks

func PrintBasicBlocks(basicBlocks []*BasicBlock)

Types

type BasicBlock

type BasicBlock struct {
	Number  int
	Type    BasicBlockType
	EndLine int

	FunctionName     string
	FunctionDeclLine int
	// contains filtered or unexported fields
}

func GetBasicBlocksFromSourceCode

func GetBasicBlocksFromSourceCode(filePath string, srcFile []byte) ([]*BasicBlock, error)

func NewBasicBlock

func NewBasicBlock(blockNumber int, blockType BasicBlockType, endLine int) *BasicBlock

func (*BasicBlock) AddSuccessorBlock

func (basicBlock *BasicBlock) AddSuccessorBlock(successorBlocks ...*BasicBlock)

func (*BasicBlock) GetSuccessorBlocks

func (basicBlock *BasicBlock) GetSuccessorBlocks() []*BasicBlock

func (*BasicBlock) String

func (basicBlock *BasicBlock) String() string

func (*BasicBlock) UID

func (basicBlock *BasicBlock) UID() string

func (*BasicBlock) UpdateBasicBlock

func (basicBlock *BasicBlock) UpdateBasicBlock(newBasicBlock *BasicBlock)

UpdateBasicBlock updates all the variables from the newBasicBlock into the basicBlock object.

type BasicBlockType

type BasicBlockType int
const (
	FUNCTION_ENTRY BasicBlockType = iota
	IF_CONDITION
	ELSE_CONDITION
	SWITCH_STATEMENT
	CASE_CLAUSE
	SELECT_STATEMENT
	COMM_CLAUSE
	RETURN_STMT
	FOR_STATEMENT
	RANGE_STATEMENT
	GO_STATEMENT
	CALL_EXPRESSION
	ELSE_BODY
	FOR_BODY
	EMPTY
	START
	EXIT
	UNKNOWN
)

Basic Block types.

func GetBasicBlockTypeFromStmt

func GetBasicBlockTypeFromStmt(stmtList []ast.Stmt) (BasicBlockType, ast.Stmt)

TODO: Check after all basic-block types we have declared.

func (BasicBlockType) String

func (bbType BasicBlockType) String() string

Source Files

Jump to

Keyboard shortcuts

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