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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions