llvm2c icon indicating copy to clipboard operation
llvm2c copied to clipboard

Reduce number of variables for arguments in functions

Open tomsik68 opened this issue 6 years ago • 1 comments

Currently, each argument for function gets 2 stack-allocated variables. For example:

int main(int argc, char** argv) {
    int var0;
    char** var1;

    var0 = argc;
    var1 = argv;
}

And the variables of the arguments themselves are not used anymore. We could get rid of variables like var0 and var1.

tomsik68 avatar Jul 25 '19 07:07 tomsik68

Optimizing the LLVM before decompiling it removes these variables. So it's not too important to solve this directly in llvm2c.

tomsik68 avatar Sep 28 '19 09:09 tomsik68