Hello,
I'm looking at the llvm output of the chapel programs compiled with
"--llvm", I found that all the local variables are named as "*_temp*",
mostly call_temp1, call_temp2......therefore I can't find the exactly local
variable that I defined in the source code.
Later on, I just tested some other programs in the benchmark, and I found
that local variables with the same name as in chapel program are in the
LLVM IR ! (of course, there are many other call_tmp as well) So the
compiler does generate local variables with the same chapel name, but it
doesn't when I test my super simple chapel program, really weird...my code
is as below:
module Hui {
config const message = "Hello, world!";
var gv_t: (int, real) = (1, 2.3);
var gv_b: bool = true;
// Define an Actor class
class Actor {
var name: string;
var age: uint;
}
var globalActor: Actor;
proc sayhello(level: int){
writeln("Hello, Hui",level);
}
proc factorial(x: int) : int {
var anything=(x+5)**x : int;
sayhello(anything);
if x < 0 then
halt("factorial -- Sorry, this is not the gamma procedure!");
return if x == 0 then 1 else x * factorial(x-1);
}
writeln("A simple procedure");
proc main() {
var localActor = new Actor();
var Number=6: int;
writeln(message);
writeln("6! is ", factorial(Number));
}
}
So When I searched IR, I did find global variables like gv_t, gv_b,
globalActor, but I couldn't find "anything" (local in factorial), or
"localActor","Number" (local in main)
Can anyone tell why is that ?
Thanks
--
Best regards
Hui Zhang
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers