<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi all,</div><div>I have the following C code:</div><div><br></div><div>#include<stdio.h><br><br>int main(int argc, char *argv[]) {<br><br>    printf("%s\n", argv[0]);<br>    return argc;<br>}<br></div><div><br></div><div>that generates the following IR for the main function:</div><div><br></div><div>; Function Attrs: noinline nounwind optnone uwtable<br>define i32 @main(i32, i8**) #0 {<br>  %3 = alloca i32, align 4<br>  %4 = alloca i32, align 4<br>  %5 = alloca i8**, align 8<br>  store i32 0, i32* %3, align 4<br>  store i32 %0, i32* %4, align 4<br>  store i8** %1, i8*** %5, align 8<br>  %6 = load i8**, i8*** %5, align 8<br>  %7 = getelementptr inbounds i8*, i8** %6, i64 0<br>  %8 = load i8*, i8** %7, align 8<br>  %9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %8)<br>  %10 = load i32, i32* %4, align 4<br>  ret i32 %10<br>}<br></div><div><br></div><div>I think %8 will contain the address of argv[0], so %7 was storing a pointer to pointer to argv? I'm not sure of that.<br></div><div><br></div><div>Considering that I can access the GenericValue set by visitGetElementPtrInst. How can I obtain the value of argv[0] at runtime using the Interpreter class?</div><div><br></div><div>Thanks<br></div><div><br></div><div><br></div></div></div></div></div>