[llvm-commits] [llvm] r43725 - /llvm/trunk/docs/tutorial/LangImpl3.html
Chris Lattner
sabre at nondot.org
Mon Nov 5 11:22:50 PST 2007
Author: lattner
Date: Mon Nov 5 13:22:50 2007
New Revision: 43725
URL: http://llvm.org/viewvc/llvm-project?rev=43725&view=rev
Log:
clarify why prototype::codegen returns a function.
Modified:
llvm/trunk/docs/tutorial/LangImpl3.html
Modified: llvm/trunk/docs/tutorial/LangImpl3.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl3.html?rev=43725&r1=43724&r2=43725&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl3.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl3.html Mon Nov 5 13:22:50 2007
@@ -293,7 +293,13 @@
</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>
More information about the llvm-commits
mailing list