Documentation ¶
Overview ¶
* Copyright 2022 ByteDance Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2022 ByteDance Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2022 ByteDance Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- func GetConstructors(pkg *packages.Package) (constructorMap map[types.Type][]*ssa.Function)
- func GetConstructorsByFunc(function Functions) (constructorMap map[string][]*ssa.Function)
- func GetConstructorsByType(pkg *packages.Package, typeList []types.Type) (constructorMap map[string][]*ssa.Function)
- func GetLiteralFromFile(SRCFile string, FunctionName string) (map[reflect.Type][]reflect.Value, error)
- func GetTypeByAnalysisBlock(instr ssa.Instruction, reference map[interface{}]struct{})
- type CallGraph
- type CalleeRelation
- type CallerRelation
- type FileVisitor
- type FuncDesc
- type Functions
- type HeaderVisitor
- type LiteralVisitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConstructors ¶
Get all constructor for each type by SSA We consider the constructor to satisfy such characteristics: 1. Return at least one value 2. Not a method 3. The return value contains a structure we need
func GetConstructorsByFunc ¶
func GetConstructorsByType ¶
func GetConstructorsByType(pkg *packages.Package, typeList []types.Type) (constructorMap map[string][]*ssa.Function)
Get all constructor for certain type by SSA We consider the constructor to satisfy such characteristics: 1. Return at least one value 2. Not a method 3. The return value contains a structure we need TODO: support pointer
func GetLiteralFromFile ¶
func GetTypeByAnalysisBlock ¶
func GetTypeByAnalysisBlock(instr ssa.Instruction, reference map[interface{}]struct{})
Types ¶
type CallGraph ¶
type CallGraph struct { RootFunc *FuncDesc CallerRelationMap map[string]*CallerRelation }
type CalleeRelation ¶
描述关键函数的一条反向调用关系
type CallerRelation ¶
type CallerRelation struct { Caller FuncDesc Callees []FuncDesc // contains filtered or unexported fields }
描述一个函数调用N个函数的一对多关系
type FileVisitor ¶
type FileVisitor struct { LiteralMap map[reflect.Type][]reflect.Value // contains filtered or unexported fields }
func NewFileVisitor ¶
func NewFileVisitor(functionName string) (v *FileVisitor)
type Functions ¶
type Functions struct { TestFunction *parsermodel.ProjectFunction DateSteam map[interface{}]struct{} TestFuncCallGraph *callgraph.Graph SRCFile string FunctionName string }
Todo: init 在一个包或者一个项目里可能有多个,这里我们先不去管它,在之后要加上。
func GetFunctions ¶
func GetFunctions(option atgconstant.Options) (Functions, error)
GetFunctions gets the functions from tested function.
type HeaderVisitor ¶
func NewHeaderVisitor ¶
func NewHeaderVisitor() (v *HeaderVisitor)
type LiteralVisitor ¶
func NewLiteralVisitor ¶
func NewLiteralVisitor() (v *LiteralVisitor)
Directories ¶
Path | Synopsis |
---|---|
This file may have been modified by Bytedance Ltd.
|
This file may have been modified by Bytedance Ltd. |
* Copyright 2022 ByteDance Inc.
|
* Copyright 2022 ByteDance Inc. |