diff options
Diffstat (limited to 'docs/tutorial/LangImpl6.html')
-rw-r--r-- | docs/tutorial/LangImpl6.html | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/docs/tutorial/LangImpl6.html b/docs/tutorial/LangImpl6.html index 7ddf3a0..31d7ff4 100644 --- a/docs/tutorial/LangImpl6.html +++ b/docs/tutorial/LangImpl6.html @@ -11,7 +11,7 @@ <body> -<div class="doc_title">Kaleidoscope: Extending the Language: User-defined Operators</div> +<h1>Kaleidoscope: Extending the Language: User-defined Operators</h1> <ul> <li><a href="index.html">Up to Tutorial Index</a></li> @@ -34,10 +34,10 @@ Variables / SSA Construction</li> </div> <!-- *********************************************************************** --> -<div class="doc_section"><a name="intro">Chapter 6 Introduction</a></div> +<h2><a name="intro">Chapter 6 Introduction</a></h2> <!-- *********************************************************************** --> -<div class="doc_text"> +<div> <p>Welcome to Chapter 6 of the "<a href="index.html">Implementing a language with LLVM</a>" tutorial. At this point in our tutorial, we now have a fully @@ -60,10 +60,10 @@ an example of what you can build with Kaleidoscope and its feature set.</p> </div> <!-- *********************************************************************** --> -<div class="doc_section"><a name="idea">User-defined Operators: the Idea</a></div> +<h2><a name="idea">User-defined Operators: the Idea</a></h2> <!-- *********************************************************************** --> -<div class="doc_text"> +<div> <p> The "operator overloading" that we will add to Kaleidoscope is more general than @@ -125,10 +125,10 @@ operators.</p> </div> <!-- *********************************************************************** --> -<div class="doc_section"><a name="binary">User-defined Binary Operators</a></div> +<h2><a name="binary">User-defined Binary Operators</a></h2> <!-- *********************************************************************** --> -<div class="doc_text"> +<div> <p>Adding support for user-defined binary operators is pretty simple with our current framework. We'll first add support for the unary/binary keywords:</p> @@ -342,10 +342,10 @@ see what it takes.</p> </div> <!-- *********************************************************************** --> -<div class="doc_section"><a name="unary">User-defined Unary Operators</a></div> +<h2><a name="unary">User-defined Unary Operators</a></h2> <!-- *********************************************************************** --> -<div class="doc_text"> +<div> <p>Since we don't currently support unary operators in the Kaleidoscope language, we'll need to add everything to support them. Above, we added simple @@ -491,10 +491,10 @@ is simpler primarily because it doesn't need to handle any predefined operators. </div> <!-- *********************************************************************** --> -<div class="doc_section"><a name="example">Kicking the Tires</a></div> +<h2><a name="example">Kicking the Tires</a></h2> <!-- *********************************************************************** --> -<div class="doc_text"> +<div> <p>It is somewhat hard to believe, but with a few simple extensions we've covered in the last chapters, we have grown a real-ish language. With this, we @@ -796,10 +796,10 @@ add variable mutation without building SSA in your front-end.</p> </div> <!-- *********************************************************************** --> -<div class="doc_section"><a name="code">Full Code Listing</a></div> +<h2><a name="code">Full Code Listing</a></h2> <!-- *********************************************************************** --> -<div class="doc_text"> +<div> <p> Here is the complete code listing for our running example, enhanced with the @@ -1475,7 +1475,7 @@ Value *IfExprAST::Codegen() { // Emit merge block. TheFunction->getBasicBlockList().push_back(MergeBB); Builder.SetInsertPoint(MergeBB); - PHINode *PN = Builder.CreatePHI(Type::getDoubleTy(getGlobalContext()), + PHINode *PN = Builder.CreatePHI(Type::getDoubleTy(getGlobalContext()), 2, "iftmp"); PN->addIncoming(ThenV, ThenBB); @@ -1517,7 +1517,7 @@ Value *ForExprAST::Codegen() { Builder.SetInsertPoint(LoopBB); // Start the PHI node with an entry for Start. - PHINode *Variable = Builder.CreatePHI(Type::getDoubleTy(getGlobalContext()), VarName.c_str()); + PHINode *Variable = Builder.CreatePHI(Type::getDoubleTy(getGlobalContext()), 2, VarName.c_str()); Variable->addIncoming(StartVal, PreheaderBB); // Within the loop, the variable is defined equal to the PHI node. If it @@ -1758,7 +1758,7 @@ int main() { // Create the JIT. This takes ownership of the module. std::string ErrStr; - TheExecutionEngine = EngineBuilder(TheModule).setErrorStr(&ErrStr).create(); + TheExecutionEngine = EngineBuilder(TheModule).setErrorStr(&ErrStr).create(); if (!TheExecutionEngine) { fprintf(stderr, "Could not create ExecutionEngine: %s\n", ErrStr.c_str()); exit(1); @@ -1810,8 +1810,8 @@ int main() { src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a> <a href="mailto:sabre@nondot.org">Chris Lattner</a><br> - <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2010-11-16 18:28:22 +0100 (Tue, 16 Nov 2010) $ + <a href="http://llvm.org/">The LLVM Compiler Infrastructure</a><br> + Last modified: $Date: 2011-04-23 02:30:22 +0200 (Sat, 23 Apr 2011) $ </address> </body> </html> |