[LLVMdev] Preservance of function variables in the bytecode

Seung Jae Lee lee225 at uiuc.edu
Fri Apr 27 08:44:09 PDT 2007


Hello, LLVM-Dev guys.
I just wonder if function variables are preserved in the bytecode.

For example, are i and j in the following function preserved in .bc?

int sum(int i, int j){
    int k;
    k = i + j;
    return k;
}

I tested this with "llc -march=c" and found this was converted to 

int sum(int ltmp_0_1, int ltmp_1_1) {
  return (ltmp_1_1 + ltmp_0_1);
}

Therefore, it seems that they are not preserved in the bytecode, right?
If it is not, (i.e., they are kept) how can I extract the variables from the bytecode?
I got really become to enjoy LLVM's magic.
Thank you very much.

Seung Jae Lee



More information about the llvm-dev mailing list