Skip to content

Commit 465884d

Browse files
committed
Moved IsDefined method from GlobalFunctionInfo to FunctionInfo type
1 parent db996c4 commit 465884d

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

gen/function_info.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ type FunctionInfo struct {
1313
Targets []ReferencedTypeInfo
1414
}
1515

16+
// FunctionInfo can contain information about a function that is defined, or
17+
// only declared that will be linked later.
18+
//
19+
// This method returns true if the function is defined and has a function body,
20+
// and false if it is only declared and has only the signature, parameters and
21+
// targets defined.
22+
func (f *FunctionInfo) IsDefined() bool {
23+
return f.EntryBlock != nil
24+
}
25+
1626
func (f *FunctionInfo) CollectBasicBlocks() []*BasicBlockInfo {
1727
blocks := make([]*BasicBlockInfo, 0)
1828
for block := f.EntryBlock; block != nil; block = block.NextBlock {

gen/global_function_info.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,3 @@ func (f *FunctionGlobalInfo) Name() string {
1919
func (f *FunctionGlobalInfo) Declaration() *core.UnmanagedSourceView {
2020
return f.FunctionInfo.Declaration
2121
}
22-
23-
func (f *FunctionGlobalInfo) IsDefined() bool {
24-
return f.FunctionInfo.EntryBlock != nil
25-
}

0 commit comments

Comments
 (0)