diff options
author | Chris Lattner <sabre@nondot.org> | 2007-11-05 19:22:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-11-05 19:22:50 +0000 |
commit | a94cfa13e74951386f37b037afb78a5776f026a9 (patch) | |
tree | 1c87ae5abeb2a47229ca1d30160847925a6f0781 /llvm/docs/tutorial | |
parent | fd3cb0890b74b62cdd8dbfd966145403b609e736 (diff) | |
download | bcm5719-llvm-a94cfa13e74951386f37b037afb78a5776f026a9.tar.gz bcm5719-llvm-a94cfa13e74951386f37b037afb78a5776f026a9.zip |
clarify why prototype::codegen returns a function.
llvm-svn: 43725
Diffstat (limited to 'llvm/docs/tutorial')
-rw-r--r-- | llvm/docs/tutorial/LangImpl3.html | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/docs/tutorial/LangImpl3.html b/llvm/docs/tutorial/LangImpl3.html index 2e961d2f610..3733a66bfcf 100644 --- a/llvm/docs/tutorial/LangImpl3.html +++ b/llvm/docs/tutorial/LangImpl3.html @@ -293,7 +293,13 @@ Function *PrototypeAST::Codegen() { </pre> </div> -<p>This code packs a lot of power into a few lines. The first step is to create +<p>This code packs a lot of power into a few lines. Note first that this +function returns a Function* instead of a Value*. Because a "prototype" really +talks about the external interface for a function (not the value computed by +an expression), it makes sense for it to return the LLVM Function it corresponds +to when codegen'd.</p> + +<p>The next step is to create the <tt>FunctionType</tt> that should be used for a given Prototype. Since all function arguments in Kaleidoscope are of type double, the first line creates a vector of "N" LLVM Double types. It then uses the <tt>FunctionType::get</tt> |