Skip to content

cloning functions #115

Description

@db7

Is there a simple way how to clone functions?

I'd like to duplicate a function like this:

func duplicate(m *ir.Module, foo string) {
    for _, f := range m.Funcs {                                             
        if f.GlobalIdent.GlobalName == foo {                      
            DuplicateFunc(m, f, foo + "_v2")
        }                                              
    } 
}

And afterwards I'd do some minor changes in the function code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions