> "Value" is the class used to represent a "register" in LLVM. The Codegen() 
> method says to emit IR for that AST

It would be good to mention that the "registers" here cannot be reassigned,
as the word "register" might seem to imply.

I don't know much you want to say about SSA at this point in the tutorial,
or if you want to go into using entry-block Allocas and mem2reg to avoid
having to compute SSA in a front-end here, but it's something that should
be mentioned somewhere.

>   NumberExprAST(double val) : Val(val) {}

>   VariableExprAST(const std::string &name) : Name(name) {}

These miss explicit keywords.

>   case '+': return Builder.CreateAdd(L, R, "addtmp");
>   case '-': return Builder.CreateSub(L, R, "subtmp");
>   case '*': return Builder.CreateMul(L, R, "multmp");

You might mention that the names "addtmp" and so on are automatically
make unique by LLVM in case there's more than one add in the program,
for example.

Dan

-- 
Dan Gohman, Cray Inc.
_______________________________________________
llvm-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to