[www-releases] r211020 - Add 3.4.2 binaries and source.

Tom Stellard thomas.stellard at amd.com
Mon Jun 16 06:19:10 PDT 2014


Added: www-releases/trunk/3.4.2/docs/searchindex.js
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.4.2/docs/searchindex.js?rev=211020&view=auto
==============================================================================
--- www-releases/trunk/3.4.2/docs/searchindex.js (added)
+++ www-releases/trunk/3.4.2/docs/searchindex.js Mon Jun 16 08:19:07 2014
@@ -0,0 +1 @@
+Search.setIndex({objects:{"":{"--stats":[65,0,1,"cmdoption--stats"],"-B":[93,0,1,"cmdoption-llvm-nm-B"],"-O":[65,0,1,"cmdoption-O"],"-seed":[37,0,1,"cmdoption-seed"],"-I":[97,0,1,"cmdoption-tblgen-I"],"-gen-register-info":[97,0,1,"cmdoption-tblgen-gen-register-info"],"-P":[93,0,1,"cmdoption-llvm-nm-P"],"-S":[84,0,1,"cmdoption-S"],"-mattr":[65,0,1,"cmdoption-mattr"],"-d":[90,0,1,"cmdoption-d"],"-f":[84,0,1,"cmdoption-f"],"-demangle":[66,0,1,"cmdoption-demangle"],"--no-progress-bar":[1,0,1,"cmdoption--no-progress-bar"],"-o":[97,0,1,"cmdoption-tblgen-o"],"--enable-unsafe-fp-math":[65,0,1,"cmdoption--enable-unsafe-fp-math"],"-h":[1,0,1,"cmdoption-h"],"--defined-only":[93,0,1,"cmdoption-llvm-nm--defined-only"],"-j":[1,0,1,"cmdoption-j"],"-v":[90,0,1,"cmdoption-v"],"-q":[1,0,1,"cmdoption-q"],"-p":[84,0,1,"cmdoption-p"],"-s":[1,0,1,"cmdoption-s"],"-gen-dag-isel":[97,0,1,"cmdoption-tblgen-gen-dag-isel"],"-use-symbol-table":[66,0,1,"cmdoption-use-symbol-table"],"--max-tests":[1,0,1,!
 "cmdoptio
 n--max-tests"],"-class":[97,0,1,"cmdoption-tblgen-class"],"-section-relocations":[50,0,1,"cmdoption-section-relocations"],"-std-compile-opts":[84,0,1,"cmdoption-std-compile-opts"],"-nodetails":[31,0,1,"cmdoption-llvm-bcanalyzer-nodetails"],"-gen-instr-info":[97,0,1,"cmdoption-tblgen-gen-instr-info"],"-gen-subtarget":[97,0,1,"cmdoption-tblgen-gen-subtarget"],"--print-file-name":[93,0,1,"cmdoption-llvm-nm--print-file-name"],"-stats":[84,0,1,"cmdoption-stats"],"--extern-only":[93,0,1,"cmdoption-llvm-nm--extern-only"],"-symbols":[50,0,1,"cmdoption-symbols"],"-print-sets":[97,0,1,"cmdoption-tblgen-print-sets"],"-program-headers":[50,0,1,"cmdoption-program-headers"],"--disable-fp-elim":[65,0,1,"cmdoption--disable-fp-elim"],"--check-prefix":[4,0,1,"cmdoption--check-prefix"],"--x86-asm-syntax":[65,0,1,"cmdoption--x86-asm-syntax"],"--show-suites":[1,0,1,"cmdoption--show-suites"],"--enable-correct-eh-support":[65,0,1,"cmdoption--enable-correct-eh-support"],"-relocations":[50,0,1,"cmd!
 option-re
 locations"],"-needed-libs":[50,0,1,"cmdoption-needed-libs"],"--vg-leak":[1,0,1,"cmdoption--vg-leak"],"--enable-no-nans-fp-math":[65,0,1,"cmdoption--enable-no-nans-fp-math"],"-asmwriternum":[97,0,1,"cmdoption-tblgen-asmwriternum"],"--print-machineinstrs":[65,0,1,"cmdoption--print-machineinstrs"],"-asmparsernum":[97,0,1,"cmdoption-tblgen-asmparsernum"],"-section-symbols":[50,0,1,"cmdoption-section-symbols"],"--print-size":[93,0,1,"cmdoption-llvm-nm--print-size"],"--config-prefix":[1,0,1,"cmdoption--config-prefix"],"-gen-pseudo-lowering":[97,0,1,"cmdoption-tblgen-gen-pseudo-lowering"],"-print-records":[97,0,1,"cmdoption-tblgen-print-records"],"-verify":[31,0,1,"cmdoption-llvm-bcanalyzer-verify"],"--load":[65,0,1,"cmdoption--load"],"-dump":[78,0,1,"cmdoption-dump"],"--dynamic":[93,0,1,"cmdoption-llvm-nm--dynamic"],"--spiller":[65,0,1,"cmdoption--spiller"],"-gen-intrinsic":[97,0,1,"cmdoption-tblgen-gen-intrinsic"],"-verify-each":[84,0,1,"cmdoption-verify-each"],"-strip-debug":[8!
 4,0,1,"cm
 doption-strip-debug"],"--size-sort":[93,0,1,"cmdoption-llvm-nm--size-sort"],"-version":[97,0,1,"cmdoption-tblgen-version"],"-size":[37,0,1,"cmdoption-size"],"--enable-no-infs-fp-math":[65,0,1,"cmdoption--enable-no-infs-fp-math"],"--path":[1,0,1,"cmdoption--path"],"-time-passes":[84,0,1,"cmdoption-time-passes"],"-gcda":[78,0,1,"cmdoption-gcda"],"-march":[65,0,1,"cmdoption-march"],"-disable-inlining":[84,0,1,"cmdoption-disable-inlining"],"--time-passes":[65,0,1,"cmdoption--time-passes"],"--vg":[1,0,1,"cmdoption--vg"],"--show-tests":[1,0,1,"cmdoption--show-tests"],"-help":[31,0,1,"cmdoption-llvm-bcanalyzer-help"],"--shuffle":[1,0,1,"cmdoption--shuffle"],"-gen-asm-writer":[97,0,1,"cmdoption-tblgen-gen-asm-writer"],"-load":[84,0,1,"cmdoption-load"],"-expand-relocs":[50,0,1,"cmdoption-expand-relocs"],"--disable-excess-fp-precision":[65,0,1,"cmdoption--disable-excess-fp-precision"],"--format":[93,0,1,"cmdoption-llvm-nm--format"],"-print-enums":[97,0,1,"cmdoption-tblgen-print-enums!
 "],"-file
 type":[65,0,1,"cmdoption-filetype"],"-gen-emitter":[97,0,1,"cmdoption-tblgen-gen-emitter"],"-unwind":[50,0,1,"cmdoption-unwind"],"-sections":[50,0,1,"cmdoption-sections"],"-gen-dfa-packetizer":[97,0,1,"cmdoption-tblgen-gen-dfa-packetizer"],"-gen-tgt-intrinsic":[97,0,1,"cmdoption-tblgen-gen-tgt-intrinsic"],"-section-data":[50,0,1,"cmdoption-section-data"],"-disable-opt":[84,0,1,"cmdoption-disable-opt"],"-mcpu":[65,0,1,"cmdoption-mcpu"],"-file-headers":[50,0,1,"cmdoption-file-headers"],"--undefined-only":[93,0,1,"cmdoption-llvm-nm--undefined-only"],"-debug":[84,0,1,"cmdoption-debug"],"--param":[1,0,1,"cmdoption--param"],"-dynamic-table":[50,0,1,"cmdoption-dynamic-table"],"-inlining":[66,0,1,"cmdoption-inlining"],"--vg-arg":[1,0,1,"cmdoption--vg-arg"],"-functions":[66,0,1,"cmdoption-functions"],"--max-time":[1,0,1,"cmdoption--max-time"],"--debug":[1,0,1,"cmdoption--debug"],"-profile-info-file":[84,0,1,"cmdoption-profile-info-file"],"-mtriple":[65,0,1,"cmdoption-mtriple"],"--nu!
 meric-sor
 t":[93,0,1,"cmdoption-llvm-nm--numeric-sort"],"--strict-whitespace":[4,0,1,"cmdoption--strict-whitespace"],"-dyn-symbols":[50,0,1,"cmdoption-dyn-symbols"],"-gen-fast-isel":[97,0,1,"cmdoption-tblgen-gen-fast-isel"],"-gen-disassembler":[97,0,1,"cmdoption-tblgen-gen-disassembler"],"-gen-asm-matcher":[97,0,1,"cmdoption-tblgen-gen-asm-matcher"],"--no-sort":[93,0,1,"cmdoption-llvm-nm--no-sort"],"-gcno":[78,0,1,"cmdoption-gcno"],"--input-file":[4,0,1,"cmdoption--input-file"],"--debug-syms":[93,0,1,"cmdoption-llvm-nm--debug-syms"],"-gen-enhanced-disassembly-info":[97,0,1,"cmdoption-tblgen-gen-enhanced-disassembly-info"],"--regalloc":[65,0,1,"cmdoption--regalloc"],"--time-tests":[1,0,1,"cmdoption--time-tests"],"-default-arch":[66,0,1,"cmdoption-default-arch"]}},terms:{orthogon:73,interchang:[56,71,75],four:[71,46,35,36,18,1,87,62,75,94,6,86,60,17],prefix:[75,1,60,4,41,8,12,13,14,44,83,18,87,64,20,68,52,91,21,71,55,94,56],grokabl:75,is_open:6,francesco:26,atomicrmw:[60,73],add32ri8:6!
 8,globalv
 ari:[64,14,34,9,86],identityprop:14,foldingsetnodeid:14,build_fcmp:[10,11,12,13,17],dbx:87,digit:[60,18,93,14],intregsregclass:46,emitconst:46,module_code_funct:94,basic_:68,delv:[10,43],f110:6,dw_lang_c89:87,configstatusscript:56,distcheckdir:56,fpmad:87,mli:10,bitstream:94,second:[26,71,0,28,1,77,75,59,3,60,34,80,36,4,81,40,42,9,11,14,17,46,86,62,18,87,64,20,91,57,72,94,89],x86ii:46,r15d:68,r15b:68,alignstack:[20,60,94],thefpm:[40,41,42,43],constrast:35,r15w:68,errorf:[36,48,40,41,42,43],xchg:[60,73],cull:75,ongo:22,noreturn:[60,94],visitxor:70,here:[57,71,28,29,77,30,75,59,3,82,60,61,32,34,80,6,36,4,38,81,40,41,42,43,8,9,10,11,12,13,14,16,17,46,85,62,74,18,87,64,86,20,68,52,70,21,35,72,73,92,48,96,56,25],gnu_hash:87,lowerswitch:26,image_file_machine_r4000:92,"0x20":87,golden:75,unic:18,bou_tru:18,unif:35,unix:[20,52,80,14,18,81,8,56,3,4],pound:[56,57],content_disposition_typ:22,txt:[75,52,47,18,77,8,66,22,23,89],unit:[26,68,51,52,46,0,91,14,18,71,87,64,75,95,56,86,60,21,!
 81],ldri:
 46,fstream:6,subpath:[23,1],destarglist:60,callgraph:[64,26],strike:[36,17],feat_jit_arm:71,until:[26,27,1,60,61,36,95,38,40,41,42,43,8,10,11,12,13,14,15,16,17,46,48,18,64,93,49,68,70,71,22,94,91],new_else_bb:[11,12,13],emitlabelplusoffset:62,jmp:60,relat:[26,57,27,1,77,75,59,60,6,36,41,42,43,8,10,12,71,14,17,46,86,87,64,20,35,22,23],notic:[81,85,6,36,71,40,22,86,13,14,17],hurt:75,exce:[75,60,87],hole:[18,60],herebi:75,unpack:[20,56,7,32],image_scn_align_128byt:92,generalis:[12,41],dagtodag:33,conceptu:[75,86,4,18,71,60,91,14],forexpr:[40,41,42,11,12,13],oftc:32,rework:[18,22],al_superregsset:46,phabric:[22,69],dtor:[81,60],replaceusesofwith:[51,14],doubletyp:14,caution:[56,73],fibonacci:[56,30,15,38],want:[26,53,57,40,28,29,30,75,59,3,60,32,33,34,71,6,36,4,38,81,7,42,43,8,9,10,11,13,14,15,16,17,46,86,85,18,87,64,20,68,52,69,21,35,54,22,44,94,48,96,56,89],umin:60,hasfp:46,codegen:[4,60,32,33,6,36,95,40,41,42,43,8,10,11,12,13,17,46,62,64,20,71,73,74],mcasmstream:71,shuffl:[1!
 ,60],hoc:
 [26,71,14],classifi:35,i686:[71,4],how:[26,53,57,27,40,28,1,29,58,77,30,75,48,59,82,60,32,33,34,71,6,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,45,46,47,85,18,63,87,64,96,49,86,80,20,68,52,69,70,35,73,55,22,44,94,91,23,56,89,25],hot:26,actionscript:[34,9],macosx10:60,perspect:[64,91,85,35],lhse:40,wrong:[75,35,53,3,56,60,81],beauti:[36,38,41,12,15,17],adc32rm:68,outoperandlist:[68,46],weakanylinkag:14,index2virtreg:71,passopt:64,apint:14,alias:[26,34,46,35,18,71,9,94,86,60],"18th":86,prototypeast:[36,48,40,41,42,43],tok_for:[40,41,42],"0x3f":19,feedback:[64,96,22],govern:60,affect:[25,81,52,6,27,60,18,53,7,73,42,64,11,3,14],vari:[34,14,71,73,87,9,94,3,70,81],z196:21,makefil:[20,83,53,52,46,32,36,74,28,47,8,62,23,56,71,64,81,44,17],exported_symbol_list:56,redhat:54,fit:[26,75,86,60,18,71,87,42,22,11,14],fix:[57,27,71,28,1,77,75,4,34,36,48,38,81,40,9,13,14,15,16,17,46,86,18,87,64,20,68,51,21,53,72,73,22,94,89,25],"200000e":[11,42],xxxinstrdescriptor:46,hidden:[75,14,18!
 ,71,87,58
 ,64,94,49,60],easier:[26,71,27,73,75,60,33,6,36,48,81,40,82,8,13,14,16,17,83,62,68,69,53,35,22,23],aliasesset:35,proce:[27,62,51,91],imagstart:[12,41],interrupt:[3,75,1,60],itanium:[20,88,91],kernelparam:6,initializecustomlow:62,loopinfo:64,llvm_config_project:44,dcmake_install_prefix:7,exprast:[36,48,40,41,42,43,16],accommod:71,spotless:56,debug:[26,71,1,58,77,78,30,75,60,81,32,5,34,35,95,38,39,40,82,8,9,13,14,15,44,83,46,62,18,84,87,64,65,66,20,52,70,53,54,93,91,56,74],build_fadd:17,openfileforwrit:3,resum:[91,60,82],isloadfromstackslot:46,pinsrd_1:4,numentri:94,whip:[12,41],intregssuperclass:46,dst:[59,68,71,46],smp:64,only_tool:[20,56],llvm_lit_arg:52,adapt:[3,81,14,26],aliasdebugg:35,inteqclass:14,dse:[26,51,73,35],impract:14,navig:[23,18,21],omiss:60,targetloweringobjectfil:71,adc64ri32:68,md5:20,f3_1:46,uiuc:22,f3_3:46,proj_src_root:[56,44],reformul:35,realstart:[12,41],pointstoconstantmemori:[60,35],att:[67,65,60],unabl:[68,51,60,16],disablelazycompil:14,confus:[80,!
 46,86,14,
 22,60],configurescriptflag:56,clariti:[11,42],wast:[61,89,40,87,13,14],psubusw:8,mingw:[20,30,71,52,77],mklib:56,wasn:[75,35,40,41,12,13],vhdl:21,isalnum:[36,48,38,40,41,42,43],evolut:26,signext:[60,94],setargstr:18,nobuiltin:60,master:[8,20,96,44,32],image_scn_mem_discard:92,similarli:[32,46,35,14,18,53,70,22,56,77,60,28],getnod:[33,46],image_sym_class_stat:92,linpack:0,addrrr:46,arrayidx4:60,"0x3500000001652748":82,ntid:6,crawl:62,technic:[32,22],lvalu:14,tree:[26,75,40,28,1,77,30,60,32,6,36,48,38,81,7,41,42,43,8,10,11,12,13,14,15,16,17,85,47,87,64,86,20,51,52,21,22,44,23,56],project:[75,28,1,58,77,30,32,33,88,38,81,8,15,44,47,62,87,20,52,21,55,22,23,56],entri:[26,57,71,3,60,61,33,85,6,36,4,39,40,41,42,43,10,11,12,13,14,17,46,86,62,87,64,50,68,91,35,94,48,23,56,89],sdnode:[70,71,14,46],recheck:[26,56],uniniti:[62,68,60,86],aapc:29,aforement:20,increment:[26,75,62,60,71,40,42,70,22,77,72,11,13,14],infring:22,incompat:[54,60],dozen:29,sig_atomic_t:60,implicitus:71,lfoo:71,m!
 ultimap:1
 4,get_instrinfo_operand_types_enum:46,simplifi:[20,53,26,71,28,38,40,41,42,43,92,22,57,75,10,11,12,13,14,15],shall:[60,18,34,9,52],object:[53,57,40,28,1,58,30,75,85,3,82,60,61,34,71,6,36,95,81,7,42,43,8,9,10,11,48,13,14,15,16,17,45,83,46,86,62,74,18,84,87,64,65,49,66,67,50,93,20,68,51,70,21,35,92,55,22,44,94,91,56,25],image_sym_type_long:92,letter:[75,46,18,40,41,94,56,12,13,60],breakpoint:[64,70,82],alwaysinlin:[60,94],errorv:[36,40,41,42,43],getelementtyp:14,dagarg:25,purgev:94,dummi:[26,68,71,81,46],lpm:64,mayreadfrommemori:73,detriment:75,came:[11,93,34,9,42],explan:[81,52,85],functionattr:26,matchinstructionimpl:71,layout:[26,71,52,46,20,62,14,6,87,32,86,60,44],apach:[3,22],somefil:81,busi:22,rich:[32,24],recursivetarget:56,plate:18,selectiondagbuild:71,wide:[26,71,29,60,32,34,6,42,43,9,10,11,14,86,62,87,68,21,35,73,94,56,25],enable_profil:[20,81,56],ceil:[60,0],replaceusesofwithonconst:51,addrr:46,smallvectorimpl:14,ppc_fp128:[60,94],hasopsizeprefix:68,patch:[32,75,69!
 ,20,62,43
 ,8,96,30,22,10,77],respond:[26,35],mandatori:[30,14,46],result:[26,53,91,0,27,71,28,1,77,30,75,59,3,82,60,61,32,33,79,80,6,36,4,81,40,41,42,43,8,10,11,12,13,14,16,17,46,86,62,48,18,84,87,64,49,67,20,68,70,35,73,57,55,22,94,95,56],respons:[26,57,35,62,14,18,47,72,77,64,22,56,71,60],fail:[75,27,28,1,29,4,30,3,60,95,81,8,18,87,67,20,52,91,21,53,73,22,56],best:[26,34,20,91,38,35,75,87,22,9,44,48,67,71,14,81,16,53],dw_tag_reference_typ:87,wikipedia:[23,11,60,42],copyleft:22,figur:[64,71,46,14,18,53,70,8,75,56,60],irc:[32,22,69],sysroot:7,glasgow:60,xvf:30,never:[26,75,28,60,46,34,80,35,81,43,9,10,71,14,85,86,62,64,57,73,55,74],extend:[75,1,60,32,33,34,85,48,38,40,41,42,43,9,10,11,12,13,14,15,16,45,46,62,18,20,68,21,71,73],extens:[26,75,30,3,60,32,33,88,48,81,40,41,42,11,12,13,14,16,46,62,18,87,64,65,19,52,91,71,92,22,23,56],extent:[62,22,60,86,47],toler:[62,60,77],advertis:91,rtti:[32,75,85,91,54,14],"0f3f800000":6,accident:[64,3,18,75,14],logic:[20,86,71,85,26,36,14,1,40,41,42,!
 22,48,60,
 56,23,11,12,13,4,17],compromis:14,assur:57,mattr:[67,65,4,46],preemptibl:26,creategvnpass:[40,41,42,43],"2nd":[68,14],addsdrm:68,diff:[20,75,69,26,39,58,8,22],summat:60,assum:[26,57,27,28,75,78,30,2,60,33,34,6,36,48,81,41,9,12,71,14,44,17,46,86,87,64,65,67,20,52,70,35,72,22,94,91,56],summar:[62,26,1,71],duplic:[26,68,75,80,35,60,18,71,87,22,19,48,3,74,14,21,16],frc:71,frb:71,fra:71,bewilder:56,union:[75,35,71,40,87,13,60],n_hash:87,frt:71,feat_disassembl:71,spir:21,life:[22,75],regul:64,mrm6m:46,type_code_x86_fp80:94,ani:[26,57,91,0,71,28,1,29,77,30,75,31,59,3,48,60,81,61,32,33,34,80,6,36,4,38,39,40,41,42,43,8,9,76,10,11,12,13,14,15,16,17,83,46,86,62,74,18,84,87,64,65,19,49,93,20,68,51,52,70,21,35,73,22,44,94,95,23,56,24,89,25],cufunct:6,"0x16151f0":82,objectfil:61,emploi:14,image_scn_mem_not_cach:92,dissect:6,paramattr_block:94,commerci:22,employ:22,one_onli:19,emit_22:46,unop:[12,13,40,41],rediscov:[34,9],image_file_machine_powerpc:92,globaldc:[26,14],createret:[36,40,41,!
 42,43],tr
 anspar:[33,75,86,14,18,74],bikesh:85,generalcategori:18,falsedest:60,split:[26,33,46,86,70,18,71,73,87,8,22,60,44],immtypebit:68,functionpassmanag:[40,41,42,43],annoat:24,reassoci:[26,51,40,41,42,43,10,11,12,13,60],dest1:60,fairli:[34,46,35,48,38,81,41,42,9,23,11,12,14,15,16],dest2:60,boiler:18,ownership:[40,41,42,43,22,14],printdeclar:46,engin:[61,20,83,34,86,26,36,32,21,38,42,43,51,9,56,10,11,15,81],tune:[52,0,18,71,40,87,65,13,14],libcal:[26,28],bewar:62,nuzman:0,gzip:[20,77],unchang:[60,14,35],ordin:18,volunt:[27,96],bit:[71,27,75,2,31,85,60,33,34,88,80,6,36,4,38,40,41,42,43,9,10,11,12,13,14,15,16,17,46,86,62,18,87,64,19,49,20,68,52,21,57,73,94,48,96,25],previous:[46,28,36,60,18,42,77,25,21,17],easi:[71,27,40,28,1,75,60,34,36,48,38,7,42,43,8,9,10,11,13,14,15,16,17,85,62,87,64,20,52,57,55,22,94,23,89],bitwidth:[60,94],had:[20,6,21,57,73,64,31,3,89,60],har:[20,44],hat:[20,57],sanit:52,ocamlbuild:[10,11,12,13,16,17],issimpl:73,preserv:[34,80,86,47,18,35,64,9,71,60],st_mode!
 :80,shado
 w:[46,62,40,41,42,11,12,13],stylist:75,measur:80,specif:[26,71,0,27,28,1,77,30,75,3,60,61,32,33,34,88,80,6,4,38,81,41,8,9,12,14,15,16,46,86,62,63,87,64,65,19,67,50,20,68,52,91,21,57,73,22,94,48,23,56,24,25],fcmpinst:14,nonlazybind:60,remind:77,underli:[75,86,14,18,71,22,60,21],right:[26,75,27,77,60,33,34,80,36,95,38,81,40,41,42,43,8,9,10,12,13,14,15,16,17,85,18,20,53,73,22,48,56],old:[20,34,32,60,21,35,40,87,82,22,9,49,13,14,81],getargumentlist:14,unabashedli:56,attornei:22,olt:60,paralleltarget:56,dominatorset:64,getbit:18,sparcsubtarget:46,bottom:[26,51,69,46,0,18,64,11,3,60,67],undisturb:75,lto_module_get_num_symbol:74,stringsort:75,subclass:[68,71,85,46,35,62,48,18,57,64,75,14,16],cassert:[75,6],armv7l:29,topleveltarget:56,op_begin:14,condit:[26,75,2,3,60,6,36,48,38,81,40,41,42,11,12,13,14,15,16,17,46,86,18,64,20,51,91,71,73,74],foo:[75,0,60,6,36,4,81,42,43,10,11,71,14,16,17,85,86,18,87,19,68,53,35,57,48,25],"0f00000000":6,armv7a:7,sensibl:14,egregi:22,tablegen:[20,33,5!
 2,46,32,7
 1,7,68,77,59,23,56,97,25],bindex:46,emitt:[68,46,42,82,11,97,60],image_scn_mem_lock:92,llvmanalysi:44,true_branch_weight:2,fca:51,slightli:[75,14,40,41,43,64,10,12,13,60],xor64rr:71,dw_tag_array_typ:87,basenam:87,expandop:33,mbb:[71,46],creativ:46,mcinstlow:71,wrap:[61,20,75,86,38,36,60,18,57,87,22,21,94,48,3,14,15,16,17],msp430:[20,71],data32bitsdirect:46,suffici:[26,68,53,85,35,62,4,18,38,73,70,60,56,24,86,14,15],support:[26,57,0,71,1,75,77,30,2,48,59,3,82,60,32,33,34,80,6,36,4,38,81,40,41,42,43,8,9,10,11,12,13,14,15,16,17,45,83,46,86,62,85,18,87,64,65,19,49,67,93,20,68,52,69,74,21,35,73,54,55,22,44,94,91,23,56,89,25],sub_rr:68,happi:[13,40,44],avail:[26,75,0,27,28,1,58,77,3,82,60,32,85,35,36,38,81,41,42,43,8,10,11,14,15,17,83,46,62,18,84,87,64,96,65,67,20,68,52,91,21,71,73,54,22,23,56],width:[34,0,62,60,71,73,75,9,94,14],cpprefer:14,overhead:[62,81,43,59,10,14],use_back:14,headach:27,"0x2413bc":64,fpga:71,offer:[62,21,57,14],refcount:62,multiprocessor:[62,64],reservereso!
 urc:71,my
 mod:56,insidi:75,reiter:60,independ:[75,0,3,4,32,34,60,81,7,9,14,46,86,18,64,49,67,20,21,71,22,23,56,24,74],handili:75,fermi:71,dump_valu:[10,11,12,13,17],rerun:[56,14],isexternalsymbol:46,adopt:[3,22,71],proven:[26,93,13,60,40],exist:[26,57,71,1,75,3,60,32,33,34,80,35,36,4,81,40,41,42,43,9,76,11,12,13,14,44,17,46,47,62,87,64,96,65,86,20,68,52,91,53,73,55,94,23,56,89],flagsflat:57,nvvmreflect:6,ericsson:60,build_phi:[11,12,13],bswap:[33,60],floor:[60,0],role:[75,27,48,87,62,25,16],finalizeobject:61,presum:60,smell:14,roll:[75,85],mri:71,legitim:75,notif:35,intend:[26,3,60,61,32,33,80,35,4,39,14,46,62,18,20,52,25,71,73,22,91,56,24,74],createargumentalloca:40,intens:[14,0],intent:[80,60,71,40,22,74,13,25],preverifi:26,keycol:59,valuehandl:20,"1s100000s11010s10100s1111s1010s110s11s1":14,cumemcpyhtod:6,geometr:[34,9],time:[26,53,0,27,40,28,1,77,30,75,60,61,32,5,71,6,36,4,38,7,41,42,43,8,10,11,12,13,14,15,44,17,63,46,47,62,74,18,84,33,87,64,96,65,19,67,93,80,20,68,51,52,70,21,35!
 ,73,57,54
 ,55,22,94,23,56,89,25],push:[62,75,71,70],image_file_dl:92,breadth:[67,38,15],nearbyint:[21,60,0],chain:[20,51,71,46,26,60,21,1,40,35,87,64,30,74,3,13,14],ptrtoint:[60,86],sparctargetmachin:46,osi:81,aptr:60,const_nul:[11,12,13],image_sym_type_short:92,decid:[33,57,0,48,18,53,40,41,43,64,10,12,13,60,16,87],hold:[26,75,60,61,36,48,38,40,41,42,43,10,11,12,13,14,44,17,46,62,18,87,64,20,68,71,16,23],decim:[68,80,18,57,19,60],worth:[70,75,14,29,85],x08:92,decis:[75,0,60,71,43,22,91,10,70],x03:92,uadd:60,macho:[61,71],oversight:22,x04:92,painlessli:18,uint32_max:87,cudevicecomputecap:6,s390x:21,vmcore:[20,18,52,14,33],fullest:75,exact:[26,75,47,62,14,18,73,87,64,74,23,60,28],mergebb:[40,41,42],solver:71,x0c:92,unsupport:[71,46,27,1,73,77,8,30],team:[44,77],cooki:60,prevent:[26,75,0,77,3,60,35,36,4,81,40,8,13,14,17,62,18,87,64,20,21,72,22,56],feat_inlineasm:71,dcmake_cxx_flag:7,sign:[68,34,88,69,46,86,60,18,71,75,22,9,94,14,74],heavyweight:14,scev:[26,35],relocat:[61,67,46],lazili!
 :[10,74,1
 4,94,43],currenc:[10,71,22,43],merge_bb:[11,12,13],current:[26,57,27,40,1,75,77,30,2,59,3,60,61,32,33,34,71,6,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,46,86,62,48,18,87,64,96,65,19,67,93,80,20,68,69,91,21,35,72,73,54,55,22,44,94,95,23,56,25],image_scn_cnt_cod:92,i256:60,objdir:[8,20,56],oeq:60,intraprocedur:70,cudevicegetnam:6,dropdown:69,autogener:22,live_begin:62,modif:[80,46,14,18,87,70,64,2,74,60],splice:[60,14],address:[26,71,0,58,60,61,34,6,40,43,9,10,13,14,44,46,86,62,18,87,64,93,66,68,52,91,21,35,72,73,54,22,94],along:[26,71,75,59,60,61,34,85,6,36,38,43,9,10,14,15,17,46,62,87,64,93,52,53,72,73,94,89],ffast:0,cur_var:13,volumin:14,commentstr:46,queue:[64,14,46],vectori:60,replaceinstwithvalu:14,mipsel:20,commonli:[20,75,46,62,14,63,94,60],ourselv:[87,6],ipc:3,ipa:51,love:14,"2ap3":19,pentium:[20,46],prefer:[68,75,69,46,35,27,60,38,29,73,96,22,91,66,3,14,15],ipo:51,src2:[68,71],regalloc:[64,67,65,71],src1:[68,71],cttz:60,instal:[27,7,28,29,30,33,6,36,48,81,40!
 ,41,42,43
 ,10,11,12,13,14,44,17,83,64,96,20,52,54,55,16,23,56],llvm_lib_search_path:20,anothercategori:18,virtreg:71,optimize_opt:20,image_sym_class_nul:92,abbrevid:94,scope:[75,60,14,35,36,40,41,42,11,12,13,70,17,62,87,64,68,91,57,22,94,97],tightli:[75,36,48,40,41,42,43,10,11,12,13,60,16,17],"66ghz":96,peopl:[32,33,34,69,86,38,27,18,71,75,77,64,22,9,3,60,15,81],claus:[71,22,60,91],refrain:77,enhanc:[32,34,36,40,41,42,43,64,22,9,75,10,11,12,13,97,17],visual:[20,75,52,46,26,60,21,71,42,30,32,11,4,63,14],linkmodul:56,langref:[33,73],easiest:[20,34,46,77,64,9,89],b_ctor_bas:4,subel:60,descriptor:[94,87,46],valuet:14,whatev:[26,86,35,60,18,57,3,4],problemat:75,encapsul:[75,85,49],recycl:71,setrecordnam:94,optnon:60,r11b:68,r11d:68,"0x00001c00":71,fpu:[7,29],legalizetyp:71,parameter:68,r11w:68,remap:[61,71],motohiro:71,spot:[26,77],mrm4m:46,mrm4r:46,succ:75,date:[20,68,80,35,27,21,42,77,30,56,11,70],fucompi:71,data:[26,57,71,78,75,3,60,61,33,6,86,40,41,42,43,10,11,12,13,14,46,47,62,18,87,!
 64,93,19,
 50,68,51,70,21,35,73,94,91,56,74],stress:[75,37,58],indexloc:14,disable_auto_depend:56,stdio:[20,55,30,11,10,3,12,13,74],stdin:[8,10,11,12,13,4,16,17],mangl:[20,93,22,87],fp4:68,sandbox:[27,7],fp6:68,fp1:68,fp0:68,fp3:68,fp2:68,callabl:[36,17,60,6],iftmp:[40,41,42,11,12,13],untest:27,operand_type_list_end:46,my_funct:6,llvm_library_vis:62,tta:21,x86retflag:68,overhaul:77,thumb:[3,22,71,85],image_sym_class_block:92,denser:[12,41],precedecnc:[40,41],instantli:14,"__stack_chk_guard":60,jit:[71,28,30,75,82,32,34,6,36,95,38,81,40,41,42,43,9,10,11,12,13,14,15,16,17,45,83,46,62,63,67,20,52,70,21,53,54,23,56],image_sym_class_end_of_struct:92,outli:91,smarter:18,isbinaryop:[40,41],"0x00000147":87,inpredsens:59,therebi:18,"0x00000140":87,getanalysi:64,didn:[75,36,71,40,87,64,13,14,16,17],llvm_src_dir:29,separ:[57,28,75,3,60,6,4,7,8,44,46,86,62,18,87,64,93,20,68,52,71,73,22,16,94,48,23,56,89,74],image_sym_class_end_of_funct:92,complextyp:92,sk_squar:85,compil:[26,53,91,0,27,40,28,29,5!
 8,77,78,3
 0,75,3,60,32,33,34,88,71,6,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,83,46,86,62,48,18,84,87,64,96,65,67,93,20,51,52,70,21,35,54,22,44,95,23,56,74],argvalu:[18,82],"2005q3":20,registertarget:46,switchinst:[26,2],lto_module_is_object_file_in_memory_for_target:74,movsx64rr32:71,toolchain:[20,21,71,52],blk:14,"0x1c2":19,libxxx:7,getschedclass:46,roots_iter:62,pseudocod:46,million:[60,14],removefrompar:14,crazier:[11,42],"byte":[33,80,46,35,60,71,72,73,87,86,94,31,10,11,12,13,14,16,17],subregist:46,reusabl:71,departur:56,jitcompilerfunct:46,sysconfdir:56,modest:75,recov:[14,4,91],neglect:28,arraytyp:14,oper:[26,57,0,71,75,2,3,60,33,34,88,80,6,36,48,38,81,40,41,42,43,9,10,11,12,13,14,15,16,17,45,46,47,64,65,67,86,68,91,21,35,73,94,56,25],onc:[26,57,27,71,28,1,77,30,75,3,61,32,5,34,35,36,95,81,40,42,43,9,10,11,13,14,16,17,46,86,62,74,18,84,33,64,20,68,51,52,70,21,53,55,22,48,94,91,56,89,25],iaddroff:71,insertbefor:14,"0x7f":[68,60],submit:[20,69,32,53,77,22,70],subtarget:!
 [71,46,97
 ],open:[32,68,71,52,85,95,21,56,75,87,89,30,22,11,10,3,12,13,60,81,17],lexicograph:75,addtmp4:[36,17],insttoreplac:14,f88:6,convent:[75,88,85,46,6,36,14,21,71,87,94,89,60,81,17],bite:81,f80:60,enable_optim:[54,20,77,56],optlevel:18,draft:[20,73,87],addtmp1:[10,43],getsubtarget:46,conveni:[20,68,34,52,85,6,60,18,1,41,42,75,9,26,11,12,71,14,81,44],goldberg91:62,usenamedoperandt:46,fma:[71,6,60,0],programat:[12,71,41],artifact:86,"__apple_namespac":87,third:[75,28,77,60,34,36,9,71,44,17,46,86,62,18,63,87,64,20,91,57,22,94],rival:14,rzi:6,"0x12345678":87,sai:[34,85,80,28,38,36,4,18,71,75,22,9,56,59,3,86,89,14,15,17],nicer:[18,57,14],argument:[26,71,28,1,58,30,75,31,59,60,61,33,34,85,35,36,4,81,40,41,42,43,8,9,10,11,12,13,14,16,17,83,63,46,86,62,48,18,84,87,64,93,67,20,68,52,91,53,72,55,44,95,56,97,25],second_tru:60,sar:71,saw:[64,11,74,42],entrytoken:71,notw:4,xxxgenregisterinfo:46,destroi:[71,46,14,57,64,91,60,81],note:[26,53,48,40,28,1,29,58,77,75,31,59,3,82,60,61,32,33,34,88!
 ,71,6,36,
 95,38,86,7,41,42,43,9,10,11,12,13,14,15,16,17,46,85,62,74,18,87,64,65,19,49,80,20,68,51,52,69,70,21,35,73,22,44,94,91,23,56,25],denomin:75,take:[26,57,27,71,1,30,75,31,59,60,61,5,34,85,6,36,4,38,81,40,41,42,43,9,76,10,11,12,13,14,15,16,17,46,86,62,74,18,84,33,87,64,65,49,67,20,68,52,90,70,21,35,92,73,55,22,48,94,91,56,89,25],cmake_prefix_path:52,noth:[64,26,86,62,60,38,71,40,8,91,56,3,13,14,15],funcion:6,printer:[26,46,62,71,23,24,60],buffer:[34,36,60,87,40,41,42,43,74,9,48,91,10,11,12,13,14,15,16,17],fcc_ug:46,compress:[20,52,94,31,56,14],llvm_is_multithread:14,insertel:[60,4],abus:14,homepag:[20,30],normalformat:18,allevi:[18,71,14],drive:[23,29],add_llvm_:52,axi:0,mcjit:[61,20,21,82,32],identifierstr:[36,48,38,40,41,42,43],cclib:[12,13],objptr:60,xml:94,xmm:[4,46],slow:[54,26,65,14,64],activ:[32,71,46,45,62,91,35,64,22,60],v2size:35,freebsd5:71,dw_tag_imported_declar:87,dominatortre:64,clang:[75,0,27,40,1,29,77,30,2,82,60,32,6,36,4,81,7,41,42,43,8,10,13,14,44,87,65,20,68!
 ,51,52,69
 ,91,21,73,55,22,48,23,56,74],"import":[26,57,0,27,1,29,77,30,75,59,60,32,34,35,36,48,39,41,42,43,9,10,11,12,71,14,16,17,46,62,18,87,64,20,70,21,53,73,22,94],requir:[26,57,27,40,1,29,77,30,75,59,3,48,60,61,33,34,88,71,6,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,46,47,62,85,18,64,86,80,20,68,52,70,21,35,73,55,22,44,94,91,23,56,74],prime:[36,48,40,41,42,43,10,11,12,13,16,17],borrow:60,specialsquar:85,getframes:62,openorcreatefileforwrit:3,xmax:[12,41],clenumvalend:18,where:[26,57,27,71,28,1,75,77,30,2,85,60,61,33,80,6,36,4,38,81,40,42,43,8,10,11,13,14,15,16,17,63,46,86,62,18,84,87,64,49,20,52,70,53,73,55,22,44,94,91,23,56,97,25],deadlin:22,postdom:26,dw_at_apple_property_sett:87,arglist:60,xxxtrait:57,x86targetmachin:71,x24:92,build_mul:[10,11,12,13,17],getindex:46,assumpt:[34,60,71,75,87,65,9,4],screen:[27,75],secnam:19,opval:46,sparc:[20,68,88,46,21,71,73,64],uncondition:[71,35],genericvalu:[10,11,12,13],eflag:68,extern_weak:[60,94],mani:[26,53,0,27,40,28,30,75,85,3,!
 60,81,33,
 34,71,6,36,4,38,39,7,41,42,43,8,9,10,11,12,13,14,15,16,17,46,86,62,18,87,64,20,69,70,21,35,73,57,94,48,23,56],dw_at_mips_linkage_nam:87,unistd:3,sccp:[26,51],sentinel:14,constant:[26,71,75,31,60,33,6,36,81,40,41,42,43,10,14,17,46,62,18,87,64,19,20,51,35,73,94],boat:75,curs:[95,1],printstar:[11,42],fib:[26,38,40,42,11,13,15],add16mr:68,pluginfilenam:67,ismod:68,parseifexpr:[40,41,42],inst_begin:14,add16mi:68,constantfoldcal:33,thousand:26,formed:60,debug_nam:87,ppcisellow:33,former:[48,71,73,16],combine1:71,combine2:71,emitalign:62,rawfrm:[68,46],polli:52,view_function_cfg:11,test_exec_root:1,lto_module_get_symbol_attribut:74,canon:[60,14,87,26],blah:18,pthread:60,ascii:[80,36,48,38,40,41,42,43,87,94,10,11,12,13,60,15,16,17],binari:[26,75,27,40,77,30,60,61,5,34,79,6,36,48,38,81,7,41,42,43,9,76,10,11,12,13,14,15,16,17,83,46,62,18,84,87,66,88,68,52,90,70,21,71,92,54,55,22,94],devcount:6,tutori:[4,32,34,6,36,48,38,40,41,42,43,9,10,11,12,13,15,16,17,45,18,56],immutableset:14,sre!
 m:[71,60]
 ,sreg:6,intrepid:[48,16],"0x1603020":82,getfunct:[36,40,41,42,43,64,62,14],extern:[26,27,28,29,60,61,34,80,6,36,48,38,40,41,42,43,8,9,10,11,12,13,14,15,16,17,45,46,18,87,64,93,67,20,21,71,54,55,94,74],defi:60,sret:[60,94],defm:[68,25,46],fnname:[36,48,40,41,42,43],dw_form_ref_udata:87,clobber:[68,71,60,35],dimension:[12,86,60,41,6],runtimedyldmacho:61,noencod:71,resp:[60,14],rest:[20,89,62,4,71,40,87,22,74,94,48,3,13,60,16,14],checkcudaerror:6,fmadd:71,gdb:[32,34,46,71,87,82,64,55,9,14],unmaintain:68,invalid:[26,75,1,61,35,36,48,40,41,42,43,10,11,12,13,14,16,17,46,86,18,84,87,64,51,91],smallvector:14,loadable_modul:[8,56,64,62],cond_fals:[13,40],r13w:68,ghostli:14,"__imp_":60,littl:[26,75,29,3,60,34,36,48,38,81,40,41,42,43,9,12,13,14,15,16,17,46,86,62,18,87,64,20,71,94,56,89],instrument:[20,86,63,64,78,26],r13d:68,r13b:68,exercis:[8,34,9],dwarfdebug:87,featurev8deprec:46,uncal:75,mrm2m:[68,46],around:[26,75,77,3,60,34,35,48,81,42,9,11,14,46,86,18,87,64,49,20,73,22,23],libm:!
 [10,36,43
 ,60,17],getunqu:14,unveil:[38,15],libz:60,traffic:[40,13,14],dispatch:[48,14,16],at_decl_lin:87,mrm2r:[68,46],ac_config_srcdir:44,intel:[52,0,88,7,8,65,67,60],"__gxx_personality_v0":[91,60],integ:[75,0,31,4,33,80,6,36,60,8,71,14,17,46,86,62,18,87,68,91,57,94,25],timepassesisen:18,updat:[26,77,60,61,33,34,80,35,36,4,81,40,41,42,43,9,10,11,12,13,14,44,85,62,18,87,64,20,52,69,91,21,71,48,74],inter:[3,22,51,35],manag:[61,20,34,46,35,27,95,81,40,70,64,62,51,9,77,96,86,13,14],mfenc:73,pushf:71,pred_iter:14,constitut:[8,14,94],pod:75,stryjewski:26,seterrorstr:[40,41,42,43],"0x000000000059c583":82,definit:[26,71,77,75,31,59,60,32,33,34,36,4,38,39,40,41,42,43,9,10,11,12,13,14,15,16,17,46,18,87,64,93,68,51,74,53,73,94,48,23,56,97,25],parseextern:[36,48,40,41,42,43],evolv:74,exit:[26,75,76,28,1,4,78,31,82,37,5,34,79,80,6,60,39,40,41,42,43,9,11,14,81,83,63,47,62,84,64,65,19,66,67,50,90,91,71,93,95,97],notabl:[60,71,14,86,20],refer:[26,57,27,71,1,4,77,75,60,61,32,88,6,36,95,81,40,42,8,1!
 1,13,14,1
 6,17,46,86,62,48,18,87,64,93,49,67,20,68,51,52,69,70,21,35,94,91,23,56,24,25],pointnum:62,power:[26,29,60,88,35,36,48,38,40,41,42,43,10,11,12,13,14,15,16,17,18,21,71,74],isloopinvari:14,blockaddress:60,image_sym_type_union:92,"0x7ffff7ed404c":82,ispic:46,mov64ri:46,isset:18,mingw32msvc:71,acc:[20,14],stone:21,spiffygrep:18,gplv3:55,aco:35,acm:[62,71],printmethod:46,compuat:51,act:[60,71,14,87,26],industri:32,rebuild:[20,81,14,56],specialfp:68,srcloc:60,effici:[26,75,3,60,32,35,48,81,43,8,10,14,16,85,62,87,64,65,20,68,21,71,22,94,24],ri_inst:68,surviv:[91,16,48],homeless:14,asymptomat:95,setinsertpoint:[36,40,41,42,43],hex:[57,60],movsx64rr16:71,kaleidoscop:[45,34,36,48,38,40,41,42,43,9,10,11,12,13,15,16,17],verbatim:[18,46],thedoclist:57,mantissa:60,conclud:[11,12,41,42],bundl:71,htpasswd:22,createjit:61,clenumv:18,epilog:[71,46],conclus:[45,34,48,38,40,9,13,15,16],ifunequ:60,pull:[20,75,73],tripl:[61,20,46,6,27,71,7,87,8,65,94,67,60],dirti:75,rage:31,agrep:28,inaccuraci:60!
 ,emitprol
 ogu:46,basenamesourc:56,uid:80,creat:[26,71,0,27,40,28,1,77,30,3,60,61,32,34,80,6,36,48,81,7,41,42,43,9,10,11,12,13,14,15,16,17,45,83,46,86,62,18,84,87,64,65,49,20,68,52,69,74,57,22,44,91,96,56,24,89,25],certain:[64,54,33,71,80,35,14,18,1,40,68,43,8,19,60,10,56,13,4],getnamedoperandidx:46,creal:[12,41],movsx32rr8:71,discrimin:[71,75,85],collector:[34,62,81,51,9,94,60],promoteop:33,collis:[36,60,75,14,87],writabl:87,freestand:60,of_list:[10,11,12,13,16,17],benchspec:28,fatal_error:52,spiffysh:18,allowsanysmalls:14,mask:[71,62,4,57,49,60],shadowlist:46,llvm_shutdown:14,tricki:[62,64,75,73],mimic:[56,75],createuitofp:[36,40,41,42,43],prealloc:14,cpp:[75,3,82,4,33,6,36,48,81,40,41,42,43,8,83,46,62,18,87,64,20,52,71,56],cpu:[57,46,21,1,7,29,64,65,94,49,67,60],consider:[20,71,57,87,3,14],illustr:[38,36,60,18,40,87,43,64,74,48,10,13,14,15,16,17],labeltyp:14,scc:[64,26,51],dw_at_apple_properti:87,astcontext:75,rewrit:[26,75,85,46,40,51,13],add16ri:68,incap:[34,9,94],add16rm:68,dist!
 alwai:56,
 tail:[26,68,34,94,6,25,71,87,9,60,4],add16rr:68,norm:[56,25],type_code_funct:94,getframeinfo:[71,46],"102kb":18,hard:[71,80,40,38,57,7,29,41,54,22,70,75,3,12,13,60,15,44,81],candid:[27,60,77],element_typ:[10,11,12,13,17],attr0:94,attr1:94,ia64:88,strang:[28,13,40,81],condition:1,quux:75,pedant:52,sane:[38,52,15,73],small:[26,75,28,77,31,3,60,32,6,95,38,8,70,15,85,86,62,18,87,64,67,14,71,22,94,23],release_xi:77,dsa:51,mount:20,"__image_info":60,sync:[20,57,73,6],past:[68,75,69,46,86,14,41,73,22,12,60],pass:[26,53,91,27,71,28,1,58,77,59,82,60,61,32,33,34,85,6,36,4,39,40,41,42,43,8,9,10,11,12,13,14,81,16,17,63,46,86,62,48,18,84,87,64,65,19,49,67,20,52,70,21,35,72,73,55,22,44,95,23,56,24,74],howev:[75,0,28,30,59,3,60,61,34,80,35,81,40,41,42,43,8,9,10,11,12,13,14,86,62,18,87,64,20,70,71,72,73,54,55,22,94,23,56,89],enter_subblock:94,trick:[32,34,85,14,38,7,22,9,40,13,60,15],deleg:91,xor:[26,71,46,6,14,0,60],registerregalloc:64,clock:[64,60],section:[26,71,0,92,28,1,77,75,3,60,61,!
 34,80,35,
 85,48,86,43,9,10,14,16,46,47,62,18,84,87,64,19,66,67,50,20,68,52,91,21,53,72,73,22,94,23,56,24,89,25],delet:[26,75,60,80,6,36,4,81,40,41,42,43,10,11,12,13,14,17,87,64,20,70,71,35,55],abbrevi:[75,94,31],succinct:1,letlist:25,method:[53,71,28,75,3,60,61,33,85,35,36,4,40,42,43,10,11,13,14,17,46,86,62,18,87,64,49,51,70,57,48],contrast:[85,36,91,71,64,17],hasn:[64,14,86],full:[26,57,40,77,75,82,60,34,71,6,36,48,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,83,84,87,93,20,89,52,69,21,35,73,22,44,23,56,97],hash:[26,34,20,35,87,57,22,9,14],vtabl:[75,4,87],unmodifi:44,tailcal:71,blocknam:94,inher:[81,14],ineffici:[0,71,40,94,13,14],dw_tag_arg_vari:87,islvalu:75,myownp3sett:87,shufflevector:[60,4],prior:[20,75,91,18,71,64,94,23,60],lto_module_get_symbol_nam:74,pick:[71,52,46,86,60,53,7,43,75,10,67,14],action:[33,75,46,62,14,71,64,2,91,56,60],narrowaddr:60,token_prec:[10,11,12,13,16,17],via:[61,20,71,69,26,91,14,21,84,7,64,82,8,55,74,56,3,60],depart:[75,80],dw_tag_namespac:87,ifcond:[4!
 0,41,42,1
 1,12,13],vim:[20,68,89,56],memrr:46,image_sym_class_member_of_union:92,ifcont:[40,41,42,11,12,13],decrement:91,select:[26,71,28,1,78,30,59,60,61,33,6,40,13,14,46,86,18,64,93,20,68,51,69,70,21,57,22,91,56],silva:25,x44:92,mycompil:52,targetselect:[40,41,42,43],isconst:[14,94],more:[26,53,91,0,27,40,28,1,29,30,75,31,85,3,60,32,33,34,71,6,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,63,46,86,62,48,18,84,87,64,96,49,50,80,20,68,51,52,69,70,21,35,72,73,57,54,22,44,94,95,23,56,24,89,74],isintegerti:14,door:85,tester:[32,28,1,58,77,22],f3_2:46,type_code_metadata:94,zeroext:[60,94],addcom:62,movabsq:72,multiset:14,compani:22,cach:[61,26,52,35,14,87,71,29,73,64,60],llvm_on_unix:3,at_apple_properti:87,x86callingconv:46,returntyp:60,learn:[20,34,69,60,21,40,89,75,9,13,14],cmpinst:14,legalizedag:33,bogu:[64,20],scan:[64,34,62,1,75,43,8,65,9,10,67,71],challeng:[12,41],registr:[88,46,62,81,82,64],accept:[20,75,69,85,6,4,18,81,55,30,22,60,24,14,25],pessim:26,x86instrinfo:46,v_reg:71,!
 huge:[8,2
 0,22,75],llvmgrep:20,readobj:[20,50,58],testresult:32,feat_objectwrit:71,appenduniqu:60,simpl:[26,57,0,71,28,1,30,75,3,60,33,34,6,36,4,38,40,41,42,43,8,9,10,11,12,13,14,15,16,17,45,46,86,62,18,87,64,65,67,93,20,68,70,35,73,22,44,94,48,23,24],isn:[26,75,3,60,36,48,38,81,42,43,10,11,70,15,44,17,86,64,14,71,73,22,16,56],loophead:[60,41,42],plant:64,referenc:[60,36,48,40,41,42,43,10,11,12,13,14,16,17,46,18,87,93,51,74,55,94,25],spillalign:46,variant:[64,26,52,46,14,18,8,23,11,10,3,12,13,4,15,16,17],plane:[12,41],maywritetomemori:[14,73],thought:[36,25,71,60,17],circumst:[46,4,40,43,64,60,91,10,56,13,14],github:45,arcanist:69,author:[75,85,71,51,25,81],atan2:[38,15],nvidia:[71,6],returns_signed_char:60,constitu:[11,42],ith:14,trade:[70,14],i386:[66,71],paper:[32,71,75,88],vec2:[60,14],pane:69,vec1:[60,14],bou_unset:18,explor:[14,69],nifti:[64,11,34,9,42],alli:60,gcov:78,hexinteg:25,superflu:86,targetselectiondag:[33,71,46],image_sym_type_void:92,argsv:[36,40,41,42,43],cond_next:!
 [13,40],i
 nstruct:[26,53,0,71,75,2,31,59,60,32,33,34,88,80,6,36,4,81,40,42,43,8,9,37,10,11,13,14,17,46,86,62,87,64,65,67,20,68,51,52,69,70,21,35,72,73,55,94,91,56,24,97],authent:[96,88],achiev:[52,60,21,73,74,59,3,14],tokcodefrag:25,debug_with_typ:14,found:[26,53,0,27,71,4,77,30,31,59,3,60,32,80,6,36,95,40,41,8,12,13,14,44,17,46,62,18,87,64,20,52,90,70,35,57,22,91,56,74],gettermin:14,mergabl:26,"0b000011":46,monoton:[60,73,77],type_info:91,realli:[26,75,28,30,60,33,34,36,38,81,40,41,42,43,8,9,10,11,12,13,14,15,17,86,18,87,68,52,73,22,56,89,25],loweralloc:64,getcalleesavedreg:46,reduct:[26,75,0,95,58,67,60],reconstitut:60,massiv:[56,39],ftz:6,stackframes:62,research:[32,28,33,87],getbasicblock:71,x86genregisterinfo:[71,46],occurr:[18,4,94],loopbb:[40,41,42],qualifi:[81,86,71,87,77,60],distoth:56,proxi:71,on_clon:1,numabbrevop:94,believ:[75,60,41,42,43,22,10,11,12,14],"__cxa_begin_catch":91,instrmap:[59,46],mrm0m:46,fnptrval:60,xxxend:14,amper:29,testament:[38,15],ge_missing_jmp_buf:75!
 ,new_then
 _bb:[11,12,13],major:[20,68,71,46,26,4,21,35,40,54,77,8,22,60,13,14,81],dw_at_high_pc:87,curesult:6,unprofit:26,number:[26,71,0,48,40,28,1,75,77,2,31,82,60,32,33,34,80,35,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,83,46,86,62,74,18,87,64,49,20,68,51,52,69,70,57,72,89,54,22,44,94,91,23,56,97,25],dw_at_apple_property_readwrit:87,distchecktop:56,obj_root:20,horribl:75,dw_at_low_pc:87,"0xxxxxxxxx":87,exponenti:[26,18,60],checkpoint:91,unrecogniz:93,functionast:[36,48,40,41,42,43],illeg:[26,71,86,6,14,18,0,60,81],dfa:[71,97],fptr:[40,41,42,43],relationship:[46,62,60,87,64,59,3,4,14],dagarglist:25,consult:[20,51,80,32,81,64,30,56],aad:71,llvm_svn_rw:82,tokstr:25,seamlessli:74,powi:60,reus:[14,71,87,64,22,60],arrang:[64,85,18,71,8,60,44],comput:[26,71,75,31,60,34,88,6,36,38,81,40,41,42,43,9,10,11,12,13,14,15,17,46,86,62,64,70,21,35,96],packag:[20,52,32,27,7,29,77,54,56,44],returns_twic:60,flto:55,equival:[25,68,34,52,86,6,62,60,18,71,73,75,19,94,56,26,9,14,21,67],odd:[18,22!
 ,75,53],s
 elf:[26,81,69,62,48,28,71,41,43,64,94,10,12,14,16],also:[26,57,91,0,27,40,28,1,29,77,30,75,31,59,3,48,60,32,5,34,79,71,6,36,4,38,81,7,41,42,43,8,9,76,10,11,12,13,14,15,16,17,46,86,62,74,18,33,87,64,65,49,66,67,93,80,20,68,51,52,69,70,21,35,73,54,55,22,44,94,95,23,56,89,25],without:[26,75,0,77,3,82,60,80,95,38,81,40,41,42,43,8,10,11,12,13,14,15,16,83,46,86,62,48,18,87,64,49,67,20,52,69,70,21,71,73,54,55,22,44,94,91,56,24,89,74],ex2:6,selp:6,ptrc:6,coff:[88,71,19,92],ptra:6,pipelin:[26,46,6,40,41,42,43,8,31,10,11,12,13,64],unset_vari:56,rhs_val:[10,11,12,13,17],step_val:[11,12,13],plai:[34,38,64,9,25,15],plan:[68,81,6,62,71,64,22,14],exn:60,alu32_rr:59,"0x14c":92,cover:[64,20,86,75,46,38,18,71,41,87,8,30,22,21,96,12,89,60,15],abnorm:3,exp:[2,60,0],microsoft:[32,52,18,71,30,96,88,60],pubnam:87,gold:[20,71,55,29,32],getsymbolnam:46,xcode:[20,52,82],gcmetadaprint:62,session:[89,82],tracevalu:26,ugt:60,impact:[62,60,75,14,87],addrri:46,writer:[32,33,71,88,46,62,39,73,64,94,97,60,!
 81],solut
 :[32,34,52,18,71,40,73,87,64,9,13,14,81],printdatadirect:46,llvm_executionengin:[10,11,12,13],factor:[68,75,0,14,71,60],bernstein:87,i64imm:46,llvm_obj_dir:81,microprocessor:[71,60,46],regstat:71,mainten:[59,22,74],bitmap:94,f2_1:46,synthet:46,f2_2:46,synthes:[10,33,87,43],"__stack_chk_fail":60,machinememoperand:73,coerce_offset0:4,link_compon:[56,44],set:[26,57,27,40,28,1,29,77,30,75,59,3,60,61,32,33,85,88,71,6,36,95,38,81,7,41,42,43,8,10,11,12,13,14,15,16,17,46,62,74,18,84,87,64,96,65,67,93,80,20,68,52,69,70,21,35,54,55,22,44,94,48,23,56,97,25],image_sym_class_member_of_enum:92,seq:92,creator:[64,20],overwhelm:[38,15],organ:[32,75,91,28,87,43,8,10,23,3,44],startup:[54,75,1,60,6],seg:20,see:[26,53,0,27,40,28,1,30,75,31,85,3,60,32,5,34,79,71,6,36,4,81,7,41,42,43,8,9,76,10,11,12,13,14,16,17,46,47,62,48,18,84,33,87,64,96,65,66,67,86,93,80,20,68,51,52,70,21,35,73,89,22,44,94,95,23,56,24,97],sed:[20,81,56],overboard:75,analog:[62,68,14],module_code_tripl:94,reglist:46,parsenumb!
 erexpr:[3
 6,48,40,41,42,43],lto_codegen_cr:74,topmost:62,mymaptyp:57,mutex:14,subdir:[8,56],documentlisttrait:57,mappingtrait:57,thrive:32,signatur:[64,71,60,80,31],machineoperand:[71,46],javascript:[34,9],libnam:[64,56,83],myocamlbuild:[10,11,12,13,17],disallow:[23,18,60,86],nohup:27,dividend:[71,60],proj_src_dir:56,closur:[23,34,9],last:[75,0,1,77,85,4,80,36,60,38,41,8,12,14,17,46,18,64,68,91,21,71,22,94,89,25],operarand:2,"0xh":60,whole:[64,33,75,80,62,60,28,71,7,42,43,8,23,22,48,49,10,11,14,16],partialalia:35,load:[26,53,71,1,4,75,60,61,6,95,39,40,82,8,13,14,63,46,47,62,18,84,87,64,65,67,86,51,70,21,35,73,94,23,56,24,74],episod:[11,42],nakatani:71,schedul:[20,46,4,21,71,29,77,64,67,14],dw_tag_namelist:87,hollow:57,lex:[38,10,11,12,13,25,15,16,17],functionpass:[26,46,35,62,64,14],"0x100000f24":66,boolean_property_nam:23,worthless:75,devic:[5,79,90,6,76,21,84,29],perpetu:22,"0xf":68,devis:44,firm:56,gettokpreced:[36,48,40,41,42,43],fire:[75,70],func:[5,60,64,10,11,12,13,14,16,17],r!
 egisterpa
 ss:64,rdtsc:60,straight:[68,35,36,48,38,71,49,3,14,15,16,17],erron:[20,18],histor:[8,60,73,86],durat:[64,71,35],passmanag:[61,18,40,41,42,43,64,10,11,12,13],error:[26,53,57,27,71,1,77,75,31,3,60,5,34,79,80,6,36,4,38,81,40,41,42,43,8,9,76,10,11,12,13,14,15,16,17,83,63,46,62,48,18,84,64,65,19,66,67,20,68,90,91,35,73,55,22,44,95,56,97,74],dvariabl:52,v1size:35,real:[20,75,46,6,4,18,35,41,87,60,12,14,38],machinecodeemitt:46,reg2mem:26,binutil:[96,20,88,7,55],genregisternam:71,miscommun:22,inst_invok:94,chase:53,i29:60,decor:87,irrelev:[86,60,35],i20:60,i24:60,x64:[96,20,4],funni:[75,13,40],decod:[26,68,14,87,94,60],sparclite86x:46,built_sourc:56,foldingset:14,bitread:23,predreg:59,dw_at_declar:87,stack:[26,71,75,60,32,34,35,38,40,9,13,14,15,46,62,87,64,20,51,91,21,57,72,24,25],recent:[20,27,91,57,22,60],call32r:68,eleg:[34,48,42,43,9,10,11,16],llvm_unreach:75,person:[91,53,60,89,57],parse_prototyp:[10,11,12,13,16,17],expens:[26,75,46,91,18,73,64,65,67,14],call32m:68,llvm_tableg!
 en:52,alw
 ays_inlin:26,crosscompil:[71,7],else_v:[11,12,13],debug_level:18,simd:[67,21,65,60,0],sidebar:77,smooshlab:32,eager:14,input:[26,57,0,71,1,4,78,31,59,60,81,5,34,79,6,36,95,38,39,40,41,42,43,8,9,76,10,11,13,70,15,17,46,18,84,87,64,65,66,67,50,20,68,51,21,35,92,93,48,56,97,74],format:[26,71,28,1,78,75,31,59,60,61,32,33,88,80,6,39,82,81,63,46,47,18,84,87,65,19,67,50,93,20,68,91,21,57,22,94,23,89],subfield:68,intuit:60,dw_tag_ptr_to_member_typ:87,formal:[60,14,87],ivar:87,isdeclar:14,threadsaf:62,image_sym_type_nul:92,parse_toplevel:[10,11,12,13,16,17],ii32:68,x86framelow:71,moduleid:[8,36,17],encount:[60,93,71,14,46],image_file_debug_strip:92,sampl:[20,6,36,48,18,92,82,62,30,44,59,56,16,17],sight:[13,40],instcount:26,"_bool":[13,40],p5i8:6,foreign:[81,52],recognit:21,llvm_obj_root:[8,56,28,44],xxxgendagisel:46,agreement:22,prerequisit:[64,46],linker_private_weak:60,indirectbrinst:2,condbranch:46,oneormor:18,getinsertblock:[40,41,42],putchard:[34,36,40,41,42,43,9,10,11,12,13],p!
 rimarili:
 [20,5,39,26,62,21,1,29,47,41,68,23,12,71,14,50],getimm:46,xxxinstrformat:46,requires_rtti:54,contributor:22,occupi:[60,80],span:[64,75],printinformationalmessag:18,custom:[26,33,71,52,46,28,32,62,4,18,57,68,75,60,95,23,86,14,21,81],createcondbr:[40,41,42],suit:[20,33,71,52,27,91,28,1,7,87,77,8,30,22,56,14,81],parse_arg:[10,11,12,13,16,17],expound:87,subgraph:26,atop:62,lint:26,nodupl:60,atoi:60,link:[26,53,27,71,58,77,30,75,60,32,34,80,6,36,95,38,7,41,43,8,9,10,11,12,13,14,15,44,17,83,46,62,18,84,87,64,93,19,20,51,52,90,70,35,72,54,55,22,23,56,89,74],atom:[32,26,4,73,87,60,14],line:[26,57,91,0,27,71,28,1,30,75,31,82,60,32,5,34,79,80,6,36,4,38,81,40,41,42,43,8,9,76,10,11,12,13,14,15,16,17,46,62,48,18,84,87,64,65,49,66,67,50,93,20,68,89,52,69,90,70,21,53,72,73,54,55,22,44,95,23,56,97],talli:28,simplif:[64,26,21,70],cin:81,intim:75,hex8:57,"0xffffffff":94,fdiv:60,doc:[20,33,52,32,95,21,57,7,77,88,89],impl:[64,26,14],debugtrap:60,parser:[60,34,36,48,38,81,40,41,42,43,9,10,11,12!
 ,13,15,16
 ,17,45,18,20,71,23,97],call_site_num:91,"char":[75,0,82,60,80,6,36,48,40,41,42,43,10,11,12,13,14,15,16,17,46,86,18,87,64,35,74],at_encod:87,gcfunctioninfo:62,doe:[26,53,57,71,28,1,77,30,75,85,3,82,60,81,61,33,34,79,80,6,36,38,39,40,41,42,43,8,9,10,11,12,13,14,15,16,17,46,86,62,74,18,87,64,93,49,20,68,52,70,35,72,73,55,22,44,94,91,56,24,25],linkonceodrlinkag:14,tok_unari:[40,41],codes:68,xxxcodeemitt:46,ud2a:71,kwalifi:92,scrape:1,disp32:71,isnotduplic:68,issiz:14,caml:[45,15,16],lang:18,mayalia:35,land:[91,22,60],x86codeemitt:46,algorithm:[26,34,71,46,35,62,60,18,39,40,42,75,9,48,91,11,13,14,21,16],agg:60,libstdc:[20,7],fresh:[20,56],hello:[20,68,38,64,30,60,15],mustalia:35,llvmcontext:[36,14,40,41,42,43,60],code:[26,53,91,0,27,40,28,1,29,58,77,30,75,48,85,3,82,60,61,32,33,34,71,6,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,45,46,86,62,74,18,63,87,89,64,65,19,49,66,67,93,80,20,68,51,52,69,70,21,35,72,73,57,54,55,22,44,94,95,23,56,97,25],partial:[26,51,20,14,0,57,8,71,!
 60,97],re
 sultv:60,scratch:[14,46],setcc:[71,14],globallisttyp:14,printimplicitdef:46,young:14,send:[20,5,71,79,69,32,27,76,21,53,65,73,77,8,22,96,97,64,89],tr1:14,sens:[34,80,81,35,36,60,18,71,73,87,75,9,86,14,21,17],henderson2002:62,sent:[32,65,22,77,76],unzip:[27,20],clearresourc:71,registeredarg:62,tri:[26,52,46,38,71,64,89,70,15],bsd4:80,setconvertact:46,magic:[20,80,14,41,87,94,12,60],dname:18,complic:[20,33,75,85,46,62,73,8,30],trc:71,tre:26,blockquot:94,fewer:[62,26],"try":[26,57,71,75,3,60,32,34,35,95,81,40,41,43,9,10,11,12,13,14,16,17,47,18,63,64,20,70,53,73,91,56,89],race:[14,73],build_uitofp:[10,11,12,13,17],udiv:[71,60],vehicl:75,impli:[20,46,35,62,25,71,22,60,56,66,3,86,14],monospac:89,natur:[26,75,27,77,3,4,36,60,40,42,11,13,14,17,85,86,62,18,87,64,20,68,91,57,73,22,89,74],odr:60,proj_obj_dir:56,psubu:8,llvmdebugvers:87,instnam:26,ueq:[40,13,60],index:[32,57,80,46,20,62,14,18,35,87,77,91,94,49,56,86,71,60,21],twine:14,targetregisterclass:[71,46],asmwrit:[62,33],getanal!
 ysisusag:
 [64,35],henceforth:72,paramti:94,image_scn_align_64byt:92,dyn_cast_or_nul:14,lea:[68,71],targetregisterinfo:[71,46],len:60,sparctargetlow:46,rglob:5,let:[53,71,28,59,60,34,85,6,36,4,38,40,41,42,43,9,10,11,12,13,14,15,16,17,46,86,18,87,64,20,68,52,69,74,21,35,54,48,96,89,25],ubuntu:[20,7,29],ptx30:71,ptx31:71,great:[75,62,38,71,41,64,22,56,12,14,15],survei:88,machineinstr:[67,65,71,46],technolog:[74,21,34,9],rdx:68,flagshollow:57,global_end:14,rdi:68,firefox:21,sgt:60,sgi:14,sgn:60,sge:60,movsx32rr16:71,"__________":14,getnumparam:14,eltti:94,zip:[20,56],commun:[61,32,51,6,60,35,75,77,64,22,74,3,82,14,81],my_fmad:6,doubl:[26,71,30,60,34,88,85,36,4,38,40,41,42,43,9,10,11,12,13,14,15,16,17,46,18,87,68,57,94,48,56],upgrad:[20,81,87,47],next:[75,27,77,30,59,60,61,85,36,4,38,40,41,42,43,8,10,11,12,13,14,15,16,17,46,86,62,48,18,87,64,20,70,21,94,91,74],doubt:[89,85],lock:[64,60,14,73],commut:[26,71,46,35],fpregsclass:46,comparison:[26,85,0,27,14,86,41,73,2,48,12,60,16],gladli:[20,!
 30],first
 condit:14,bunzip2:20,objectslo:56,uvari:52,get_instrinfo_operand_enum:46,folder:[20,52],devmajor:6,intregssuperregclass:46,scatter:[87,0],dw_form_data4:87,weaker:60,dw_form_data1:87,dw_form_data2:87,process:[26,57,0,27,29,77,75,59,3,82,60,61,32,34,80,4,38,43,8,9,10,71,14,15,16,46,62,48,18,87,64,93,20,68,69,70,21,53,73,22,91,23,56,74],optioncategori:18,preformat:89,high:[26,75,0,77,3,60,61,32,33,34,80,6,81,40,82,8,9,71,14,44,46,86,62,87,68,13,91,35,22,94],pictur:[36,86,17],fprintf:[36,48,40,41,42,43],streamer:71,dw_ate_signed_char:87,onlin:[13,40],adc32mi8:68,visitsrl:33,delai:14,infeas:51,allocainst:[60,13,14,40],stand:[64,75,14,71,8,22,48,60,16],overridden:[60,46,35],singular:75,surfac:71,xc3:92,xc7:92,xc4:92,x86registerinfo:[71,46],addri:46,dw_at_apple_property_attribut:87,dw_tag_class_typ:87,alloc:[57,75,60,61,34,35,40,43,9,10,13,14,46,86,62,64,65,67,20,91,21,71,72],essenti:[46,62,84,73,94,14],sdiv:60,seriou:20,counter:[26,70,21,73,60,14],robot:32,element:[26,33,57,46,6,!
 14,0,89,3
 5,87,75,68,94,86,71,60,25],issu:[57,71,1,29,77,75,34,6,38,40,42,43,8,9,10,11,13,14,15,18,87,64,19,20,35,22],liveintervalanalysi:71,unaccept:22,allow:[26,57,91,0,71,1,75,92,77,2,85,3,82,60,61,32,33,34,80,6,36,4,38,81,40,41,42,43,9,10,11,12,13,14,15,16,17,46,86,62,48,18,87,64,65,19,49,20,68,69,74,21,35,72,73,54,22,94,95,23,56,24,25],retval:[36,40,41,42,43,60],stepexpr:[13,40,41,42],movl:4,fstrict:60,movi:75,move:[26,34,80,20,62,35,75,73,42,77,64,22,9,11,71,60,81],stacksav:60,comma:[20,68,18,57,42,11,24,60],oprofil:[54,52],ofstream:18,perfect:22,define_abbrev:94,disambigu:35,chosen:[71,75,1,60],infrastructur:[64,20,33,71,32,62,14,21,1,75,35,70,8,22,96,60,44,87],cond_tru:[13,40],lastinst:46,therefor:[26,71,86,6,62,14,18,57,73,64,22,24,60],python:[20,34,27,1,7,8,62,30,9,25],initializenativetarget:[40,41,42,43],overal:[69,86,62,91,71,42,22,11,60],innermost:0,facilit:[14,57,87,22,60,44],typestack:33,fcc_val:46,anyth:[20,75,85,26,36,65,71,73,42,43,87,30,22,67,10,11,14,81,17],hasext!
 ernallink
 ag:14,truth:[11,60,42],"0b111":68,llvminitializesparcasmprint:46,compute_xx:6,idxmask:60,subset:[26,34,86,6,60,21,1,35,87,8,22,9,14,28],denseset:14,"0x7fffffffe040":82,bump:[62,72,14],lsampl:44,"static":[26,57,7,58,75,60,61,33,85,35,36,95,38,81,40,41,42,43,10,71,14,44,17,46,86,62,18,87,64,65,67,20,51,70,21,53,73,48,56,74],convert_from_eh_region_ranges_1:20,variabl:[26,53,0,71,28,1,30,75,31,60,61,5,34,80,6,36,4,38,81,40,41,42,43,8,9,10,11,12,13,14,15,16,17,45,46,86,62,18,87,64,20,68,51,52,35,72,73,57,55,44,94,48,56,25],matrix:[62,21,71],contigu:[60,14,87],myregalloc:64,tok_if:[40,41,42],tok_in:[40,41,42],memorysanit:60,shut:[75,46],initializepass:35,unpars:[48,1,16],tempt:[3,75],image_file_system:92,shortest:25,spill:[67,71,46],could:[26,71,1,75,59,3,60,34,85,35,36,4,81,40,41,42,43,8,9,10,11,13,14,16,46,86,62,18,87,49,20,68,52,69,70,57,73,55,48,96,89],area:[81,27,91,71,40,8,62,22,3,13,60],scari:[38,34,9,15],length:[26,68,89,80,86,60,18,1,87,8,94,10,11,12,13,14,17],enforc:[68!
 ,75,62,4,
 18,71,73,60,14],outsid:[26,51,55,86,32,27,60,18,35,73,64,36,75,3,14,28,17],scare:22,spilt:71,softwar:[20,34,46,36,38,75,77,8,62,30,22,9,67,56,64,15],scene:[21,14],add_pt:59,spaghetti:[38,15],selectiondagnod:[71,46],owner:[71,22,80,77],nvvm:6,add_pf:59,featurev9:46,sparcgensubtarget:46,licens:[75,81,77,64,55,22],system:[53,27,40,28,29,77,30,75,3,60,32,33,34,88,71,6,38,81,7,43,9,10,13,14,15,44,86,47,18,87,64,65,67,80,20,68,51,52,69,21,35,54,55,22,23,56,74],parse_oper:[12,13],gcse:[64,26,14],termin:[26,75,76,1,2,3,60,5,79,80,6,39,42,8,11,70,46,18,84,87,64,68,90,14,91],f_inlined_into_main:66,llvmgcc:56,returnindex:49,ldrex:73,gotcha:75,endexpr:[13,40,41,42],baseclasslist:25,"12x10":60,arrayref:14,haven:[64,28,75],datatyp:[38,21,71,15,14,18],steen:35,bother:[13,40],arg_end:14,bitvalu:57,stricter:73,xxxregisterinfo:46,getzextvalu:14,viewer:75,op_end:14,var_arg_function_typ:17,clearli:[22,75],optimis:10,mdstring:[2,87],"0x00002200":87,disassembl:[20,32,76,21,71,58,30,31,23,24,97,6!
 0],tramp1
 :60,accuraci:[26,60],at_typ:87,foldingsetimpl:20,nontempor:60,type_of:[10,11,12,13,17],courtesi:22,griddim:6,poison4:60,poison3:60,poison2:60,zec12:21,incfil:56,setloadextact:46,ffi_include_dir:52,segment:[32,71,72,87],placement:[26,75,44,56],stronger:[60,14],parsevarexpr:40,face:[64,3,75,72],isbranch:68,brew:14,vaarg:21,linkonc:[20,6,60,19,94,14],fact:[75,60,34,80,35,36,81,40,41,43,9,10,12,13,14,85,86,18,64,20,68,51,91,71,22,23,25],dbn:20,borderlin:75,truedest:60,dbg:[26,60,87,70],module_code_deplib:94,rough:[25,73,86],trivial:[26,75,3,60,33,34,35,48,38,81,40,43,9,10,13,14,15,16,46,86,18,87,64,71,73],redirect:[8,95,77],isstor:71,getelementptr:[34,86,6,62,4,35,9,60,31,71,14,81],hash_data_count:87,should:[26,53,57,27,40,28,1,75,29,77,30,2,59,3,60,61,32,33,85,71,6,36,95,38,81,7,42,43,8,10,11,48,13,14,15,16,17,46,86,62,74,18,84,87,64,96,65,49,67,80,20,68,89,70,21,35,73,54,55,22,44,94,91,23,56,24,97,25],jan:80,suppos:[71,52,85,91,57,64,23,3,60],create_funct:[10,11,12,13],oprean!
 d:14,nonz
 ero:[68,94],hope:[54,62,22,75],meant:[25,20,27,14,84,30,32,56,89,60],insight:60,familiar:[20,85,6,38,71,42,64,56,11,15],memcpi:[26,60,73,35],autom:[20,71,69,44],smash:60,symtab:14,machineconstantpool:71,reid:3,dw_ate_sign:87,stuff:[68,75,18,71,40,42,43,64,89,10,11,13,14,28,81],booltmp:[36,40,41,42,43,10,11,12,13,17],inlni:66,type_code_arrai:94,unimport:27,frame:[61,26,34,46,62,60,65,71,72,87,51,9,91,66,14],packet:[96,71,97],temporarili:[56,70],binary_nam:66,polymorph:14,wire:81,op_iter:14,fakesourc:56,compute_factori:82,verilog:21,live_iter:62,sectionmemorymanag:61,unrecurs:[13,40],email:[20,34,69,32,73,22,9,44],superword:[51,0],dislik:22,linkonceanylinkag:14,memri:[71,46],endl:75,use_iter:14,doxygen:[20,75,32,36,30,56,14,17],scalaropt:83,valgrind:[8,95,1,53],sdtc:46,etc:[26,75,27,28,77,30,3,60,32,33,34,35,36,4,38,81,40,41,42,43,9,10,11,12,13,14,15,16,17,46,86,62,48,87,64,49,20,68,52,71,73,54,22,94,95,56,74],cindex:46,vk_basicblock:75,preheader_bb:[11,12],position_at_end:[1!
 0,11,12,1
 3,17],exprprec:[36,48,40,41,42,43],indici:94,distil:8,bininteg:25,rpcc:60,llvm_external_:52,triniti:88,insuffici:[3,60,29,46,87],va_arg:60,immedi:[26,75,73,60,61,34,80,6,81,40,43,9,10,13,14,46,64,68,69,71,35,94,24],hex16:57,image_sym_type_char:92,togeth:[26,75,0,28,4,60,34,80,35,36,95,38,41,42,8,9,11,12,14,15,16,17,62,18,84,87,64,93,68,90,70,71,22,48,23],allocationinst:14,rbx:[68,71],dataflow:[40,13,60],cvt:6,reloc_absolute_dword:[75,46],rbp:[68,71],cvf:77,cbw:71,objmakefil:56,auxiliarydata:92,apfloat:[36,21,40,41,42,43,17],site:[26,35,62,14,21,1,8,30,91,60],uglygep:86,archiv:[20,80,32,21,58,55,22,23,56,93,74,44],mybuilddir:52,incom:[46,60,71,40,42,22,11,12,13,14],surprisingli:[10,20,48,16,43],greater:[20,46,6,62,71,2,94,31,86,60],mutat:[26,75,62,40,41,12,13,14],referenti:26,basicblocklisttyp:14,lex_com:[10,11,12,13,15,16,17],dan:57,phi:[26,0,71,40,41,42,94,31,11,12,13,60],sadd:60,expans:[71,25,46,49],upon:[61,81,46,62,14,84,87,56,60,44],foldmemoryoperand:[71,46],expand:[33!
 ,57,46,4,
 31,68,97,75,49,56,50,71,60,81],off:[75,60,34,80,6,36,38,40,41,42,43,8,9,10,11,12,13,14,15,17,68,52,70,71,54,22],symbol2:19,argnam:[36,48,18,40,41,42,43],exampl:[26,53,91,0,27,40,28,1,75,29,30,2,48,59,3,82,60,81,33,34,71,6,36,4,38,39,7,41,42,43,8,9,10,11,12,13,14,15,16,17,83,46,86,62,85,18,84,87,64,96,19,49,66,20,68,51,52,69,70,35,73,57,54,55,22,44,94,95,23,56,24,89,74],command:[53,0,27,71,28,1,58,77,30,75,31,82,60,32,5,79,80,6,36,4,38,81,40,41,42,43,8,76,10,11,12,13,14,15,16,17,46,48,18,84,64,96,65,49,67,50,20,68,52,69,90,70,21,35,72,55,93,44,95,23,56,97,74],svnup:20,filesystem:[1,7],outputfilenam:18,newest:19,paus:[62,35],xec:92,glue:81,web:[21,22,69],zenterpris:21,drawback:[18,22,14],exempt:75,target_opt:20,nvt:46,globalopt:[64,26],indvar:[64,60,14,26],piec:[53,77,75,36,48,38,40,41,42,8,11,12,13,70,15,16,17,86,87,20,68,71,22,94,23],core2:8,five:[91,18,71,14],release_16:20,addsdrr:68,xe8:92,recurr:26,desc:[64,18,46],resid:[6,62,87,64,94,60],emmc:29,type_code_vector:94,isus!
 :71,objec
 tbuff:61,byteswap:33,resiz:75,"0x29273623":87,captur:[60,33,34,36,4,40,41,42,43,8,9,10,11,12,13,70,16,17,18,87,71,94,48],main_loop:[10,11,12,13,16,17],build_exampl:56,i64:[46,86,4,71,87,6,60],emitglobaladdress:46,flush:[61,75,6,29,10,11,12,13,16,17],guarante:[20,34,71,86,26,62,60,18,35,40,73,87,64,22,9,91,56,13,14,81],transport:21,"__syncthread":6,avoid:[75,27,29,3,60,46,35,40,8,13,70,85,86,62,87,64,20,68,14,21,71,22,94,74],image_sym_class_fil:92,mnemon:[71,46],arg_siz:[36,40,41,42,43,62,14],barlist:75,stage:[32,46,6,27,95,18,71,77,48,74,16],"0x4200":87,c_str:[6,36,48,18,40,41,42,43,14,38],lld:52,nullari:[48,16],uniquevector:14,chrome:21,getbitwidth:14,handleextern:[36,48,40,41,42,43],dw_tag_base_typ:87,insidebundl:71,retcc_x86_32:46,waterfal:96,mere:[26,86,36,30,60,17],merg:[26,0,27,77,60,35,36,4,40,41,42,43,10,11,12,13,14,16,17,87,71,22,48,74],behind:[32,71,6,4,21,53,87,64,75,49,59,14],relpo:80,valuesuffix:25,multidef:68,textfileread:75,p4i8:6,mandel:[12,41],llvm_include_!
 exampl:52
 ,mdnode:[2,60,87],"function":[26,53,0,71,1,58,75,31,59,3,82,60,81,61,5,34,80,6,36,4,38,39,40,41,42,43,9,10,11,12,13,14,15,16,17,63,46,86,62,85,18,84,33,87,64,93,49,66,20,51,52,70,21,35,72,73,57,54,55,48,94,91,23,56,24,74],namedvalu:[36,40,41,42,43],documentlist:57,getenv:3,dw_at_entry_pc:87,count:[26,33,80,46,0,62,4,18,35,87,70,8,91,48,60,49,14,28,16],inst_cal:94,data16bitsdirect:46,lookup_funct:[10,11,12,13,17],evidenc:86,localexec:[60,94],otherwis:[26,57,40,1,29,4,78,31,60,5,79,36,95,38,39,7,41,42,43,76,10,11,12,13,14,15,16,17,83,63,47,74,18,84,87,64,65,67,50,68,51,90,70,53,73,48,94,91,56,97,25],problem:[26,71,40,77,30,75,3,4,32,34,35,36,95,81,7,41,42,8,9,11,12,13,14,17,86,62,18,84,87,64,20,70,53,54,22],"int":[57,0,71,4,30,75,59,82,60,34,6,36,95,38,81,40,41,42,43,9,10,11,12,13,14,16,17,46,86,62,74,18,87,66,20,68,70,35,92,73,55,48,89,25],rightli:56,ini:23,inf:[67,18,65,60,87],ing:[26,75,36,40,43,10,13,17],inc:[59,56,71,64,46],bzip2:[20,56],nonetheless:60,optsiz:[60,94],lib!
 cxx:27,lo
 okup:[20,34,46,36,60,41,87,75,9,12,13,14,17],varieti:[26,75,29,34,88,80,35,36,41,42,43,9,10,11,12,14,17,62,87,20,51,91,21,71,73,94,23,25],getopt:18,liblzma:7,computearea:85,aliasresult:35,repeat:[26,27,70,87,91,24,60],defaultlib:30,emitsymbolattribut:71,in0:60,in1:[71,60],in2:71,eof:[36,48,38,40,41,42,43],header_data:87,cumemfre:6,dumpabl:64,rabfik:80,configmaxtest:14,hashes_count:87,sm_20:[71,6],sm_21:71,untrust:22,child:[12,41,85],rapid:22,"const":[33,57,85,46,35,36,14,18,6,40,41,42,43,64,62,74,48,75,71,60,87],lsda:91,r8b:68,r8d:68,deviat:[71,75],binoppreced:[36,48,40,41,42,43],thefunct:[36,40,41,42,43],r8w:68,rowfield:59,printnextinstruct:14,getpar:[40,14,41,42],type_code_numentri:94,llvm_enable_ffi:52,cmd:69,upload:69,reg:[68,46,6,71,24,4],red:[20,60,87],add_rr:68,add_char:[10,11,12,13,15,16,17],externally_initi:60,callcount:14,cmp:[60,71,14,26],abil:[26,33,84,38,62,71,18,57,40,41,42,82,24,11,12,13,15,44,87],hork:68,mcstreamer:[62,71],consequ:[20,35,14,70,8,91,56,60],il!
 ist:14,im
 age_scn_mem_shar:92,llvmbuild:[23,32,47],scalarenumerationtrait:57,disk:[75,60,1,87,23,3,74],runfunctionasmain:82,loop_bb:[11,12,13],flaghollow:57,topolog:4,told:75,ontwo:60,copysign:60,somefunc:[75,14],x86mmx:60,mcoperand:71,pred_end:14,myregisteralloc:64,optzn:[53,40,41,42,43,10,11,12,13],"0f7f800000":6,aka:[35,36,60,38,71,40,41,42,43,48,10,11,12,13,14,15,16,17],werror:55,idnam:[36,48,40,41,42,43],instr:[62,68,71,97],releas:[75,27,77,60,32,36,81,14,44,83,46,64,49,20,52,21,71,73,54,55,22,56,74],setgc:62,sspstrong:60,ftoi:46,total:[14,28,72,73,87,64,94,31,60],bra:6,highli:[62,14,71,40,13,60,44],bookkeep:[26,14],plot:[12,41],postincr:75,foster:[3,22],greedi:[71,18,65],simplifycfg:[26,13,40,81,95],setreg:71,iscommut:68,llvm_enable_p:52,numberofauxsymbol:92,lto_module_is_object_file_in_memori:74,word:[75,85,46,36,14,18,71,87,62,94,91,60,81,17],insignific:[39,60],err:[64,14,6],restor:[46,72,71,40,41,42,94,91,11,12,13,60],next_prec:[10,11,12,13,16,17],work:[26,57,40,28,1,77,30,7!
 5,31,85,3
 ,60,61,32,33,34,88,71,35,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,46,47,62,48,18,87,64,96,65,86,20,68,51,52,69,70,21,53,72,73,55,22,44,95,23,56,74],wors:71,viewcfgonli:[14,42],unnam:[25,18,60,26],"16gb":96,novic:52,lexer:[45,33,34,36,48,38,40,41,42,43,9,10,11,12,13,15,16,17],autodetect:[67,65],u64:6,indic:[26,75,0,28,1,2,31,85,60,32,80,35,36,48,42,8,11,14,16,17,46,86,62,18,87,64,19,49,68,52,91,71,22,94,23,56,25],llvmcore:[27,44],liter:[75,60,80,36,48,38,40,41,42,43,10,11,12,13,14,15,16,17,18,94,24,25],unavail:[73,46],constantstruct:14,createinstructioncombiningpass:[40,41,42,43],str2:68,ordinari:60,sever:[26,75,27,28,1,31,3,60,32,33,34,80,35,36,81,42,8,9,11,14,44,17,46,62,18,87,64,49,20,68,52,90,70,71,94,91,56,74],verifi:[26,58,77,31,60,36,4,81,40,41,42,43,11,12,13,70,44,17,47,84,87,64,22,94,56,89],bindir:[56,83],arcp:60,superreg:46,rebas:20,lad:18,chines:20,after:[26,57,91,40,28,29,77,75,85,3,48,60,61,34,71,6,36,4,81,7,41,42,43,8,9,76,10,11,12,13,14,16,17,46,86,62!
 ,74,18,84
 ,87,64,67,80,20,68,52,70,21,35,73,22,44,94,95,96,56,24,89,25],hex32:57,lab:[96,32],law:75,arch:[20,80,27,77,65,66,67],demonstr:[46,36,14,43,10,60,17],sparccallingconv:46,domin:[26,20,62,14,40,64,13,60],opaqu:[60,14,94,26],lto_module_dispos:74,recompil:[11,21,42,35],icmpinst:14,green:87,buildslav:96,noitinerari:[68,46],order:[26,71,28,1,30,75,59,3,82,60,81,33,85,35,36,4,38,39,40,42,43,8,10,11,13,14,15,16,17,46,47,62,18,84,87,64,93,86,20,68,91,57,73,22,44,94,48,23,56,74],movhpd:4,hex64:57,diagnos:[64,39],use_camlp4:[10,11,12,13,16,17],offici:[88,27,71,40,36,22,13],opnod:46,type_code_opaqu:94,pascal:60,noimm:68,getnexttoken:[36,48,40,41,42,43],flexibl:[64,68,71,85,4,18,1,41,58,8,60,23,12,14],bytecod:[20,21,94],llvm_root:52,setoperationact:[71,46],induct:[26,20,36,0,40,35,42,64,11,13,17],them:[26,57,27,40,28,30,75,59,3,48,60,32,34,71,6,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,46,86,62,85,18,87,64,93,49,80,20,68,90,70,21,35,72,73,54,22,44,94,95,23,56,24,74],thei:[26,71,!
 91,0,27,2
 8,1,29,77,75,31,59,3,60,32,34,80,35,36,4,39,40,42,43,8,9,10,11,48,13,14,81,16,17,46,86,62,85,18,84,87,64,93,67,20,68,51,70,21,57,73,22,44,94,95,23,56,24],fragment:[25,68,47,62,14,28,71,87,60],safe:[20,34,71,86,26,62,60,18,35,73,70,51,9,94,95,13,14,53],printccoperand:46,denorm:57,"break":[26,75,77,2,60,33,36,48,38,40,41,42,43,11,12,14,15,16,46,62,18,64,49,91,71,54,22,24],bang:25,selti:60,lifelong:32,stdarg:60,"__cxa_rethrow":91,sequentialtyp:14,monolith:[22,72],"0x000003cd":87,overflow:[60,86],const_op_iter:14,network:21,visiticmpinst:70,lib64:52,image_file_relocs_strip:92,multilin:1,srcmakefil:56,log2:[60,0],barrier:[62,21,60,73,6],multilib:7,standard:[26,71,0,76,1,30,75,31,3,60,32,5,34,79,80,6,36,4,38,81,40,41,42,43,8,9,88,10,11,12,13,14,15,16,17,63,46,62,48,18,84,87,64,65,66,67,50,93,20,68,90,91,35,73,22,94,95,56,97,74],fixm:[20,46],debuglev:18,mvt:[71,46],angl:57,zerodirect:46,regress:[20,33,75,27,70,21,1,77,8,22,56,4,28,44],gcregistri:62,subtl:[34,86,48,42,43,9,10,11,16!
 ],render:
 [60,12,71,14,41],refin:[71,35],subreg:46,lto_code_gen_t:74,i48:60,setcondcodeact:46,llvm_build_32_bit:52,"0x00000000016677e0":82,ispredic:68,purposefulli:8,type_code_struct:94,image_file_bytes_reversed_hi:92,isalpha:[36,48,38,40,41,42,43],baseclasslistn:25,john:75,"40th":[38,15],headerdata:87,getdatasect:62,inexact:60,tee:70,registerpasspars:64,gcmetadataprinterregistri:62,analyzebranch:46,hashdata:87,tokvarnam:25,provid:[26,57,71,28,1,75,29,30,2,31,85,3,82,60,61,32,34,80,6,36,95,86,40,41,42,43,9,10,13,14,16,17,46,47,62,18,84,87,64,96,20,68,51,52,91,21,35,73,22,44,94,48,23,56,24,74],cppflag:[36,40,41,42,43,56,44],minut:20,uint64_t:[57,14,49],hassse2:68,hassse3:68,emitfunctionstub:46,contenti:75,consumeaft:18,manner:[20,46,86,14,71,73,91,60],strength:[32,71,26,14,18,38,73,60,15],recreat:[20,57],laden:[34,9],latter:[48,71,46,16,73],"0x400528":66,postcal:62,transmit:60,smul_lohi:71,usernam:[20,22],cumodul:6,llvm_definit:52,lexic:[68,81,60,71,87,43,48,10,25,16],phase:[46,0,27,1!
 4,71,41,7
 7,62,65,74,48,95,12,60,16],retcc_sparc32:46,enable_if_c:85,valuerequir:18,instritinclass:68,bracket:[23,91,57,60,87],notion:[85,71,87,42,43,64,22,10,11,60],uitofp:[36,40,42,11,13,60,17],confront:86,md_prof:2,opposit:[56,51,80,57],freeform:18,overload:[33,85,46,6,14,41,64,56,12,60],buildbot:[8,32,1,96,77],op0:94,involv:[26,33,57,71,46,35,14,21,56,40,73,42,77,48,11,59,3,86,13,60,16],just:[26,57,27,40,28,1,30,75,31,85,3,60,81,34,71,35,36,4,38,39,7,41,42,43,8,9,10,11,12,13,14,15,16,17,46,86,18,63,87,64,93,67,80,20,68,69,70,21,53,72,73,55,22,44,94,48,23,56,89],the_funct:[10,11,12,13,17],"41m":18,sroa:51,baseopcod:[59,46],latenc:[67,71,60],callbackvh:14,instlisttyp:14,xxxgeninstrinfo:46,predecessor:[26,60,71,42,11,14],showdebug:82,likewis:[62,20,60],tag_memb:87,dw_tag_compile_unit:87,llvm_include_tool:52,consecut:[25,0,4,87,64,60],lit_arg:8,fomit:71,emb:[60,21,34,9,94],cleanli:[64,22,60,77],st_uid:80,cudevicegetcount:6,commandlin:[32,18],memorywithorigin:52,chapuni:32,dw_ate_floa!
 t:87,misc
 ompil:[20,53,70,81,95],eatomtypedieoffset:87,awar:[75,85,35,4,18,71,73,87,22,23,86,14],sphinxquickstarttempl:[20,89],unordered_set:14,awai:[64,26,75,85,4,38,87,8,74,14,15],getiniti:14,accord:[52,85,46,27,14,18,77,62,94,60],unsett:64,tst_code_entri:94,featurevi:46,preprocessor:[34,46,18,81,43,9,10,56],isjumptableindex:46,memorybuff:75,cov:[78,58],ill:80,xmm0:[8,68,4],xmm1:68,calltmp:[36,40,41,42,43,10,11,12,13,17],ilp:0,llvm_deleted_funct:75,themself:22,com:[20,22,14,69,45],col:26,con:25,testcleanup:60,widen:[71,0],solari:20,resultti:60,excess:[67,65,14],getbasicblocklist:[40,14,41,42],push_back:[75,46,36,48,57,40,41,42,43,14],mclabel:71,wider:[33,73,86],guid:[26,27,28,58,77,30,60,32,88,6,48,8,14,44,45,46,86,18,87,20,69,70,73,22,16,23,56],goodby:89,speak:[11,12,41,42],degener:[26,13,40],"__builtin_expect":2,"__nvvm_reflect":6,debug_info:87,subscrib:22,mallocbench:28,compatible_class:71,hoist:[60,35,14,73,26],unclutt:3,binaryoper:[75,14],inhibit:60,ident:[26,75,80,35,62,14,71!
 ,40,87,42
 ,43,60,10,11,12,13,4,15,16,17],aix:[20,71,88],gnu:[64,20,68,52,80,46,91,21,71,29,8,55,93,96,56,60,44],properti:[26,68,34,46,35,62,60,18,71,40,87,64,59,30,9,94,23,13,14],aim:[75,70,21,22,95,3,60],scalarrepl:[26,13,40,73],pairwis:35,publicli:[14,87],aid:62,keytyp:87,opt:[26,53,0,28,58,30,75,6,95,81,40,42,43,8,10,11,13,14,18,84,64,20,70,35,22,56],printabl:[60,80,46],conv:81,theexecutionengin:[40,41,42,43],extractloop:26,cond:[46,81,40,41,42,11,12,13,60],int_of_float:[12,13],dw_tag_lexical_block:87,dumper:60,dw_tag_enumer:87,old_val:[11,12,13],descent:[48,38,41,12,15,16],incorrectli:[36,38,17],parserclass:18,descend:60,addintervalsforspil:71,fragil:[8,4],code_own:22,hand:[26,71,27,75,3,34,85,36,48,38,41,43,9,10,12,14,15,16,17,46,86,62,84,49,68,52,57,73],fuse:[26,60,67],use_llvm_scalar_opt:[10,11,12,13],operandv:[40,41],kept:[64,22,51,35],scenario:[8,70,81,14,73],incorpor:[52,71,14],thu:[26,71,60,35,36,48,81,41,42,43,8,10,11,12,13,70,16,17,62,18,87,64,69,14,53,22,94,91,56],hypot!
 het:[64,7
 1,14],client:[75,61,32,46,35,40,43,10,13,14,85,47,62,18,87,64,21,71,22,94,23,24],thi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,95,38,39,40,41,42,43,44,46,47,49,50,51,52,53,54,55,56,57,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,93,94,48,96,97],gettok:[36,48,38,40,41,42,43],clenumvaln:18,destsharedlib:56,lc0:60,mandelbrot:[41,12,15,38],stack_loc:71,ifdef:[3,18,34,9],sparctargetasminfo:46,opencl:[21,6],spread:26,board:[7,29],parse_primari:[10,11,12,13,16,17],relwithdebinfo:52,mayb:[33,34,9,68],stringwithspecialstr:87,fusion:60,fsin:[65,46],xdata:19,mip:[20,88,46,21,71,7,73,87],ppc32:71,irbuilder_8h:[36,17],sectnam:18,entry_block:13,bucket_count:87,bpl:68,image_file_machine_ebc:92,openfil:75,negat:[12,41,94],percentag:31,cfrac:28,bork:[18,68],flatten:[71,60,0],bore:64,pos2:18,pos1:18,getmodulematchqu:46,colloqui:60,fpic:52,loadregfromaddr:46,mandleconverg:[12,41],!
 dopartial
 redundancyelimin:18,"754r":21,wunus:75,trunk:[20,32,28,71,87,77,8,30,22,44],peek:[10,11,12,13,16,17],plu:[46,62,60,42,22,48,94,91,11,14,16],aggress:[26,51,20,62,48,0,35,42,87,75,11,71,60,16],memdep:[26,35],someclass:25,pose:[62,51],confer:[62,71],fastmath:6,repositori:[20,81,69,32,91,53,7,87,8,22],post:[26,32,71,22,67,60,44],obj:[83,27,28,62,30,65,60],literatur:71,image_scn_align_4byt:92,canonic:[14,71,4,26],s64:6,looppass:64,nctaid:6,xyz:[59,67,65],"float":[71,0,29,60,33,6,36,48,38,7,42,43,10,11,12,13,14,15,16,17,46,86,18,87,65,19,67,68,57,94],profession:22,bound:[68,46,6,62,14,57,87,86,60],unittestnametest:52,opportun:[26,46,0,43,10,60],accordingli:[59,62,14],wai:[26,53,91,0,27,40,28,77,30,75,85,82,60,34,71,6,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,46,86,62,48,18,87,64,49,66,80,20,68,70,21,35,73,57,22,44,94,95,23,56],copycost:46,callexprast:[36,48,40,41,42,43],type_code_half:94,lowest:[75,36,48,40,41,42,43,73,10,11,12,13,60,16,17],asmwriternum:97,raw_ostream:[64!
 ,71,57,75
 ],maxim:[67,38,15,94],argpromot:[26,35],"true":[26,57,71,75,2,59,60,85,6,95,7,42,8,10,11,12,13,14,17,46,86,62,18,87,64,66,67,20,35,73,55,25],reset:[68,94],absent:14,optimizationbit:18,legalizeop:33,returnaddress:60,maximum:[52,35,14,18,71,31,60],anew:87,absenc:[71,70],llvm_gc_root_chain:62,emit:[26,71,58,78,30,59,60,61,34,6,36,4,81,40,41,42,82,9,11,12,13,70,16,17,46,86,62,18,87,64,65,67,20,68,51,53,73,94,48,97,74],alongsid:94,wcover:75,hardcod:[59,46],noinlin:[82,60,94,49],xxxjitinfo:46,postscript:26,valuelist:25,encrypt:22,xxxbranchselector:46,test:[26,57,27,40,28,1,29,58,77,30,60,32,5,71,35,4,81,7,42,43,8,37,10,11,13,14,44,85,47,91,18,33,87,64,65,50,20,52,69,70,21,53,55,22,95,23,56,97],shrink:71,realiti:77,xxxtargetasminfo:46,fpreg:46,"2acr96qjuqsym":22,add32ri:68,debugflag:[18,14],pathnam:[20,83],set_value_nam:[10,11,12,13,17],libgcc1:7,concept:[20,68,71,85,6,36,60,21,56,87,42,64,75,32,94,11,3,86,14,17],mayload:68,consum:[47,36,43,18,86,40,29,42,41,87,30,48,31,10,11,12,1!
 3,14,24,1
 6,17],dw_tag_inlined_subroutin:87,trigram:21,supplement:88,prereleas:20,middl:[62,75,81,87],zone:60,linker_priv:[60,94],graph:[26,28,60,36,40,41,42,43,10,11,12,13,70,17,46,64,20,68,51,14,71,97],certainli:[62,26,34,9,44],jvm:[34,9],dootherth:75,munger_struct:86,fom:26,brows:[36,17],seemingli:46,dw_apple_property_readonli:87,avx1:8,avx2:8,administr:[96,77],aad8i8:71,gui:[30,75],libthread_db:82,adc64ri8:68,gut:56,sparcinstrformat:46,usescustominsert:68,upper:[75,46,95,87,56,14],isvolatil:60,brave:[48,16],paramattr_code_entri:94,setgraphattr:14,cost:[26,34,46,0,60,71,75,54,74,9,91,59,14],build_fmul:17,after_bb:[11,12,13],gr16:71,appear:[25,39,80,46,20,14,18,1,29,70,35,75,73,26,86,60,81,87],scaffold:[48,16],"23421e":60,constantarrai:14,uniform:[75,14],isoptim:87,va_list:60,image_sym_class_funct:92,defici:[38,15],gener:[26,53,91,0,27,71,28,1,75,58,77,78,30,2,31,85,3,82,60,61,32,33,34,80,6,36,4,38,81,40,41,42,43,8,48,9,37,10,11,12,13,14,15,16,17,45,46,86,62,74,18,84,87,89,64,65,19!
 ,67,20,68
 ,51,52,69,70,21,35,72,73,57,22,44,94,95,23,56,24,97,25],inputcont:57,satisfi:[35,40,73,77,22,3,13],vice:[8,14,73],roots_end:62,precursor:22,plotter:[12,41],image_sym_class_argu:92,mach_universal_binari:66,behav:[91,75,53,60,35],myvar:86,triag:71,succ_end:14,extra:[26,68,75,52,86,27,14,18,53,72,2,94,91,60],stingi:14,fbb:46,marker:[60,18,1,14,71],type_code_void:94,llvm_on_xyz:3,regex:[18,4,21,28],prove:[26,28,35],nothrow:73,naddit:18,subvers:[20,81,69,21,53,77,8,30,22,44],live:[26,51,71,20,36,14,35,40,87,53,64,62,30,74,75,13,60,17],stackprotector:60,lgtm:69,"0xl00000000000000004000900000000000":60,cxxabi:20,finit:[71,60],viewcfg:[14,42],geordi:32,iffals:60,logarithm:[14,94],graphic:[12,34,9,41],ibm:88,at_nam:87,canconstantfoldcallto:33,prepar:[61,32,26,27,91,86,7,56,60],focu:[71,74,89,0],cat:[8,20,18,62,66],ctfe:21,can:[26,53,91,0,27,40,28,1,29,77,30,75,31,59,3,82,60,81,61,32,33,34,71,6,36,4,38,39,7,41,42,43,8,48,9,37,76,10,11,12,13,14,15,16,17,83,63,85,46,47,62,74,18,84,87,6!
 4,96,65,4
 9,66,86,93,80,20,68,89,52,69,70,21,35,72,73,57,55,22,44,94,95,23,56,24,97,25],debug_symbol:[54,56],boilerpl:[68,85,62,18,43,10],heart:[56,47],underestim:60,basemulticlasslist:25,chip:[46,6,71,7,29,8,65,67],spu:[20,46],topic:[45,34,52,38,75,9,89,14,15],abort:[26,68,75,60,70],spl:68,occur:[26,71,76,1,75,2,31,3,60,5,79,80,4,81,8,14,44,83,86,62,48,84,64,65,68,51,90,91,53,22,16,94,95,56,97,25],multipl:[26,71,0,28,75,3,60,61,5,80,35,36,4,41,42,43,8,10,11,12,14,16,17,46,86,18,87,64,96,93,19,66,20,68,21,57,73,22,44,94,48,23,25],image_sym_class_regist:92,ge_missing_sigjmp_buf:75,write:[26,57,76,28,30,75,31,3,60,32,5,34,79,80,6,4,38,81,42,43,8,9,10,11,71,14,15,44,45,46,47,62,18,84,87,64,66,86,20,68,89,52,90,35,73,22,97],regioninfo:26,"0x80":80,x86instrss:46,product:[62,60,21,71,41,77,64,22,48,56,12,25,16],multiplicand:60,southern:88,targetmachin:[61,62,71,64,46],cours:[33,34,35,48,18,38,64,9,56,14,15,16],uint:65,drastic:3,lto_codegen_compil:74,breakag:22,voidtyp:14,goal:[71,86,0,62,2!
 1,38,40,8
 9,22,56,23,3,75,13,74,15],autotool:[55,46],copyphysreg:46,getcalledfunct:[62,14],explicit:[75,60,34,6,81,40,41,42,43,9,10,11,12,13,14,85,86,62,18,87,64,51,71,73,22,23],objectimag:61,somewhat:[75,35,14,28,81,41,73,22,48,12,60,16],mapvector:14,ghc:[71,60],thread_loc:[71,60],approx:6,arch_nam:66,approv:[22,77],graphviz:[26,14],localtarget:56,svnrevert:20,cold:60,still:[26,71,0,28,1,30,75,3,60,61,34,81,40,41,42,9,11,12,13,14,85,62,18,87,64,20,70,53,54,55,22,56],ieee:[21,65,60,80],dynam:[26,71,82,60,61,95,81,41,43,10,12,14,44,85,86,62,18,84,87,64,65,67,50,70,21,57,72,93,94],mypass:[64,14],conjunct:[68,47,27,63,56,3,60],precondit:[56,75],getoperand:[75,71,14,46],window:[64,20,75,52,32,60,18,71,41,42,8,30,88,11,96,3,14,21],addreg:71,curli:[8,60,68,14],has_asmprint:23,non:[26,57,91,27,71,1,75,31,59,60,61,5,34,79,80,6,85,4,38,39,40,42,43,8,9,76,10,11,13,14,15,16,83,46,47,62,74,18,84,33,87,64,65,67,86,20,68,52,90,70,21,35,73,55,22,48,94,95,97,25],evok:60,recal:[36,57,42,43,10,17],hal!
 v:33,half
 :[89,60,94,46],superset:[60,80],nop:60,discuss:[32,75,85,46,14,18,87,64,22,48,60,16],mybranch:20,introduct:[26,53,57,27,40,75,29,77,30,2,59,60,61,32,33,71,6,36,48,38,7,41,42,43,10,11,12,13,14,15,16,17,45,46,86,62,18,87,64,96,19,49,20,68,89,52,91,21,35,72,73,55,22,23,56,24,97,25],build_sub:[10,11,12,13,17],drop:[21,60,69],reg1024:71,reg1025:71,reg1026:71,reg1027:71,image_scn_align_1024byt:92,dw_tag_vari:87,add32rr:68,domain:[68,34,46,62,21,71,9],replac:[26,3,60,80,6,40,8,13,14,46,62,18,93,49,20,68,51,52,25,71,73,55,22,91,74],arg2:[38,15],condmovfp:68,releasememori:64,degen:60,backport:7,reallyhidden:18,year:75,operand:[26,33,75,94,46,86,36,14,71,40,41,2,68,60,31,12,13,4,17],rl4:6,happen:[26,57,77,75,60,61,36,4,81,42,43,10,11,14,16,17,86,62,87,64,20,71,73,22,48],rl6:6,rl1:6,rl3:6,rl2:6,shown:[68,81,52,85,46,6,50,14,18,1,41,87,30,12,89,60,28],accomplish:[20,85,26,62,38,22,14,15],space:[71,30,75,59,3,60,61,34,80,6,4,40,43,9,10,13,14,44,46,86,62,87,64,93,20,68,91,21,57,72,94,23]!
 ,oldval:[
 40,41,42],rational:[71,60,86],dw_at_apple_property_readonli:87,ldrr:46,fiddl:[14,89,7],release_31:20,release_30:20,release_33:20,release_32:20,argv:[6,18,87,82,67,70],ldrd:73,mandelconverg:[12,41],argc:[18,82,60,87,6],card:29,care:[20,68,34,52,46,35,4,28,71,40,73,77,64,9,60,3,24,13,14,81],xor16rr:71,couldn:35,adc32rr:68,gcmetadataprint:62,enginebuild:[61,40,41,42,43],unwis:[60,80],adc32ri:68,blind:71,directli:[26,71,58,30,75,31,3,60,80,6,40,41,42,43,10,11,12,13,14,44,83,46,86,62,18,87,64,67,20,52,69,91,21,35,73,22,94,96],subrang:87,rint:[21,60],yourself:[20,33,22,14,68],stringref:[75,57,14,87],size:[26,57,0,71,28,75,31,60,33,34,80,6,36,95,40,41,42,43,8,9,37,13,14,16,46,86,62,18,87,64,93,19,68,70,21,35,72,73,54,94,48,74],sub_ri:68,yypvr:89,silent:[22,60,35],caught:[91,75,60],yin:57,type_block:94,himitsu:20,checker:[53,86],cumul:71,friend:81,editor:[20,22,75,89,56],nummeta:62,ariti:62,especi:[26,22,46,18,81,75,29,73,2,51,3,14,21,44,87],dw_tag_interface_typ:87,apple_nam:87,cpu!
 0:45,llvm
 top:64,mostli:[26,34,52,46,20,18,71,73,42,30,51,9,11],distsubdir:56,quad:[60,46],than:[26,57,27,71,29,75,31,60,32,33,34,80,35,36,48,38,81,40,41,42,43,8,9,10,11,12,13,14,15,16,17,46,86,62,74,18,87,64,96,65,49,20,52,70,53,72,73,22,44,94,91,23,56,24,89,25],image_sym_type_word:92,"0x432ff973cafa8000":60,xcore:[20,71],spisd:46,browser:[32,21,69],loweratom:26,anywher:[68,89,4,40,8,74,44,48,56,13,60,16],delin:1,cc_sparc32:46,bitcast:[26,46,35,62,4,21,86,60],feat_segstacks_x86:71,readcyclecount:60,fldcw:71,mccodeemitt:71,begin:[71,77,30,75,3,60,61,80,35,85,39,40,42,10,11,12,13,14,16,17,46,62,18,87,20,51,57,22,94,25],importantli:[11,75,42,35],toplevel:[10,11,12,13,16,17],cstdlib:48,getpointers:62,renam:[20,75,27,21,40,87,36,56,13,60,44],"_p1":87,"_p3":87,callinst:14,llvm_libdir_suffix:52,add_reassoci:[10,11,12,13],concurr:[32,62,14,21,73,60],image_file_bytes_reversed_lo:92,fifth:[60,46,6],onli:[26,57,0,40,28,1,75,77,30,2,31,59,3,48,60,81,32,33,34,71,6,36,4,38,39,7,41,42,43,8,9,10,11!
 ,12,13,14
 ,15,16,17,86,85,46,47,62,74,18,84,87,64,65,19,67,50,93,80,20,68,51,52,70,21,35,73,22,44,94,91,23,56,97,25],image_rel_i386_dir32nb:19,expr_prec:[10,11,12,13,16,17],endloop:[13,40,41,42],overwritten:[71,60],llvminitializesparctargetinfo:46,cannot:[26,75,77,78,30,3,4,61,34,35,60,9,70,46,86,62,18,63,64,93,19,14,21,71,73,22,95],targetjitinfo:[71,46],mrm6r:46,sonam:21,operandlist:68,intermitt:20,object_addr:62,gettypenam:14,rrinst:68,"0x0000000000d953b3":82,sometest:28,hierarchi:[20,33,53,85,32,36,1,64,14],istreambuf_iter:6,concern:[86,62,14,22,23,60],"1svn":77,brace:[68,75,4,8,60,14],mrminitreg:46,printinstruct:46,foo2:[55,74],between:[26,57,27,28,75,59,3,60,81,61,32,33,6,4,38,39,42,43,10,11,71,14,15,46,86,62,18,87,64,65,20,68,51,69,74,21,35,73,22,94,56,24,25],x86reloc:46,modulelevelpass:64,paramet:[26,75,1,2,60,61,6,36,71,14,17,46,86,62,18,87,64,49,52,91,57,94],constantpoolsect:46,typedef:[75,57,14,87],"__text":71,intregssubclass:46,dw_tag_subrange_typ:87,pertain:[56,22,87,91],!
 inputfile
 nam:18,inconsist:[75,87,86],doesnotaccessmemori:35,qualtyp:75,image_sym_type_struct:92,gr32:[68,71],overview:[75,27,28,30,59,60,61,32,88,6,42,8,11,44,62,18,64,20,91,35,54,94,23,89],my86flag:57,basic_pars:18,exploit:[36,18,21],clarif:[22,88],invert:8,shim:26,valuekind:75,invers:26,uglifi:[10,43],getentryblock:[40,14],kdevelop3:20,derefer:[60,14,87,86],emphas:89,"_global__i_a":81,rubi:62,getjitinfo:[71,46],x86_fastcal:71,thischar:[36,48,38,40,41,42,43],eip:68,module_code_vers:94,global_context:[10,11,12,13,17],retcc_x86_32_c:46,fneg:60,dw_at_artifici:87,suse:20,stdout:[20,92,30,10,11,12,13,60,16,17],metric:[64,77],henc:[20,18,74,25,81],worri:[20,69,48,18,60,16],onlyreadsmemori:35,eras:[36,18,81,40,41,42,73,56,14,87],texinfo:20,bigblock:67,develop:[71,28,29,58,77,78,75,3,32,81,40,8,13,44,45,86,62,18,87,64,96,20,68,52,91,21,53,54,22,23,56,74],proto:[36,48,40,41,42,43,10,11,12,13,16,17],"__nv_powf":6,sizeofimm:46,cc1:82,srcroot:8,epoch:[57,80],komatsu:71,externalstorag:18,docume!
 nt:[26,53
 ,57,27,28,29,58,77,30,75,59,3,60,61,32,33,88,85,6,36,7,43,8,10,71,14,44,46,86,62,74,18,87,64,96,19,20,51,52,70,21,35,73,54,22,94,91,23,56,89,25],finish:[0,27,77,43,60,61,36,40,41,42,82,10,11,12,13,70,16,17,64,91,71,89],ssub:60,preassign:71,someon:[33,34,71,75,22,9,89],removebranch:46,freeli:[22,73],tradition:[71,35],pervas:[14,85],whose:[25,68,75,46,35,93,14,87,71,40,41,70,22,94,48,12,13,60,16],createstor:40,destreg:71,bodi:[26,75,60,36,4,40,41,42,43,10,11,12,13,14,16,17,18,87,64,68,70,72,94,48,25],ccc:[60,7,94],neon:[71,7,29],noaa:26,touch:[26,75,14,87,64,60],tool_verbos:[20,56],speed:[75,18,40,8,22,13],create_modul:[10,11,12,13,17],versu:75,llvm_release_global_lock:14,struct:[34,94,46,0,62,4,18,57,40,87,64,75,9,60,86,13,14],bb0_29:6,bb0_28:6,getx86regnum:46,bb0_26:6,filecheck:[95,21,58,8,50,4],desktop:54,identif:[60,7,25,20],treatment:[62,46],versa:[8,14,73],earli:[75,46,6,40,56,13],imul16rmi8:71,"0x82638293":87,read:[26,53,0,71,78,30,75,31,82,60,81,32,5,34,79,80,6,36,4,3!
 8,39,40,4
 1,42,43,8,9,88,76,10,12,13,14,15,17,63,46,62,74,18,84,33,87,65,66,67,50,20,68,89,70,21,35,73,57,22,94,48,56,97,25],cayman:88,amd:[88,7],googletest:1,detract:75,amp:88,bangoper:25,funcresolv:[84,14],udis86:20,benefit:[26,75,35,62,21,86,87,14,44],lex_numb:[10,11,12,13,15,16,17],output:[26,53,57,27,71,28,1,78,30,75,31,59,60,32,5,79,80,6,4,39,40,41,42,43,8,37,76,10,11,12,13,14,16,46,62,48,18,84,33,87,64,65,66,67,50,20,89,90,70,21,35,92,93,95,56,24,97],libbeauti:21,debug_pubtyp:87,matur:[62,18],initid:94,cmake_install_prefix:[52,30,7],viral:22,globalvalu:14,getregisterinfo:[71,46],extralib:56,blockidx:6,lto_codegen_set_debug_model:74,rauw:[51,14],tdm:96,tok_binari:[40,41],sixth:46,objectbufferstream:61,"throw":[26,91,71,64,3,60],dw_tag_subprogram:87,src:[83,46,27,28,71,77,8,60,44],sra:25,central:[3,87,91],greatli:87,underwai:21,image_sym_class_sect:92,srl:25,numbit:14,chop:87,degre:[96,73,0],dw_tag_subroutine_typ:87,backup:55,processor:[20,52,46,0,62,88,18,71,87,67,56,60,21],val!
 uecol:59,
 bodylist:25,op3val:46,llibnam:18,unregist:64,xxxbegin:14,outloop:[13,40,41,42],yout:57,your:[53,57,27,40,28,29,30,75,85,60,32,33,34,71,6,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,44,46,86,62,18,64,80,20,68,51,52,69,70,35,73,54,55,22,96,56,89],parsebinoprh:[36,48,40,41,42,43],verifyfunct:[36,40,41,42,43],loc:[87,46],log:[35,0,14,28,1,70,60],opengl:[75,34,9],aren:[20,34,86,26,62,60,35,75,42,43,30,22,9,10,71,14],haskel:[14,34,9,60],start:[26,57,0,27,40,28,1,77,30,75,82,60,32,33,34,71,6,36,95,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,46,86,62,18,87,64,96,80,20,68,52,69,70,21,35,22,44,94,48,23,56,89],low:[75,31,3,60,32,33,6,48,40,41,12,13,14,16,46,86,62,18,87,50,68,21,71,94],lot:[26,71,28,29,75,60,33,34,85,36,48,38,81,40,41,43,9,10,12,13,14,15,16,17,46,86,62,18,87,64,49,20,68,70,21,57,73,54,22,56],submiss:22,compute_20:6,satur:[12,41],furthermor:[26,4,86],"default":[26,57,0,40,28,1,75,30,2,85,60,61,5,80,6,36,4,81,7,41,42,43,8,76,10,11,12,71,14,44,17,83,46,62,48,18,33,64,65,!
 19,66,67,
 20,68,52,21,35,54,93,94,95,56,24,97],tok_def:[36,48,38,40,41,42,43],start_bb:[11,12,13],bucket:[26,14,87],v32:6,loadabl:[64,56],scanner:[38,15],decreas:67,opnam:46,producess:20,value_1:23,value_2:23,valid:[26,27,77,60,61,32,6,36,4,81,40,41,42,43,8,10,11,12,13,14,16,17,83,86,18,87,64,65,67,52,21,57,48,25],release_19:20,release_18:20,release_17:20,pre_stor:71,you:[26,53,57,27,40,28,1,29,58,77,30,75,85,3,82,60,32,33,34,71,6,36,4,38,81,7,41,42,43,8,9,76,10,11,12,13,14,15,16,17,46,86,62,48,18,84,87,64,49,66,67,80,20,68,52,69,70,21,35,73,54,55,22,44,94,95,96,56,89,25],release_14:20,release_13:20,release_12:20,release_11:20,poor:[11,75,42],polar:57,registri:[62,64],multidimension:60,binfmt:20,pool:[64,71,94,46,31],reduc:[26,53,27,75,59,60,32,5,80,6,95,43,10,14,86,18,64,68,70,21,71,22],bulk:[71,13,40],ipsccp:26,adc64mr:68,value_n:23,skeleton:20,osx:80,messi:71,month:[32,77],correl:[62,60],"__cxa_end_catch":91,getglob:46,pandaboard:29,paramidx:94,mrmsrcmem:46,getnullvalu:[40,14,41,4!
 2],"_ri":
 68,cpufrequtil:29,sparcinstrinfo:46,articl:[11,13,40,42,20],sdisel:51,gcfunctionmetadata:62,phielimin:71,"_rr":68,mysourc:87,datalayout:[46,6,62,71,40,41,42,43,94,10,11,12,13,60],verb:[56,75],mechan:[61,25,71,94,91,6,36,14,28,0,87,64,55,75,32,62,56,23,3,60,17],veri:[26,71,0,28,29,77,75,60,81,32,34,35,36,4,38,39,40,41,42,43,8,9,10,11,12,13,14,15,16,17,86,62,48,18,87,64,20,68,70,57,73,22,94,91,24],passmanagerbas:46,targetregisterdesc:[71,46],methodbodi:46,eatomtypetag:87,emul:[26,33,71,60,75],managedstat:14,cosin:[60,46],customari:18,dimens:60,fixedt:87,casual:[56,22],kistanova:96,dofin:[64,46],nand:60,fpformat:68,isobjcclass:87,llvmlibspath:56,fp128:[21,60,94],"0x00000100":87,signextimm:71,modular:[23,64,84,75,35],minor:[75,71,77,54,22,9,34],exeext:56,prologu:[62,72,21,60,46],strong:[60,22,4,73,81],modifi:[26,71,28,1,30,75,59,60,33,80,6,85,81,40,13,14,44,46,62,18,87,64,20,70,35,73,22,23,56,24],ignor:[0,31,60,32,35,36,4,38,39,40,41,42,43,8,10,11,12,13,14,15,16,17,46,18,87,20,!
 71,22,94,
 48,23,56,24],trunc:[60,0],divisor:60,ahead:[20,34,48,38,53,75,64,30,22,9,15,16],dform_1:71,xstep:[12,41],amount:[26,75,60,33,38,81,43,10,71,14,15,63,62,18,84,64,65,67,68,70,53,72,91,56],lto_module_create_from_memori:74,module_code_datalayout:94,initializealiasanalysi:35,ask:[27,77,30,32,33,34,35,48,81,40,42,9,11,13,14,16,87,64,20,22,56,25],href:71,famili:[34,60,87,30,9,14],sequencetrait:57,dangl:[11,14],"0x710":66,is64bitmod:46,isimmedi:46,zorg:96,massag:75,formul:3,bash:[3,89],libxml2:7,taken:[26,68,34,80,46,35,27,14,18,71,91,2,9,56,3,60],distfil:56,zork:68,vec:[60,14],build_arch:[56,44],cbtw:71,valuetyp:[71,46],regoffset:24,x01:92,targetcallingconv:46,"0b000111":46,x00:92,x86instrmmx:46,histori:[20,22,69],ninf:60,indirectbr:60,reindent:75,addrspacecast:[21,60],templat:[62,20,68,57,85,46,26,25,60,18,35,87,64,36,75,32,3,89,14,21],vectortyp:14,unreli:35,phrase:75,anoth:[26,57,40,29,30,75,59,3,60,33,34,71,6,36,4,81,7,41,42,43,8,9,10,11,12,13,14,16,46,62,18,84,87,64,19,80,68,5!
 1,21,35,7
 3,22,94,48,23,56,89,74],perhap:[62,60,75,14,35],snippet:[62,52,14],reject:[34,36,60,18,81,40,41,42,43,9,77,10,11,12,13,4,17],rude:91,personlist:57,secondlastopc:46,unlink:[36,14],retcc_x86common:46,"0x00003500":87,lifetim:[62,14,71,87,64,60],machinepassregistri:64,feat_asmpars:71,polit:71,help:[57,27,76,28,1,29,58,78,75,31,3,60,32,33,34,79,35,4,38,81,8,9,14,15,44,83,63,47,62,18,84,5,87,64,96,65,49,67,50,93,20,68,52,69,90,70,21,53,73,22,95,23,56,24,97,74],mbbi:71,soon:[27,48,42,64,22,11,74,16],mrmdestreg:[68,46],held:[22,60],ffi:81,foo4:[55,74],ffc:71,foo1:[55,74],compulation:51,foo3:[55,74],dfpreg:46,complex:[75,0,77,3,60,33,34,48,40,41,43,9,10,12,13,14,16,46,62,87,64,71],eatomtypecuoffset:87,tok_els:[40,41,42],systemz:[20,21,71,88],finer:35,cee:14,image_scn_lnk_info:92,sentenc:75,wideaddr:60,ystep:[12,41],ninja:7,gmon:56,libllvm:[54,21],stopper:27,addenda:88,tear:[91,14],scalarevolut:[26,86,35],fulli:[20,68,34,86,0,48,71,40,41,87,75,9,94,26,67,12,13,60,16],heavi:[56,14],su!
 cc_iter:1
 4,llvm_build_tool:52,longjmp:[91,60,34,9,26],beyond:[89,86,91,24,97,60,14],todo:[26,33,69,27,71,7,68,87,64],ific:18,isunaryop:[40,41],ppcinstrinfo:33,safeti:[60,21,34,9],publish:[27,75,14],debuglevel:18,unreview:22,labf:18,ast:[45,34,36,48,38,40,41,42,43,51,9,10,11,12,13,15,16,17],errorp:[36,48,40,41,42,43],dw_tag_volatile_typ:87,mystruct:86,pub:87,reason:[26,75,7,3,60,33,35,36,48,38,40,42,43,8,10,11,13,14,15,16,17,85,86,18,87,64,68,21,71,72,73,22,23,89],base:[26,53,57,27,40,28,1,75,29,77,2,31,59,3,60,61,32,85,71,6,36,48,81,7,41,42,43,8,10,11,12,13,14,16,17,86,46,47,62,18,87,64,65,50,80,20,68,51,52,70,21,35,22,44,94,91,25],put:[26,57,77,75,60,34,35,4,38,40,42,82,8,9,11,13,14,15,62,18,87,64,70,71,73,89],asi:46,intermodular:[32,74],wglobal:75,asm:[6,91,71,65,94,67,97,60],basi:[38,62,14,18,1,41,31,12,60,15],bring:[34,62,21,75,9,14],launch:6,warpsiz:6,undergo:[26,60],assign:[26,57,75,2,59,60,6,36,38,81,40,13,14,15,17,46,86,18,68,51,71,73,22,94,25],obviou:[26,34,35,70,87,71,75,4!
 1,43,22,9
 ,48,73,10,12,60,81],ultrasparc3:46,islazi:46,isregist:71,uninterest:[38,15],module_block:94,implementor:[10,11,68,42,43],miss:[40,60,28,7,41,70,55,75,48,12,13,14,16],st6:68,st4:68,st5:68,nodetail:31,st7:68,st0:[68,46],st1:[68,71,46],st2:68,st3:68,scheme:[46,62,31,40,49,13,14],schema:[57,1,92,47],adher:[3,22,14],xxxgencodeemitt:46,getter:[14,87],bidirect:14,newabbrevlen:94,numroot:62,intrinsicinst:62,std:[33,53,80,46,6,36,48,18,0,40,41,42,43,75,84,57,14,38,81],grep:[20,52,18,71,29,8,4,28],stl:[20,75,26,57,14,81],sparsebitvector:14,rootmetadata:62,store:[26,71,28,4,61,80,6,60,38,81,40,13,14,15,44,46,86,62,18,87,49,66,20,51,52,91,35,72,73,16,94,48],str:[6,36,14,40,41,42,43,92,48,60],consumpt:[64,71],aliaseeti:60,toward:[60,22,14,32],grei:27,randomli:37,tailcallelim:26,"null":[26,57,46,35,62,60,84,6,75,87,42,64,65,48,67,11,86,14],dllvm_target_arch:7,imagin:21,unintend:26,lib:[30,31,3,82,32,33,36,40,41,42,43,14,44,83,46,62,18,64,50,20,52,71,55,56],lic:26,ourfunctionpass:14,lit:[!
 52,21,1,5
 8,8,30,56,44],"__apple_objc":87,useless:[11,34,9,87,42],mixtur:68,setjmp:[26,34,91,84,9,60],c_ctor_bas:4,maco:[20,81,14],alpha:[20,60,46],mach:[66,88,60,87],isbarri:68,hipe:[71,60],clear:[62,75,86,36,60,84,40,41,42,43,23,22,48,56,10,11,12,13,14,16,17],differ:[26,57,0,27,71,28,77,30,75,31,59,3,60,61,32,33,34,88,85,6,36,4,39,40,41,42,43,8,9,37,10,11,12,13,14,81,17,46,86,62,74,18,87,64,65,19,49,20,68,69,70,21,35,22,94,91,56,25],implicitdef:71,clean:[26,71,20,95,53,77,64,6,56,74,81],latest:[27,20,21,4],test1:[8,89],use_s:14,stackprotectorcheck:60,v16:6,i32imm:[68,46],"3x4":60,get_instrinfo_named_op:46,test5:4,ptrval:60,pretti:[26,28,3,36,48,38,40,41,42,43,10,11,12,13,15,16,17,86,64,49,68,24,89,25],setnam:[36,40,41,42,43,14],less:[26,75,27,1,29,60,34,80,35,36,48,38,81,40,41,42,43,8,9,10,11,12,13,14,15,16,17,62,18,87,20,71,94,89],lastopc:46,adc32ri8:68,createfsub:[36,40,41,42,43],rephras:86,darwin:[8,27,71,60,56],defaultdest:60,prolang:28,parenexpr:[36,48,40,41,42,43,10,11,12,13,!
 16,17],ha
 s_asmpars:23,nativ:[26,57,40,28,30,60,33,34,71,6,36,95,81,7,41,42,43,9,10,11,12,13,14,17,83,46,86,87,65,80,20,52,70,21,53,73,55,23,56,74],same_cont:19,"133700e":[36,17],externalfnconst:26,rejit:[10,43],llvmlibdir:56,image_scn_lnk_oth:92,keystrok:75,kawahito:71,immutablepass:[64,35],ctaid:6,xword:46,close:[26,51,86,32,27,14,47,36,75,48,71,60,16,17],"0x0b17c0de":94,smallvectorhead:14,deriv:[61,26,33,51,80,85,62,25,38,71,75,68,87,64,59,22,23,56,60,15,14],libcmt:30,particip:[60,22,14,56],parse_unari:[12,13],pifft:28,tool_nam:20,isprefix:18,cst_code_integ:94,emitint32:62,end_block:94,makeup:14,fpform:68,numer:[25,46,38,36,60,18,40,41,42,43,30,93,48,10,11,12,13,14,15,16,17],llvmobj:44,isol:[68,75,70,71,40,8,13,14],lowercas:[10,46,43],numel:60,distinguish:[34,62,14,9,3,60],both:[26,71,0,40,1,77,75,85,60,61,34,80,35,36,4,81,7,42,43,8,9,10,11,13,14,16,17,46,86,62,48,18,87,64,20,68,70,57,72,73,54,22,94,91,23,56,25],delimit:[24,60],fancyaa:64,lako:75,debug_typ:14,getnumvirtreg:71,prot!
 ector:[60
 ,87],block_par:[11,12,13],"__objc":60,jeff:3,byval:[71,60,94],header:[26,75,7,28,30,3,60,61,32,80,85,81,40,41,42,11,12,13,14,44,83,46,18,87,66,50,20,52,92,73,94,23,56],instrsch:14,hasdelayslot:68,linux:[20,81,88,82,32,21,71,7,29,43,8,55,56,77,44],llvm_enable_thread:52,stamp:80,territori:20,empti:[75,1,60,36,48,40,41,42,43,11,14,16,17,46,62,18,87,66,68,52,57,56,25],destructor:[75,14,81,64,91,60],newcom:[13,40],sslverifi:20,newinst:14,as_float:[10,11,12,13],box:[71,87,69],lattner:[34,9],imag:[61,21,71,41,93,19,12,60],ada:91,imac:0,coordin:57,modrefv:68,imap:20,look:[26,57,71,1,77,30,75,82,60,32,33,34,85,6,36,4,40,41,42,43,8,9,10,11,12,13,14,16,17,46,86,62,18,87,64,20,68,74,35,72,55,22,44,94,48,23,89,25],fptosi:60,ramif:86,"while":[75,0,27,1,78,59,3,82,60,32,34,35,36,4,38,40,41,42,43,8,9,11,13,14,15,16,86,18,84,87,64,20,68,51,52,70,21,71,54,94,48,56,74],dw_lang_c_plus_plu:87,loos:[56,87],loop:[26,75,0,60,34,35,36,48,38,40,41,42,43,9,10,11,12,13,14,15,16,17,62,64,20,68,51,21,71!
 ,73],pack
 :[27,71,87,36,94,60,17],malloc:[62,14,34,9,64],pragmat:21,readi:[61,38,36,48,18,87,40,41,42,43,64,55,22,77,10,11,12,13,15,16,17],readm:[8,20,22,89],"__gcmap_":62,thesparctarget:46,hideaki:71,"0x00001203":87,quadrat:[71,65,14],type_symtab_block:94,fedora:20,grant:22,tokinteg:25,belong:[60,18,14],llvm_site_config:30,dest:60,octal:[18,68,80],conflict:[20,68,36,60,71,40,41,42,43,8,22,10,11,12,13,14,17],ashr:60,goodwil:22,ccif:46,optim:[26,53,0,71,28,29,58,30,75,59,60,32,33,34,85,6,36,4,38,81,40,41,42,43,8,9,10,11,12,13,14,15,44,17,45,46,86,62,18,84,87,64,96,65,67,20,51,70,21,35,73,54,55,94,95,23,56,74],image_sym_class_type_definit:92,desttool:56,va_copi:60,temporari:[26,51,57,14,28,1,8,56,71,60,81],user:[26,57,0,71,28,1,77,75,31,60,32,34,80,6,36,95,38,40,41,42,43,8,9,10,11,12,13,14,15,16,17,45,46,62,18,87,64,65,20,68,51,52,69,70,21,35,73,89,54,22,48,96,56,24,97,74],function_block:94,"3gb":30,vreg:71,"0x16677e0":82,older:[56,18,24,46,29],mctargetstream:71,pointtoconstantmemori:3!
 5,reclaim
 :[51,60],use_:14,positionaleatsarg:18,basiccg:26,weakest:[71,73],predetermin:35,cout:[57,75,81,6],isunord:73,dw_ate_unsigned_char:87,undeclar:[36,17],tick:80,recurs:[26,34,36,60,38,1,40,41,42,62,9,48,56,11,12,13,14,15,16,17],shortcut:[38,15,16],supersparc:46,codegener:53,gnueabihf:[7,29],march:[20,71,21,53,87,65,67,4],arm_aapcscc:94,mcsectionelf:71,xterm:75,nothidden:18,game:22,optimizationlist:18,characterist:[33,46,14,71,92,60],isproto:94,pcmarker:60,outright:86,success:[53,75,60,36,48,40,41,42,43,10,11,12,13,14,16,17,46,47,64,20,57,22],signal:[8,18,60,73,82],resolv:[61,68,71,36,60,1,42,43,64,22,74,56,10,11,14,17],"______________________________________":14,popular:[71,29,35],fake:67,some:[26,57,0,27,40,28,1,75,29,77,30,2,59,3,60,32,33,34,71,35,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,46,85,62,74,18,87,64,65,49,86,93,80,20,68,51,52,69,70,21,53,72,73,54,22,94,48,23,56,89,25],urgent:22,mnemonicalia:71,getfunctionlist:14,mem_address:71,addpreserv:[64,35],printinline!
 asm:46,sl
 ash:[80,87],castinst:14,bcanalyz:[94,58,31],unreferenc:[56,60],run:[26,53,91,0,27,40,28,1,29,77,30,75,82,60,61,32,34,71,6,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,83,63,46,62,48,18,84,87,64,96,20,68,52,70,21,35,73,54,55,22,44,95,23,56,74],stem:14,sacrif:21,step:[26,57,27,7,28,77,30,59,60,33,71,6,85,40,41,42,11,12,13,14,44,45,46,86,64,20,68,52,70,35,91,96,74],copyvalu:35,curtok:[36,48,40,41,42,43],disttarbz2:56,subtract:[33,60],"_ztid":60,blocksizei:6,idx:[75,86,36,40,41,42,43,60],nnnnnn:71,shini:64,blocksizez:6,f31:46,blocksizex:6,block:[26,71,0,27,75,2,31,60,6,36,4,39,40,41,42,43,10,11,12,13,14,16,17,46,47,62,63,87,64,67,68,51,91,35,72,22,94,48,89],use_llvm:[10,11,12,13,17],gcroot:[62,60],aq2:60,within:[26,57,71,28,1,75,60,6,4,81,40,41,42,43,10,11,12,13,14,44,85,86,62,84,87,68,51,70,35,94,91,56],loadsdnod:14,proj_install_root:44,ensur:[26,75,73,31,4,6,36,60,81,40,41,8,13,14,17,83,46,18,84,64,77,20,91,21,71,35,22,94,56],properli:[20,71,32,14,18,35,40,73,43,8,70,23,!
 75,13,60,
 28],pwd:7,vfprintf:60,newer:[20,82],cmpxchg:[60,73],specialti:14,info:[26,71,28,1,82,60,34,95,38,40,41,42,43,9,10,11,12,13,14,15,46,62,84,87,64,66,20,68,52,91,57,94,97,74],inreg:[71,60,94,46],"0xc3":68,i65:60,abs_fp64:68,similar:[26,71,0,29,75,3,60,80,6,36,4,38,41,42,43,8,10,11,12,14,15,44,17,83,46,86,62,18,64,68,91,57,73,22,94],createdefaultmypass:64,obviat:44,reflectparam:6,doesn:[26,71,1,75,77,2,3,60,34,80,35,36,4,38,81,40,41,42,43,8,9,10,11,12,13,14,15,16,17,85,86,62,48,18,64,68,70,53,73,55,22,91],repres:[26,71,1,75,2,60,33,80,6,36,48,81,40,41,42,43,10,11,12,13,14,16,17,46,86,18,87,49,68,91,35,73,94,25],arg_iter:[36,40,41,42,43,14],nextvari:[41,42],minsiz:60,titl:[22,69],speccpu2006:28,nan:[67,65,60,87],setenv:56,"0x00007fff":71,dosometh:75,resign:22,xtemp:73,drag:69,eval:[26,35],parseenvironmentopt:18,canfoldasload:68,source_x86_64:66,typeid:[91,33,94],infrequ:64,addmbb:71,orbit:[12,41],devminor:6,depth:[26,18,71,87,42,55,11],loadobject:61,unconnect:86,intervalmap:14,m!
 sbuild:52
 ,getkind:85,image_scn_mem_preload:92,compact:[34,62,71,9,31,14],friendli:[32,24,16,48],unsimm:71,breakcriticaledg:64,aris:[22,14,86],instr_iter:71,yoyodyn:22,then_bb:[11,12,13],roots_siz:62,runnabl:20,nonatom:87,llvmdisasminstruct:24,weakvh:14,use_llvm_target:[10,11,12,13],dw_tag_const_typ:87,ccifnest:46,relink:[83,70],thunderbird:22,calleef:[36,40,41,42,43],jump:[26,71,46,18,53,42,94,56,11,60,44],imper:[75,62,40,42,11,13],download:[20,52,46,32,27,21,7,77,8,55,96,56,14,44],click:[30,69],hasoneus:75,poke:94,intregsregisterclass:46,espresso:28,cell:46,experiment:[78,21,33],registerschedul:64,ramsei:71,init_v:13,legalizeact:46,becom:[64,26,68,75,85,46,0,60,18,71,40,29,42,8,48,56,11,86,13,14,16],accessor:[64,48,71,87],"_source_dir":52,startexpr:[13,40,41,42],convert:[26,71,76,1,58,60,33,34,6,36,38,40,41,42,43,9,10,11,12,13,14,15,17,46,86,18,64,49,66,20,68,21,57,92,73],convers:[68,57,46,6,14,18,0,60],vbr:[80,94,31],solaris2:64,chang:[26,57,27,71,28,1,75,77,30,2,60,61,32,33,79,85!
 ,6,36,4,3
 9,40,41,42,43,10,11,12,13,14,81,44,17,83,46,47,62,18,87,64,96,49,86,20,68,51,52,69,70,21,35,73,54,22,94,95,23,56,74],hexagon:[20,71],add_definit:52,chanc:[61,68,2,38,57,22,15],danger:[14,4,60],revok:22,realloc:35,dyn_cast:[32,75,46,85,62,14],"boolean":[26,68,75,52,46,18,71,42,65,94,23,11,60],makefileconfigin:56,implic:[71,22],recordid:94,fibi:[13,40],llvm_stop_multithread:14,remaind:[20,33,46,91,71,8,23,60],llvm_enable_warn:52,"0x00ff0000":71,numelt:94,benchmark:[20,0,27,28,87,8,22,14,44],landingpad:[91,60],nvptx:[32,71,88,6],findlead:14,retriev:[61,80,6,18,57,64,14],image_scn_gprel:92,perceiv:[34,9],memory_order_acq_rel:[60,73],linearscan:[64,67,71],meet:[64,71,22,44],control:[26,75,0,1,30,60,61,33,34,6,36,48,38,39,40,41,42,43,9,10,11,12,13,14,15,16,17,45,46,18,87,64,65,67,20,52,70,21,71,72,22,91,56,74],malform:[26,70],sudo:[20,29],llvm_use_intel_jitev:52,compactli:68,myfooflag:57,tarbal:[32,77,7,56],emitepilogu:46,egrep:20,addpreemitpass:46,dissolv:56,tag_base_typ:87,temp!
 lateargli
 st:25,lto_module_is_object_fil:74,live_s:62,eliminatecallframepseudoinstr:46,aliasanalysiscount:35,targetdata:26,"0x3feaed548f090ce":43,filterclass:59,zext:[60,49],subtyp:46,primaryexpr:[48,16],creation:[61,46,62,14,77,49,60],jne:71,onzero:60,distzip:56,outer:[57,40,42,64,11,13,60],consensu:22,pushfl:71,topdistdir:56,release_15:20,dw_tag_auto_vari:87,label_branch_weight:2,handl:[26,71,0,3,60,32,34,85,6,36,48,38,40,41,42,43,9,11,12,13,14,15,16,17,46,62,18,87,64,65,49,67,20,68,74,21,57,73,22,91,23,25],auto:[32,87,47,71,0],handi:[36,56,89,14,17],memberlist:46,p15:6,p16:6,p17:6,p18:6,gridsizei:6,modr:71,somewher:[64,85,36,4,28,41,8,91,12,60,17],ourfpm:[40,41,42,43],mode:[20,68,71,52,90,46,27,14,18,1,40,83,77,22,94,56,13,4,21,80],basicblockpass:64,acquirereleas:73,unwind:[26,46,91,71,19,50,60],globl:[19,6],selectiondag:[26,33,46,71,73,14],grok:[36,81,17],chunk:[26,75,36,71,72,87,94,17],special:[26,53,0,40,1,3,60,32,34,71,6,38,7,82,8,9,13,14,15,46,86,62,18,87,64,20,68,35,73,57,94!
 ,23,56,25
 ],image_sym_type_byt:92,"0x00000130":87,influenc:[64,51,87],dw_at_apple_property_copi:87,suitabl:[61,26,63,6,62,14,18,71,8,78,94,60],hardwar:[20,88,46,6,21,71,30,67,60],statist:[35,21,84,64,65,31,67,14,28,44],iostream:[75,81,6],spec95:28,lcssa:[26,51],"__cuda_ftz":6,manipul:[20,81,47,62,14,71,40,49,13,60],parallel_dir:[56,44],machineinstrbuild:71,ecx:[68,71,19],image_scn_mem_writ:92,bodyexpr:[13,40,41,42],bclinklib:56,membership:14,keep:[26,75,0,77,3,60,32,34,35,36,4,38,81,40,41,8,9,12,13,14,15,16,17,85,18,87,64,68,71,22,44,48,74],wrote:[33,60,86],geometri:21,dumpmymapdoc:57,svptr:60,linkallcodegencompon:64,qualiti:[26,71,29,77,8,22,64],fmul:[6,36,71,43,10,60,17],lshr:60,art:62,find_a:14,rs1:46,has_disassembl:23,scalartrait:57,dump:[26,71,36,60,87,57,40,41,42,43,64,78,70,94,31,10,11,14,17],perfectli:[75,86,4,71,48,60,81,16],mkdir:[20,56,52,77,55],wrapper:[61,26,46,87,94,3,14],second_end:60,attach:[20,75,69,6,40,87,82,22,13,60],regionpass:64,functionpassctor:64,"final":[75,2!
 7,40,1,77
 ,85,60,61,34,80,36,48,38,7,41,42,8,9,11,12,13,14,15,16,17,46,74,18,87,64,20,68,52,70,21,71,22,44,94,91,56,25],prone:[68,18,71,29,81],rsi:68,deconstruct:71,methodolog:91,rst:[71,89],exactli:[26,68,57,94,85,35,62,14,18,1,87,43,64,23,19,60,10,3,4],rsp:[68,71,72],ehashfunctiondjb:87,bloat:75,a_ctor_bas:4,instvisitor:[33,14],dubiou:80,bare:[83,14,46],f16:60,exhibit:[70,73],multhread:14,xor8rr:71,reg2:4,reg1:4,goldberg:62,lightli:[27,60],tabl:[26,71,0,28,58,77,31,59,60,61,32,34,80,35,36,48,40,41,42,43,9,10,11,12,13,14,16,17,45,46,47,85,18,87,93,66,50,20,68,91,21,57,94,56,74],need:[26,53,57,27,40,28,77,30,75,86,48,59,3,82,60,32,33,34,71,6,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,83,63,46,47,62,85,18,84,87,64,65,49,67,50,80,20,68,89,52,70,21,35,72,73,55,22,44,94,91,23,56,24,97,74],altivec:[21,71],border:71,fp5:68,"0x08":87,reloc_pcrel_word:[75,46],"0x04":87,"0x00":80,parse_extern:[10,11,12,13,16,17],fileit:18,unawar:60,platformstripopt:56,llvmgold:55,equal_rang:14,instanci!
 :68,singl
 :[26,71,0,27,28,1,60,33,34,80,6,36,4,38,40,43,8,9,10,13,14,44,17,46,86,62,18,87,64,49,20,68,51,90,70,21,57,73,22,94,91,56],parseidentifierexpr:[36,48,40,41,42,43],discov:[84,62,71,1,40,87,42,11,3,13],rigor:71,x86_ssecal:46,x86_fp80:[60,94],sdk:30,url:[22,89],hasrex_wprefix:68,"0xe8":68,yaml2obj:92,indx:57,snapshot:35,unoptim:[20,65],constrain:[36,54,68,81,17],disable_assert:[54,20,77,56],"0x0a":80,cute:[34,9],verbos:[20,1,80,90,57,56],objc:[32,89,87],molest:60,anywai:[26,7],varnam:[11,13,40,41,42],nondebug:26,envp:82,x86_thiscal:71,won:[75,86,35,27,28,71,7,87,43,8,36,22,49,10,56,89,60],themodul:[36,40,41,42,43],add_to_library_group:23,gettyp:[75,14],tbb:46,coalesc:[60,39,14,71,67],shr:75,enabl:[26,71,0,76,1,29,78,75,60,5,79,95,81,82,8,14,63,46,62,18,84,87,64,65,67,20,52,90,21,57,72,54,55,22,56,24,74],getmbb:46,she:[96,68],contain:[26,53,0,27,28,1,75,29,77,30,2,59,82,60,61,32,85,79,80,6,36,4,7,42,43,8,10,11,71,14,16,17,46,86,62,48,18,87,64,96,93,66,20,68,51,52,74,21,35,57,22!
 ,44,94,91
 ,23,56,97,25],shapekind:85,grab:[68,27,81,77,11,12,13,14],image_file_local_syms_strip:92,shl:[25,75,60,26],nolink:18,flip:75,target_link_librari:52,image_scn_mem_16bit:92,statu:[81,76,1,78,31,4,32,5,79,80,37,39,14,83,63,47,84,65,66,67,50,69,90,21,93,95,96,56,97],correctli:[64,20,71,86,60,18,57,72,73,42,87,8,22,44,91,11,75,48,14,81,16],writter:18,sectvalu:18,realign:60,state:[26,57,69,20,62,14,18,35,75,73,87,64,22,48,91,56,71,60,89],neither:[26,30,60,94,35],tent:60,vfp3:7,kei:[68,71,14,57,64,22,59,60],header_data_len:87,setgraphcolor:14,eclips:20,thank:53,xxxreloc:46,admin:96,handledefinit:[36,48,40,41,42,43],dw_tag_inherit:87,test_format:1,unglamor:22,multi_v:18,orig:60,quit:[32,33,34,86,35,36,60,56,73,42,82,62,9,11,3,71,14,89,17],slowli:[20,22],addition:[20,71,26,62,14,18,35,73,8,55,22,23,56,60],classnam:97,libdir:[56,83],image_sym_dtype_nul:92,treat:[34,94,46,86,36,14,18,71,75,73,8,74,9,60,49,59,56,4,17],cputyp:94,alphacompilationcallback:46,otp:60,createcal:[36,40,41,42,!
 43],plaus
 ibl:26,acq_rel:[60,73],replic:[68,53,74,57],novel:[62,60,14],dw_tag_typedef:87,removenod:20,harder:[26,48,81,3,60,16],contextu:24,print_str:[10,11,12,13,16,17],engag:22,demo:[36,18,77,81,17],rootstackoffset:62,povray31:28,invokeinst:14,welcom:[20,34,88,36,48,38,40,41,42,43,64,30,22,9,10,11,12,13,15,16,17],parti:[22,44],reloc_picrel_word:[75,46],print_float:[10,11,12,13],sqrt:[57,60,0],setcategori:18,matcher:[71,97],donoth:60,http:[20,45,32,27,28,7,77,8,36,30,22,96,17],tokprec:[36,48,40,41,42,43],effect:[26,75,28,29,3,60,35,41,42,8,11,12,14,46,86,62,18,87,64,67,20,71,94,56,24,25],isopt:18,llvm_use_oprofil:52,global_s:14,initi:[26,57,71,1,75,31,60,61,33,85,6,36,81,40,42,43,10,11,12,13,14,17,46,62,18,64,67,68,52,91,21,35,72,94,25],appendinglinkag:14,dllvm_enable_p:7,callgraphscc:64,isrematerializ:68,dw_form_strp:87,well:[26,71,77,30,75,82,60,33,6,36,95,38,81,40,41,43,8,10,12,13,14,15,16,17,18,84,87,64,66,20,68,69,70,21,35,73,55,22,94,48,23,74],makefileconfig:56,undefin:[26,68,!
 53,52,46,
 6,14,0,75,73,74,91,86,93,60,81],sibl:[71,60],jonathan2251:45,distanc:[60,57,14,86],memory_order_consum:73,mistaken:[10,43],aform_1:71,aform_2:71,size1:60,size2:60,size3:60,outstream:62,dependfil:56,densiti:[12,75,41],warrant:33,kick:[12,41],nodebuginfo:18,takelast:14,howto:[45,68,89],mcsectioncoff:71,add_gvn:[10,11,12,13],burden:22,zchf:7,xxxisellow:46,loss:[62,14],lost:[60,34,9,81,56],"0f3fb8aa3b":6,ldflag:[20,83,36,40,41,42,43,56],necessari:[26,53,77,75,3,60,61,33,80,35,4,81,7,82,8,14,46,62,18,64,49,20,51,91,71,73,22,56,89,74],rotl:33,lose:[64,34,9,87],page:[61,20,75,52,69,0,36,32,18,81,87,58,77,8,30,22,88,56,14,21],"100mb":56,therein:44,revers:[26,51,0,4,21,86,14],revert:[20,22],"04e":60,notfp:68,"__cxa_allocate_except":91,home:[28,14,82],librari:[26,53,0,40,30,75,31,3,82,60,32,34,88,80,6,36,95,38,81,7,41,42,43,8,9,12,14,15,16,17,83,46,47,62,18,84,87,64,67,50,20,86,52,90,21,35,57,54,22,44,94,48,23,56,97,74],win32:[3,30,71,20],makelight:75,broad:[38,62,18,43,10,15],overla!
 p:[64,71,
 35,60,0],estim:[26,0],asmstr:[68,46],myfunct:6,encourag:[26,34,53,75,22,9,14],ifequ:60,ec12:21,usag:[26,75,0,60,32,80,6,95,38,8,70,15,18,87,64,20,52,14,71,55,23,56],prefetch:[88,60],nutshel:14,offset:[34,80,46,86,62,60,71,72,87,8,9,94,4,14],image_file_32bit_machin:92,testsuit:[20,4,56],bcreader:83,freedom:[60,14],viewvc:32,bodyitem:25,metadata_attach:94,cocoa:60,cmake_cxx_flag:52,m_func:14,"0x00000110":87,image_file_removable_run_from_swap:92,"_cuda_ftz":6,downgrad:81,inner:[60,95,57,14,32],global_iter:14,feat_segstack:71,pty2:60,addpassestoemitfil:64,eax:[19,68,71,4,46],gain:18,spuriou:75,eas:29,highest:[36,48,40,41,42,43,10,11,12,13,60,16,17],eat:[38,36,48,18,40,41,42,43,10,11,12,13,15,16,17],liblto:[55,74],dmb:73,displac:71,displai:[26,71,46,28,38,50,18,1,75,87,96,22,31,85,24,93,15],sectiondata:92,asynchron:73,cruel:89,"0xffbef174":64,limit:[26,71,75,60,32,35,95,86,41,42,43,10,11,12,70,47,62,18,87,64,49,14,57,72,73,56],calctypenam:33,add_llvm_loadable_modul:52,tmp9:[4,86!
 ],atyp:86
 ,isconvertibletothreeaddress:68,reciproc:60,evalu:[26,75,60,33,34,6,36,48,40,41,42,43,9,10,11,12,13,16,17,46,86,62,35],lastchar:[36,48,38,40,41,42,43],intregsregclassid:46,fourinarow:28,rule:[26,75,27,28,77,3,60,79,36,4,81,7,42,8,11,14,44,17,85,47,87,64,86,68,71,73,22,56],acloc:[20,44],tok_var:40,arctan:57,hash_set:14,getjmp_buftyp:75,futur:[62,64,75,86,27,60,38,71,87,42,82,8,36,22,94,49,11,13,14,15,17],rememb:[20,40,86,60,18,71,7,42,64,30,22,48,11,75,13,14,28,16,81],parse_id:[10,11,12,13,16,17],iplist:14,baselin:[71,77],stat:[80,35,70,28,84,64,65,67,3,14],addrequir:64,cmake_build_typ:52,ctlz:60,dw_tag:87,stab:87,same_s:19,dyld:61,llvm_map_components_to_librari:52,stai:[32,22,74,57],sphinx:[20,89,32],"_ztv3foo":4,indirectli:[68,75,60,73],bcc:46,portion:[20,46,26,95,18,71,70,43,22,91,10,24,60],image_file_machine_sh3dsp:92,callingconv:[94,46],getpointertofunct:[61,40,41,42,43,14],use_bind:[10,11,12,13],accur:[32,34,35,62,74,87,9,26,60],unaryexprast:[40,41],parse_var_nam:13,so!
 rri:[34,9
 ],bespok:62,swap:[60,29],preprocess:[53,81],aux:14,downstream:39,"void":[26,71,0,73,75,4,33,6,36,60,81,40,41,42,43,14,46,86,62,18,87,64,91,57,35,55,94,48,74],llbuilder:13,build_stor:13,appar:[13,40],x86_stdcallcc:94,theier:26,stageselectioncat:18,image_file_machine_m32r:92,scalarbitsettrait:57,vector:[26,57,0,75,60,32,33,34,6,36,48,40,41,42,43,9,13,14,17,46,86,18,87,51,21,71,94],llvm_build_test:52,mllvm:0,initialis:18,whirlwind:[48,16],likeli:2,cpu_x86:57,getposit:18,aggreg:[60,51,14,46,26],binop_preced:[10,11,12,13,16,17],even:[71,0,40,28,1,30,75,3,60,34,80,35,4,38,7,41,42,43,8,9,10,12,13,14,15,85,62,64,93,67,20,68,21,57,94,56,24,89,74],rope:14,addllvm:52,neg:[46,86,91,87,22,94,60],asid:14,transcrib:[36,17],nex:64,libpo:18,"new":[26,53,57,27,71,85,1,77,75,48,59,3,82,60,61,32,33,34,80,6,36,95,81,40,41,42,43,8,9,10,11,12,13,14,16,17,46,47,74,18,84,87,64,49,20,68,51,69,70,21,35,72,73,55,22,44,94,91,56,24,89,25],net:[96,32],ever:[34,35,60,75,22,9,23,14],metadata:[26,51,86,20,6!
 2,32,38,6
 ,87,2,94,60,15],elimin:[26,71,75,60,6,48,81,40,41,42,43,10,11,12,13,14,16,46,62,18,87,64,65,20,51,70,35,55,22],behavior:[26,75,53,1,60,33,35,4,39,40,42,11,13,14,81,16,46,62,18,64,20,91,71,73,48],old_bind:13,mem:[26,10,11,12,13,60,24,16,17],henrik:3,restat:75,met:[71,60],valuemap:14,ccassigntostack:46,image_scn_cnt_initialized_data:92,interpret:[1,60,34,36,95,39,40,41,42,43,8,9,10,11,12,13,14,16,17,83,62,18,87,67,20,68,52,71,54,94,48,23,56,25],dcmake_crosscompil:7,gcname:94,credit:22,ebenders_test:82,permit:[68,51,62,14,71,40,8,65,13,60],parlanc:[38,15],prolog:[71,46],fsub:[40,13,60],immin:77,machineregisterinfo:71,quickcheck:14,createnvvmreflectpass:6,icc_n:46,call:[26,57,0,48,71,28,1,75,31,3,82,60,61,33,34,88,80,6,36,4,38,81,40,41,42,43,8,9,10,11,12,13,14,15,16,17,46,62,74,18,87,64,49,67,20,68,51,69,70,21,35,72,73,54,44,94,91,23,24,25],calm:[13,40],recommend:[20,71,52,86,6,48,87,1,40,54,43,8,22,10,56,75,13,64,16],icc_g:46,type:[26,53,0,40,28,75,77,2,31,85,60,61,32,5,34,71,!
 6,36,95,3
 8,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,46,86,62,48,18,33,87,64,65,19,49,93,80,20,68,51,52,69,70,21,35,92,57,22,44,94,91,23,56,24,25],tell:[75,28,60,33,34,35,36,95,40,8,9,13,14,44,17,86,62,18,87,20,68,52,70,71,54,22,16,48,56,74],esi:[68,71],"__eh_fram":71,llvm_acquire_global_lock:14,warn:[20,33,75,52,80,28,26,14,18,71,77,30,22,32,23,56,60,25],all_build:30,gpl:[22,81],dw_tag_apple_properti:87,room:[64,48,16,49],floattyp:14,dw_apple_property_nonatom:87,setup:[34,85,46,36,87,8,55,9,17],functionnam:[62,60],v8deprecatedinst:46,librarygroup:23,root:[20,83,51,52,96,47,36,1,7,87,8,62,22,23,71,60,44,17],clang_cc1:4,defer:[10,61,43],give:[26,57,75,60,34,6,36,38,81,7,41,43,9,12,71,14,15,17,46,18,87,64,20,70,35,73,22,94,96,24,89,25],dlsym:[10,56,64,43],ocaml:[21,10,11,12,13,15,16,17],binpath:82,subtmp5:[13,40],dragonegg:[32,81,22,71,77],unsign:[71,0,75,2,60,6,36,40,41,42,43,14,17,46,86,62,18,87,57,35,94,74],quot:[68,18,87,8,23,60],tbaa:[51,60],targetlow:[33,71,70,46],answer:[26,75,!
 86,32,18,
 35,40,42,43,89,10,11,13,60,81],registerlist:46,config:[1,58,3,36,81,40,41,42,43,8,14,44,17,83,46,47,23,20,21,22,96,56],confid:22,reloc_absolute_word:[75,46],attempt:[61,26,84,46,35,91,95,56,70,64,75,94,20,3,71,60,81],unnamed_addr:[60,94],maintain:[33,75,35,62,60,18,71,68,73,64,22,94,3,14,87],yourregex:4,vfp:29,"0fbf317200":6,privileg:[3,60],gcda:78,copyright:[64,22,81],unexpetedli:8,sigplan:[62,71],better:[26,53,0,28,75,4,34,60,40,42,82,9,11,13,14,16,63,64,51,71,73,48],argti:60,persist:14,erlang:60,newtoset:75,dummytargetmachin:46,promin:[8,28],overestim:60,then_:[11,12,13],usertarget:56,mapsectionaddress:61,isel:[68,51,46,21,71,97],"instanceof":14,grammat:[48,28,16],grammar:[48,12,33,16,41],meat:10,build_for_websit:77,setdescript:18,getvalu:[75,14],somefancyaa:64,went:[11,42],thenv:[40,41,42],side:[26,71,6,36,60,35,41,42,8,62,75,48,11,12,14,16,17],bone:46,mean:[26,71,1,77,75,85,3,60,34,80,35,36,4,38,40,42,43,9,10,11,13,14,15,44,17,46,86,62,18,87,64,93,68,52,74,57,55,22,94,!
 56,25],aw
 ri:56,add_ri:68,oppos:[20,51,25,18,93,11,60,44],taught:71,f108:6,f107:6,extract:[26,5,80,46,14,68,58,87,30,60],getsextvalu:14,unbound:[71,46],crucial:60,content:[26,75,28,4,31,60,32,80,35,85,95,10,11,12,13,14,15,16,17,45,46,47,18,87,64,19,68,52,74,71,22,94,23,56,89,25],dw_lang_c99:87,mtripl:[60,65,4,67],dfpregsregclass:46,reader:[33,75,48,57,58,94,50,60,81,16],end_cond:[11,12,13],umul:60,parseforexpr:[40,41,42],nodetyp:46,linear:[20,86,35,71,64,65,67,14],parse_definit:[10,11,12,13,16,17],mytyp:60,verif:[26,18,60],situat:[26,85,46,86,14,18,71,73,43,64,55,91,10,56,60],infin:60,parenthesi:[48,75,16],f89:6,getfunctiontyp:14,retcc_x86_32_fast:46,dw_at_rang:87,nummodulevalu:94,typesaf:60,ish:[12,41],fptoui:60,isa:[32,75,88,85,46,62,71,14],getinstrinfo:[71,46],isd:[33,71,46],cpuinfo:29,floorf:0,my_kernel:6,targetregistri:[71,46],hook:[11,71,70,44,42],unlik:[20,75,85,26,62,14,71,40,73,43,64,55,22,94,91,10,56,13,60,25],agre:[26,22,57],payload:71,hood:8,global_empti:14,tsc701:46,spec!
 ialis:60,
 ieee754:60,sometim:[26,71,94,85,46,86,4,18,57,75,70,8,22,60,56,14,81],arm_apcscc:94,dwell:36,filepo:18,llvm_enable_pedant:52,bodyv:40,namespac:[68,75,46,36,48,18,40,41,42,43,64,62,94,14,87],build_cond_br:[11,12,13],isascii:[36,48,40,41,42,43],dllvm_tablegen:7,mergereturn:26,symptom:20,enjoi:96,r14d:68,silli:[38,75,15,81,35],r14b:68,keyword:[64,68,40,71,86,0,25,18,35,38,41,42,8,75,11,12,13,60,15],mcdesc:46,r14w:68,matter:[33,73,64,22,10,60],pointkind:62,modern:[34,88,0,21,38,82,8,9,56,14,15,81],mind:[48,75,13,40,16],mine:87,stackar:62,bitfield:73,seed:37,seen:[34,46,60,18,71,41,43,64,75,9,94,12,14],seem:[71,52,85,35,62,18,39,86,70],seek:[26,52,32,86,22,19,56],minu:[72,60],ty2:[33,60],memcheck:[8,1],image_sym_class_register_param:92,preincrement:75,rethrow:91,myset:75,myseq:57,distsourc:56,fnstrart:71,cudevic:6,regular:[20,5,34,80,60,18,73,9,56,4,28],ccassigntoreg:46,tradit:[20,26,38,71,87,64,93,15],simplic:[36,62,38,14,17],don:[26,53,0,27,71,28,1,77,75,3,60,34,6,36,4,38,81,4!
 0,41,42,4
 3,8,9,10,11,12,13,14,15,16,17,85,86,62,18,87,64,67,20,69,35,54,22,48,56,89],pointe:[60,94],dom:26,pointi:57,alarm:29,obtus:86,dog:18,expandinlineasm:46,digress:[12,41],dot:[26,77,14,87,56],hunger:[34,9],visitor:[33,36,38,62,70,15],esoter:68,llvm_enable_werror:52,syntax:[71,75,60,32,6,36,4,38,81,40,41,42,43,8,10,11,12,13,15,16,17,86,18,87,65,19,67,20,68,51,21,57,92,48,56,24,89,25],errstr:[40,41,42,43],image_sym_class_weak_extern:92,istruncatingstor:46,despit:[64,18,71,68,87],acquir:[60,73],libari:83,explain:[75,52,80,35,72,38,71,40,64,13,14,15,81],"__nv_truncf":6,pinst:14,stop:[20,33,75,52,62,14,39,64,48,91,60,81,16],compli:62,smul:60,bar:[25,57,52,6,0,4,18,1,87,42,36,75,60,11,71,14,81,17],sacrific:60,baz:[75,0,18,87,42,11,25],reload:[71,13,40,51],bad:[75,27,60,87,81,41,70,95,3,12,14],dw_tag_shared_typ:87,shtest:1,addinstselector:46,flagpointi:57,cstdio:[36,48,40,41,42,43],instalias:71,isdef:71,"0x42":94,"0x43":94,subject:[60,22,14,71],p1i8:6,said:[34,91,21,87,77,75,9,14],si!
 mplest:[7
 1,46,36,48,18,57,43,30,10,16],attribut:[26,74,46,6,62,14,18,39,65,87,22,32,94,49,59,67,60,21],add_memory_to_register_promot:13,triplet:[8,18,60],howtousejit:83,lazi:[60,35,14,26],abs_fp80:68,configurescript:56,imagmag:[12,41],against:[20,83,22,52,80,85,6,4,28,57,54,8,2,60,91,26,14,81],fno:0,uni:6,readnon:[26,60,87,94,6],uno:60,foobaz:75,createload:40,devbufferc:6,devbufferb:6,devbuffera:6,foobar:[57,75],int32_t:[62,57],loader:[26,84,95],theoret:[3,14],"__________________________________________________________":14,performcustomlow:62,three:[26,27,28,1,4,14,60,81,42,8,70,16,46,86,48,18,64,20,91,71,94,95,56],objc_properti:87,specul:[91,73,35],succ_begin:14,trigger:[61,5,57,52,35,62,70,21,53,8,75,60,28],interest:[26,71,28,1,58,30,75,31,60,61,32,34,35,36,4,38,81,40,41,42,43,8,9,10,11,12,13,14,15,16,17,85,62,18,87,64,20,91,57,73,22,48,96],basic:[26,71,0,28,58,77,30,75,31,85,3,60,81,34,80,6,36,48,38,39,40,41,42,43,9,10,11,12,13,14,15,16,17,46,86,62,18,63,87,64,65,49,20,68,51,52,5!
 3,73,44,9
 4,89,25],mo_registermask:71,tini:[75,85],llvmpassnam:52,build_load:13,deeper:[89,85],suppress:[62,75,1,60],mce:46,sparsemultiset:14,multithread:[62,64,14],lpae:73,argumentexpr:[10,11,12,13,16,17],llvm_include_test:52,ugli:[14,12,81,4,41],subsequ:[61,26,68,46,86,14,18,71,87,24,60],intregsvt:46,itinerari:[68,71,46],noredzon:[60,94],slt:60,servic:[3,81,35],lex_id:[10,11,12,13,15,16,17],slp:[21,51,0],calcul:[64,26,51,46,35,60,28,71,87,42,8,11,86,14],typeflag:87,sle:60,anchor:[75,87],r600:[21,88],uncopy:75,xxxkind:85,disappear:[20,81,29],grown:[12,34,9,41],receiv:[61,14,94,91,60,16],make:[26,53,0,27,40,28,1,29,77,75,85,3,82,60,32,34,71,6,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,83,46,47,62,18,87,64,96,65,67,86,80,20,68,89,52,69,70,21,35,73,57,54,55,22,44,94,48,23,56,97,74],bitmask:60,who:[20,34,46,32,53,40,54,8,22,9,23,3,75,13,60],isspac:[36,48,38,40,41,42,43],initialexec:[60,94],kevin:71,zlib1g:7,kib:18,overs:14,revector:[26,14],binopprototyp:[12,13],qualif:77,vehiclem!
 ak:75,ea_
 r:71,addrawvalu:49,inherit:[64,68,75,85,35,25,18,71,54,3,14],endif:[34,52,18,75,9,3],programm:[25,34,85,32,0,62,60,18,84,41,70,64,9,73,56,12,71,14,21],paradigm:[21,14,86],left:[26,68,71,80,46,0,36,70,28,57,87,42,75,94,48,11,60,16,17],projusedlib:56,identifi:[26,75,27,1,60,80,6,36,4,38,40,41,42,43,10,11,12,13,14,15,16,17,46,86,62,48,18,87,64,19,20,51,52,70,71,44,94,91,24,25],op1:[60,94],op2:60,op3:46,bandwidth:60,hotspot:63,human:[20,68,75,79,90,26,76,63,57,64,31,60],nowadai:7,yet:[61,20,83,75,96,46,26,62,60,18,71,41,42,43,64,23,10,11,12,14,28],languag:[26,71,76,75,60,32,5,34,79,6,36,4,38,81,40,41,42,43,8,9,10,11,12,13,14,15,16,17,45,46,86,62,18,84,87,65,88,20,68,90,91,21,57,73,22,48,25],macport:54,save:[71,0,30,31,60,61,33,6,40,41,42,43,10,11,12,13,14,46,18,87,20,68,69,91,53,54,94],vpsubusw:8,u999999:69,applic:[75,28,60,61,32,34,88,80,38,41,43,8,9,10,12,14,15,83,46,62,18,64,68,91,21,71,22,94,23,56],segnam:18,link_directori:52,background:[71,14,89,85,82],opc:[68,40,41],wojci!
 ech:26,ge
 tinstlist:14,manual:[75,60,32,34,88,46,8,9,70,85,86,18,84,87,64,20,68,69,14,21,71,22,96,56],dindex:46,tolmach:62,machinepassregistrynod:64,choic:[33,34,14,38,29,42,65,9,76,11,60],unnecessari:[26,71,14,46],cxxflag:[56,83],www:77,deal:[26,75,85,91,40,73,87,22,94,13,14],global_ctor:[81,60],interv:[20,71,14,26],somehow:[64,14],dead:[26,51,20,14,18,6,35,87,64,74,71,60,81],type_code_fp128:94,intern:[26,71,28,1,75,3,60,61,32,6,36,95,81,40,13,14,17,46,86,18,87,64,66,20,68,91,57,35,94,56,74],make_pair:40,norman:71,insensit:35,collect:[26,75,0,28,60,61,32,34,88,35,38,9,14,15,62,18,87,49,68,51,21,56,74],getchar:[36,48,38,40,41,42,43],xmm15:68,creatur:[41,12,15,38],burg:51,bold:89,identifierexpr:[36,48,40,41,42,43,10,11,12,13,16,17],uncompress:[20,14,52],cdt4:20,mappingnorm:57,buri:75,promot:[26,33,51,46,35,14,71,40,22,13,60],burr:67,"super":[71,74,46],fnty:60,unsaf:[34,73,87,65,9,67,60],dw_tag_formal_paramet:87,movsd:4,argv0:67,culaunchkernel:6,ppcf128:60,compilecommonopt:56,simul:[71!
 ,60],movs
 x:71,commit:[20,75,69,32,21,77,8,22,96,89],movsq:71,decompil:21,mrm7m:46,contriv:[68,81],f128:[60,46],down:[26,71,32,34,85,35,95,41,42,9,11,12,14,16,46,86,48,18,84,87,64,65,67,20,69,70,21,53,54,22,91,56],pair:[26,71,46,35,4,57,40,73,42,87,91,48,49,11,60,16,14],indexreg:71,mrm7r:46,nomodref:35,add32mi8:68,subl:[71,4],parsesubtargetfeatur:46,precomput:35,perldoc:20,frameinfo:46,xpass:1,imit:[89,25],r173931:68,fraction:[59,85],amazingli:[11,42],"_els":[40,41,42],fork:3,numxform:14,ptroff:71,form:[26,53,91,57,71,28,77,75,59,60,61,32,34,80,6,36,4,38,81,40,42,43,8,9,10,11,13,14,15,16,17,46,47,62,85,18,87,64,19,86,20,68,51,52,74,35,22,48,94,95,56,25],sub1:4,forc:[75,52,0,91,18,57,7,87,64,67,56,60],retarget:[32,71],nounwind:[6,4,87,8,94,60],phid:75,emitbyt:46,autoinsert:14,inttoptr:[60,86],type_code_ppc_fp128:94,processrelocationref:61,llvma:56,multisourc:[8,28,22,87,53],dontcopi:75,lowerinvok:[26,65,67],"__i386__":[34,9],unrel:[22,14,46,77],classid:25,classif:[3,60],featur:[26,71,!
 0,27,28,1
 ,77,75,59,3,60,32,34,48,81,40,41,42,8,9,11,12,13,14,16,46,62,18,87,64,20,68,52,69,21,57,54,22,44,56,74],semicolon:[68,52,36,48,40,41,42,43,10,11,12,13,16,17],classic:21,visitgcroot:62,diagnost:[1,4,39],glanc:[75,34,9],ship:[20,34,9,82],dwarfnumb:46,password:[96,22],excel:[14,46,35],image_scn_align_2048byt:92,stackrestor:60,journei:[13,40],subdivid:28,why:[75,60,35,48,38,81,40,42,11,13,14,15,16,85,86,87,64,57,55,22,56,89],"0fc2d20000":6,iteri:[10,11,12,13,17],disttargzip:56,libffi:54,fsf:20,pseudo:[46,14,71,87,64,23,97,60],dcommit:20,image_sym_type_int:92,skip:[75,46,36,48,38,71,40,41,42,43,87,94,10,11,12,13,60,15,16,17],"0x00000150":87,skim:75,createvirtualregist:71,mill:18,primer:89,pldi:62,hierarch:[26,94],misread:75,libit:18,depend:[26,71,0,27,40,28,1,75,2,31,59,3,60,61,80,6,36,95,81,7,8,13,14,16,17,83,46,86,18,84,87,64,96,19,49,20,91,21,35,73,54,22,44,94,48,23,56],fancier:[64,89],intermedi:[32,5,81,90,46,27,14,21,84,62,48,49,60,16],targetinstrformat:46,hasinternallinkag!
 :14,image
 _scn_align_2byt:92,letitem:25,mandlebrot:[12,41],llvmbuilder:10,llvmdummycodegen:46,string:[26,71,1,75,2,59,3,60,33,80,6,36,4,38,40,41,42,43,10,11,12,13,14,15,16,17,46,18,87,64,65,49,66,67,20,68,52,57,94,48,23,24,25],create_argument_alloca:13,kernel_param_2:6,kernel_param_0:6,kernel_param_1:6,print_endlin:[10,11,12,13,16,17],dil:68,did:[20,34,85,35,60,81,40,41,43,64,75,9,91,10,12,13,14],die:[26,87],dif:26,dig:[68,38,15],iter:[26,71,0,75,60,61,35,48,40,41,42,11,12,13,70,16,46,62,74,18,68,51,14,57,22,25],item:[20,68,80,18,57,40,87,94,31,23,56,13,21],div:[71,14],round:[57,21,71,41,77,12,60,87],dir:[20,52,27,1,7,87,56,44],sparclit:46,originput:18,nozero:67,sideeffect:60,addr:[66,60,46],insertbranch:46,addx:68,respres:14,suspect:84,addi:68,slot:[26,46,72,71,40,31,13,60],dwarf:[34,46,62,74,71,87,82,9,91,14],oversimplifi:14,elsev:[40,41,42],imul16rmi:71,wait:[75,27,48,96,3,16],patleaf:46,canadian:20,shift:[26,33,18,71,94,60,21],bot:[32,22],"_ztii":60,storeregtoaddr:46,extrem:[25,7!
 1,46,26,1
 4,87,35,40,73,70,64,22,94,59,13,60],bob:57,else_:[11,12,13],opcstr:46,stb_local:60,elect:22,modul:[26,71,28,1,58,77,75,31,60,61,5,6,36,39,40,41,42,43,8,10,11,12,13,14,81,17,63,46,62,84,87,64,20,51,70,35,94,56,74],"__jit_debug_register_cod":82,movsx64rr8:71,"0baz":14,"0x60":80,sake:[64,14],allocinst:13,getsubtargetimpl:46,visit:[62,70,33,14],tokidentifi:25,deplib:94,perl:[62,20],everybodi:22,zeroargfp:68,checkout:[8,20,21,27,54],fcomi:71,com_fir:71,appel:62,extractvalu:60,examin:[61,20,46,70,18,71,77,8,14],effort:[61,26,33,75,36,81,87,22,3,17],armhf:7,fly:[48,21,71,43,10,16],reviewe:22,ulp:60,uniqu:[68,71,94,0,36,4,57,87,59,74,60,49,23,14,17],ult:[40,42,10,11,12,13,60,17],sourcewar:55,imped:60,nextvar:[40,41,42,11,12,13],nearest:60,basic_block:17,predict:[64,32,2],crazi:[18,34,9,15,38],subregion:60,fp16:60,strikingli:[12,41],delete_funct:[10,11,12,13,17],subnorm:6,binarypreced:[40,41],"0x000034f0":87,targetsubtarget:[71,46],ping:22,f32:[71,60,46,6],idiv:71,brain:75,till:[96,!
 14,82],ge
 tdatalayout:[46,62,40,41,42,43],purg:75,foreach:[68,75,25],pure:[26,46,36,71,87,22,23,25,17],doclist:57,testingconfig:1,map:[57,0,71,1,75,59,60,61,33,6,36,48,40,41,42,43,10,11,12,13,14,17,46,62,18,87,51,35,92,94],max:[18,1,60],usabl:[71,18,65,14,46],intrus:14,smallstr:14,mag:60,mai:[26,57,91,0,71,28,1,75,29,77,30,2,3,60,61,5,34,80,6,36,4,38,81,40,41,42,82,8,9,11,12,13,14,15,44,17,46,86,62,18,33,87,64,96,65,49,67,93,20,68,51,52,70,21,35,73,55,22,94,95,23,56,74],underscor:[56,75,87],maj:27,grow:[60,18,71,42,11,24,14],man:[8,20,18,32],noun:75,"0x00001000":87,"switch":[26,75,29,77,2,59,60,33,85,36,48,40,41,42,43,10,11,14,17,46,62,18,20,91,57,55,56],myglob:87,targetframeinfo:[71,46],purifi:53,str1:68,talk:[33,34,36,48,38,40,42,43,64,75,9,10,11,13,15,16,17],isieeenorm:21,image_sym_class_automat:92,abbrevop0:94,abbrevop1:94,config_fil:56,shield:[3,71],iptr:60,comdat:19,"123kkk":18,recoup:94,nbsp:71,gcmetadata:62,pointer:[26,57,0,71,75,60,61,34,6,48,38,81,40,41,42,43,9,10,11,12,13,!
 14,15,16,
 46,86,62,87,64,65,51,91,21,35,73,94,74],entiti:[68,75,14,87,94,60],group:[26,75,28,4,3,60,32,34,80,48,8,9,16,46,18,87,64,68,21,71,22,23],monitor:35,polici:[20,22,14,35,32],shadowstack:62,build_shared_lib:52,mail:[20,34,69,32,27,21,75,22,9,96,89,44],inlinehint:[60,94],main:[26,75,77,30,82,60,32,34,6,36,48,40,41,42,43,8,9,10,11,12,13,14,16,17,62,18,87,64,66,20,68,91,21,71,55,22,23,89,74],irbuild:[36,40,41,42,43,10,11,17],recoveri:[36,48,40,41,42,43,10,11,12,13,16,17],parseunari:[12,40,41],remateri:73,synopsi:[76,1,4,78,31,37,5,79,80,95,39,83,63,47,18,84,65,66,67,50,90,93,97],sooner:96,initv:40,possess:14,lo16:71,subproject:[20,21,22,77,32],isnul:75,x11:14,myflag:57,misbehav:27,loopunswitch:26,ndebug:[54,18],continu:[75,28,4,60,34,35,48,82,8,9,14,16,85,18,69,91,71,72,22,94,95,74],gcread:[62,60],redistribut:[22,81],libgcc:72,tmp8:86,recogn:[26,28,38,74,18,71,42,11,60,15],tmp7:[4,86],tmp6:86,tmp1:[75,4],tmp3:4,tmp2:[13,40],getbinarypreced:[40,41],announc:[27,32,77],pocl:21,numva!
 l:[36,48,
 38,40,41,42,43,94],dw_tag_unspecified_typ:87,arminstrinfo:46,correct:[26,71,0,27,28,77,75,3,60,33,35,81,7,43,8,10,14,18,87,64,65,67,20,51,52,21,53,72,73,22,96,56],earlier:[23,30,60,46],"goto":[75,0,40,41,42,13],tmpb:40,ori:71,segmentreg:71,org:[20,57,32,27,28,55,7,77,8,36,30,22,96,17],ord:60,frequenc:63,createasmstream:71,thing:[26,57,40,28,1,77,30,75,3,60,34,71,35,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,86,62,18,87,64,20,68,70,53,54,22,44,94,48,23,56,24,89],principl:[3,38,75,88,15],think:[33,34,52,85,6,38,35,75,42,22,9,11,59,3,86,71,14,15,44],frequent:[20,75,52,86,26,62,60,18,81,30,22,32,3,14,63],first:[26,53,57,71,28,1,75,77,30,2,59,3,48,60,61,34,80,6,36,4,38,81,40,41,42,43,8,9,76,10,11,12,13,14,15,16,17,46,85,62,74,18,84,87,64,67,86,20,68,51,52,70,35,73,22,44,94,91,96,56,24,89,25],carri:[60,24,14,80,86],"long":[71,27,1,75,2,31,85,3,60,34,88,80,35,36,95,81,8,9,14,17,46,86,62,87,64,19,20,70,57,22,56],crit:26,numop:[94,46],indiviu:71,adjac:[60,14,25],averag:[11,42!
 ,31],daun
 t:52,"0f42d20000":6,attrkind:49,foldingsetnod:14,getpredopcod:59,vbr6:94,vbr4:94,vbr5:94,vbr8:94,redefinit:[36,40,41,42,43,10,11,12,13,17],valuedisallow:18,were:[20,68,34,26,60,18,1,73,47,87,30,75,9,84,56,53,71,4,21,14],lcpi0_0:8,mcexpr:71,mrm5m:46,dw_tag_set_typ:87,licm:[26,51,35,73,64,14],llvmlibsopt:56,dash:[18,57],mageia:20,greet:68,gettargetlow:46,exclud:[95,71,22,59,56,4],mrm5r:46,repeatedli:[21,60],unadorn:60,weak_odr:[60,94],squar:[23,57,60,85],advic:[32,95,29,54,22,70],cumoduleloaddataex:6,llvm_target:[10,11,12,13],"_crit_edg":60,advis:[11,77,80,42,49],interior:[51,85],immsext16:71,channel:32,sparciseldagtodag:46,llvm_analysi:[10,11,12,13,17],ptrloc:[62,60],pain:[18,14,82],ldststoreupd:71,trace:[64,18,51,87],normal:[71,0,76,1,77,75,3,60,5,79,80,4,41,12,14,63,18,84,87,64,93,20,68,90,91,21,57,72,73,22,94,56,24,74],track:[26,68,53,71,35,36,70,84,1,40,41,87,64,62,22,75,12,13,14,81,17],c99:[60,19],allroot:28,beta:20,cucontext:6,f3_12:46,r31:71,isglobaladdress:46,synonym!
 :80,cumod
 ulegetfunct:6,dw_form_:87,llvmgxx:56,isphysicalregist:71,defaultconfig:14,gracefulli:14,lexicon:[32,51],show:[71,0,27,1,2,82,60,61,34,6,36,4,38,81,40,41,42,43,9,10,11,12,13,14,15,16,17,46,86,18,87,64,93,20,68,89,57,55,48,97],eckel:14,shoe:57,threshold:[26,60],frontend:[20,21,39,73,23,60],emitexternalsymboladdress:46,globalsmodref:[64,26,35],dice:14,fenc:[60,73],jite:[32,82],adc64mi32:68,parametr:25,customwritebarri:62,dword:75,sparcisellow:46,intptr_t:[40,41,42,43],gep:[26,81,86,32],variou:[26,57,28,75,59,60,61,88,6,95,38,42,43,8,10,11,71,14,15,16,46,48,84,87,64,20,68,69,70,21,35,73,94,91,23,56,74],get:[26,53,57,27,40,28,58,77,30,75,85,3,82,60,61,32,33,34,71,6,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,46,86,62,74,18,63,87,64,49,20,68,52,69,70,21,35,73,22,44,48,96,56,89,25],mung:[26,86],secondari:22,repo:20,emitlabel:71,llvmsystem:56,wheezi:7,fde:71,gen:[6,40,41,42,43,97],r10b:68,yield:[26,86,14,18,94,60,28],r10d:68,stupid:70,mediat:35,r10w:68,summari:[26,76,28,1,31,!
 4,5,79,95
 ,40,13,83,86,18,84,65,67,50,20,69,90,93,94,56,97],wiki:52,kernel:[32,34,46,6,21,0,9,67],setpreservesal:64,"__builtin_setjmp":91,intrinsicsnvvm:6,fmuladd:[60,0],spars:[20,33,51,26,71,14],sean:25,testcas:[36,95,22,17,60,14],patent:22,"0b1001011":68,infinit:[20,35,60,71,26],nestabl:[68,25],innov:21,getmetadata:87,enumer:[68,57,46,18,71,87,75,94,97,14],label:[26,75,94,46,6,62,4,71,40,42,60,11,13,14,81],innoc:[11,42],enumem:46,volatil:[26,81,46,35,62,71,73,60],across:[20,26,6,60,18,0,73,43,64,23,34,9,31,10,71,14,51,87],august:61,parent:[20,75,36,60,1,42,23,11,14],fpregsregisterclass:46,frameaddress:60,modref:[68,73,35],parseprototyp:[36,48,40,41,42,43],copyabl:14,false_branch_weight:2,blocklen:94,audienc:[32,46],library_nam:23,p0i64:4,improv:[26,34,69,46,35,62,21,1,43,64,9,10,77,60],peephol:[33,71,40,41,42,43,64,10,11,12,13,14],among:[20,75,35,74,71,19,6,14],acceler:[34,9,87],colspan:71,unittest:52,tsflag:46,getnumsuccessor:75,cancel:91,iscal:68,inadvert:[3,4],xadd:73,ultim:[68,!
 75,27,1,4
 3,10,56,60],p0i8:[60,6],mark:[20,68,71,46,6,62,14,21,1,73,82,8,75,94,26,24,60],certifi:81,"0x4004f4":66,basicaa:[64,26,35],"0f0":71,fadd:[33,46,6,36,71,40,42,43,10,11,13,60,17],squash:20,f92:6,f93:6,f90:6,f91:6,f96:6,f97:6,f94:6,f95:6,univers:[75,14,81,22,66,60],f98:6,f99:6,those:[26,71,1,29,75,31,3,60,32,80,35,4,39,40,8,13,14,46,86,62,18,87,64,20,68,52,70,57,73,22,91,23,56],sound:35,isvararg:14,interoper:[62,14,34,9,91],"0x3fed":87,"0x3feb":87,"0x3fea":87,"na\u00efv":26,invoc:[52,4,71,70,64,60,95,56,14],isdoubl:68,gvneedslazyptr:46,advantag:[74,34,86,62,60,18,71,40,41,73,22,9,49,12,13,14],parse_expr:[10,11,12,13,16,17],bytecode_libdir:56,destin:[80,46,91,71,40,8,2,13,60],llvm_gcc_dir:28,variable_op:68,my_function_precis:6,cudeviceget:6,liveoffset:62,same:[26,53,0,27,71,78,75,31,59,3,60,33,34,79,80,6,36,4,38,81,40,41,42,43,8,9,10,11,12,13,14,16,17,46,86,62,18,84,87,64,19,67,20,51,70,21,35,72,73,57,54,55,22,44,94,48,23,56,89],image_file_machine_unknown:92,pad:[91,60,80,94],p!
 ai:[8,22,
 75,46],oneargfp:68,add32mi:68,exhaust:[62,20,71,14,26],assist:[75,53,41,56,12,97],executionengin:[20,52,82,71,40,41,42,43,10,11,12,13,14],capabl:[60,33,34,88,6,36,40,41,43,9,10,12,13,14,17,46,18,64,20,71,35,74],value_symtab_block:94,executeprogramandwait:3,runonmachinefunct:[64,71,46],appropri:[26,71,27,7,1,77,75,59,3,60,33,6,48,40,41,12,13,14,16,46,62,18,87,64,49,20,68,91,35,73,22,96,56,74],macro:[20,84,52,46,14,18,57,43,64,75,10,60,44],markup:[20,24,75,89],spadini:26,getobjfilelow:62,asmnam:46,req_llvm_librari:52,roughli:[51,85,91,71,73,77],release_22:20,execut:[26,53,0,71,28,1,58,30,75,3,82,60,61,32,88,6,36,95,81,40,41,42,43,8,10,11,13,14,16,17,63,46,62,48,18,84,87,64,65,67,20,51,52,70,21,35,72,73,93,44,91,56],speccpu2000:28,mo1:46,mul_ri:68,mygcprint:62,subblock:94,aspect:[25,34,52,36,14,21,71,87,42,62,22,9,48,11,60,16,17],mul_rr:68,flavor:[60,68,14,87],"125000e":60,xxxtargetmachin:46,critial:77,param:[75,6,62,1,96,30,10,11,12,13,14,17],cumoduleunload:6,sparcregisterinf!
 o:46,auto
 regen:[46,44],dclang_tablegen:7,mcregaliasiter:71,mov:[19,71,4,73,6],sk_specialsquar:85,va_start:60,libsfgcc1:7,mod:[26,68,46,35,14,64,60],cast_or_nul:14,llvm_tarball_nam:56,ifstream:6,qnan:60,server:[21,14],bb0_4:6,bb0_5:6,either:[26,53,28,1,77,75,60,61,33,34,80,6,48,38,81,42,43,8,9,10,11,71,14,15,16,83,46,86,62,18,84,87,65,66,68,70,35,73,55,22,94,91,56],bb0_2:6,physreg:71,mappingnormalizationheap:57,fulfil:[3,85],exitcod:1,fastcal:71,ascend:60,adequ:[62,30,52,46],confirm:75,llvmscalaropt:44,recomput:[64,14,35],ffi_library_dir:52,inject:75,toolkit:[14,6],ret_val:[10,11,12,13,17],broken:[20,68,81,46,32,1,8,22,64],fpmath:60,cuinit:6,selectaddrrr:46,cornerston:86,x32:4,dw_ate_address:87,island:88,image_scn_align_4096byt:92,llvm_targets_to_build:[30,52],livecount:62,terminolog:[20,75],hashtbl:[10,11,12,13,16,17],strip:[20,26,74,18,84,87,8,56,14],"0x3fe9":87,ymax:[12,41],mingw32:[96,71],overwrit:[18,44],legalact:46,savethi:4,x86inst:68,addrequiredtransit:64,svn:[20,52,69,0,28,5!
 4,77,8,30
 ,22,44,17],dw_ate_boolean:87,enough:[75,30,3,60,36,48,42,8,11,70,44,17,46,86,18,87,64,52,14,71,72,73,22,16,56,24],getmodrefinfo:35,buggi:[20,53],strawberri:20,possibl:[26,53,57,27,40,1,75,3,60,61,33,34,71,6,48,38,81,7,42,43,8,9,10,11,13,14,15,16,85,86,62,18,87,64,20,68,52,69,70,35,72,73,55,22,94,56,24,89,74],optnum:18,poolalloc:35,unusu:[34,62,71,72,9,56,14],sanitize_address:60,embed:[26,52,62,60,21,88,41,42,87,22,94,11,12,14],i32mem:68,machinefunctioninfo:71,threadloc:94,subprogram:87,deep:[26,75,85,89],simpletyp:92,calledcount:70,file:[26,57,0,27,40,28,1,75,58,77,78,30,2,31,59,3,82,60,81,61,32,5,79,71,6,36,4,38,39,7,41,42,43,8,88,37,76,10,13,14,15,44,83,63,46,47,74,18,84,33,87,64,65,66,67,50,93,80,20,68,89,52,69,90,70,21,53,92,55,22,48,94,95,23,56,24,97,25],emitvalu:71,proport:[56,18],fill:[57,35,36,14,18,53,40,41,42,43,64,75,48,96,60,38,87],again:[34,36,14,18,53,40,42,43,64,77,9,72,60,89,10,11,13,4,28],targetmanag:61,mangler:46,field:[68,34,94,80,46,35,62,25,1,87,57,75,9!
 ,60,48,59
 ,86,93,14,16],cleanup:[26,91,87,42,43,22,10,11,60],"0xc0de":94,riinst:68,architectur:[27,1,29,77,30,60,32,88,6,4,7,8,45,46,65,66,67,20,68,52,21,71,73],reextern:[36,40,41,42,43,10,11,12,13,17],resolut:[74,41],condens:60,sequenc:[26,71,0,75,4,35,60,40,41,12,13,14,16,46,86,62,64,67,68,91,57,92,48,25],ilist_trait:14,arrayidx:60,unload:64,descript:[26,53,76,1,58,78,75,31,37,32,5,79,80,6,85,4,39,71,14,83,63,46,47,18,84,87,96,65,60,66,67,50,93,20,68,69,90,70,35,92,73,91,94,95,23,56,97,74],escap:[20,68,35,62,60,41,4,74,12,25,24],getreturntyp:14,unset:25,ac_config_fil:44,represent:[71,75,60,32,33,34,35,36,48,81,41,43,9,10,12,14,16,17,46,62,18,87,64,68,51,21,57,73,24],forget:[62,75,85],mrm3m:46,forbidden:[64,3,75],dollar:29,dw_form_ref2:87,sunk:35,llvmdummyasmprint:46,dw_form_ref1:87,regno:71,mrm3r:46,dw_form_ref8:87,children:[56,85],edg:[32,26,70,71,4,64,60],image_sym_class_clr_token:92,at_byte_s:87,insertion_block:[11,12,13],daniel:87,brtarget8:46,immt:68,image_scn_lnk_comdat:92,r1!
 4:[68,71]
 ,r15:[68,71],r12:[68,71],r13:[68,71],straightforward:[34,85,46,36,87,81,40,41,42,43,64,9,10,11,12,13,14,17],r11:[68,72],fals:[26,75,7,1,29,2,59,60,85,35,36,95,81,40,41,42,43,11,14,46,62,18,87,64,67,20,70,21,56,74],offlin:[71,6],util:[26,0,27,58,30,31,32,80,35,14,46,47,62,18,63,93,67,20,68,52,57,22,23,56],fall:[26,75,46,62,14,18,40,41,42,43,60,10,11,12,13,4],type_code_integ:94,basereg:71,run_funct:[10,11,12,13],gcno:78,use_end:14,stderr:[26,36,48,40,41,42,43],quiet2:18,zero:[26,75,0,76,1,78,31,60,61,5,34,79,6,4,39,42,8,9,11,12,13,14,16,83,63,46,47,62,48,18,84,87,65,67,86,68,90,91,71,93,94,95,97],lawyer:22,val2:60,val1:60,val0:60,excit:[21,34,9,77],intptr:87,excis:60,abi:[20,26,88,80,46,6,91,87,71,7,29,43,54,34,9,10,60,81],worthwhil:14,abl:[53,0,60,34,80,35,4,81,7,41,42,43,9,10,11,12,71,14,46,86,62,18,87,64,20,68,51,70,57,73,22,23,89,74],invok:[26,75,60,61,6,4,40,43,8,10,13,14,16,46,62,48,18,64,20,52,70,71,35,94,91,56,74],abu:80,g0l6pw:20,hurdl:81,"public":[75,27,77,32,46,6,3!
 6,48,40,4
 1,42,43,14,85,62,18,87,64,96,20,57,22,23],exit5:6,cumemcpydtoh:6,valc:6,variat:[46,35,0,71,3,89],vala:6,sophist:[62,28,71,64,89,60],analysisusag:[64,35],memory_order_acquir:[60,73],movsx16rm8w:71,dequ:14,valu:[26,57,0,48,71,28,1,75,92,30,2,31,59,82,60,81,5,34,79,80,6,36,4,38,39,40,41,42,43,8,9,76,10,11,12,13,14,15,16,17,83,46,47,62,85,18,84,33,87,64,65,49,67,86,20,68,51,52,90,91,35,72,73,22,44,94,95,23,56,97,25],quieta:18,search:[20,26,46,0,62,4,18,1,87,42,70,59,51,32,60,56,23,11,14,21,44],unabbrevi:94,upcast:85,createfcmpon:[40,41,42],r12w:68,r12b:68,val_:13,r12d:68,codebas:[75,81],narrow:[20,33,75,86,35,95,53,73,70,14],iuml:71,quotient:60,primit:[68,34,86,62,60,18,41,73,75,9,94,12,14,87],transit:[71,43,64,23,10,60,59],establish:[46,62,71,43,22,10,60],memor:75,mylib:56,zeroiniti:60,liber:[22,75],mfloat:7,tackl:[10,13,40,81,43],two:[26,53,0,71,28,1,75,2,59,3,48,60,61,32,34,80,6,36,4,39,40,41,42,43,8,9,10,11,12,13,14,81,16,17,46,86,62,85,18,87,64,19,67,20,68,51,52,69,70,35,7!
 3,57,22,4
 4,94,91,56,25],unwindless:26,saptr:60,desir:[61,26,68,34,46,62,14,18,1,87,70,64,75,19,60,59,9,77,4],penultim:46,mozilla:21,reconfigur:[23,56,96,46],particular:[26,53,71,28,1,75,60,61,85,6,48,40,43,8,10,13,14,16,46,86,62,18,87,64,20,68,70,21,35,73,94,91,23,25],ultrasparc:[20,46],dictat:[72,75,14],none:[71,1,77,59,3,60,80,10,11,12,13,14,16,17,86,62,18,64,67,20,68,91,53,56],dep:[10,11,12,13],elsebb:[40,41,42],dev:[33,65,84,7,64,22,67,14],remain:[20,68,75,94,80,26,62,4,87,84,40,41,77,8,22,60,91,12,13,14],paragraph:[75,89],deb:7,binfmt_misc:20,def:[59,33,36,48,38,40,41,42,43,10,11,12,13,14,15,16,17,46,87,93,68,51,71,25],mergefunc:26,emiss:[46,62,71,40,13,60],sln:30,loopend:[13,40,41,42],mcobjectstream:71,minimum:[20,33,75,52,46,95,53,87,22,48,60,16],image_file_executable_imag:92,dw_ate_unsign:87,strlen:14,retcc_x86_32_ss:46,calltmp1:[36,11,42,17],calltmp2:[10,43],awkward:[18,75,86],secur:[26,18,21],programmat:[62,57,6],immutablemap:14,comfort:69,unittestnam:52,mapl:87,unswitch:2!
 6,csv:28,
 regener:[53,46,44,77],our:[71,0,75,34,6,36,48,38,40,41,42,43,9,10,11,12,13,14,15,16,17,18,87,64,20,52,53,54,22,74],"0x0000000000000002":82,add32mr:68,memory_order_seq_cst:[60,73],associ:[26,75,3,60,61,80,48,14,16,46,62,18,87,65,19,49,68,51,91,71,94,23],ccpassbyv:46,sse4:0,sse2:8,mislead:75,cs1:35,image_sym_dtype_arrai:92,rotat:[26,33,71],intermediari:14,"0x00002023":87,mydoctyp:57,through:[26,71,0,75,3,60,61,88,85,35,48,38,81,40,41,42,43,10,11,12,13,14,15,16,46,86,62,18,87,64,65,49,52,69,70,21,57,73,22,94,24,74],constants_block:94,suffer:[62,20],llvm_src_root:[56,28,44],patfrag:46,late:[71,60,46],pch:87,pend:[20,82,36,48,40,41,42,43,10,11,12,13,16,17],good:[26,71,27,28,29,77,75,3,33,88,6,36,95,81,40,41,42,43,10,11,12,13,14,46,18,87,64,20,68,70,21,35,22,24],pollut:[20,75],adventur:14,complain:[20,55,6],event:[52,14],mysteri:86,micro:75,token:[33,71,36,48,38,57,40,41,42,43,68,24,10,11,12,13,25,15,16,17],distdir:56,subsystem:[32,71,60],mm5:68,unequ:60,mm7:68,timelin:77,mm1:68,!
 idea:[26,
 75,27,28,29,60,33,34,36,48,40,41,42,43,9,10,11,12,13,16,17,18,87,68,22,94],mm3:68,mm2:68,image_file_machine_thumb:92,connect:[96,26,51,14,69],orient:[14,75,34,9,85],sparcgenregisterinfo:46,usedlib:[56,44],dw_tag_xxx:87,isref:68,print:[26,57,71,28,1,4,30,75,31,60,5,79,80,35,36,95,81,40,41,42,43,76,10,11,12,13,14,16,17,83,63,46,47,62,18,84,33,87,64,65,58,66,67,50,20,68,90,53,93,48,56,24,97],variable_nam:52,dagcombin:33,isinlin:87,cconv:60,mmx:[71,60,46],intregssubregclass:46,suspici:3,committ:22,cuctxdestroi:6,dw_tag_union_typ:87,omit:[26,5,71,79,76,84,42,64,65,48,31,11,50,93,60,16],buildmast:96,testfnptr:60,postdomtre:26,vmov:4,perman:[81,77],llvm_found:52,registerasmstream:71,printsth:26,exchang:14,argstart:18,done:[26,71,27,28,29,77,75,59,3,82,60,61,33,80,36,48,40,41,42,43,8,10,11,12,13,14,16,17,85,62,74,18,84,87,64,20,68,52,70,21,57,72,73,22,91,56,25],dylib:54,"0x00007ffff7ed40a9":82,stabl:[74,22,14,39],asmread:33,rootnum:62,functionindex:49,image_sym_type_uint:92,somewha!
 tspecials
 quar:85,least:[26,75,27,7,1,29,77,60,80,35,36,48,40,41,42,43,10,11,12,13,14,16,17,46,18,20,68,21,71,73,22,94],statement:[26,33,75,46,0,91,86,40,87,42,2,11,13,14],createpromotememorytoregisterpass:40,unalign:[21,73],cfe:[20,22,69,77],binop:[36,48,40,41,42,43,10,11,12,13,16,17],selector:[20,46,91,71,87,97,60],part:[26,75,1,30,60,34,85,35,36,95,38,40,41,42,43,8,9,10,11,12,13,14,15,16,17,46,86,62,48,18,87,64,20,68,52,70,21,71,73,22,94,91,23,56,74],pars:[71,1,30,59,60,61,32,33,36,48,38,81,40,41,42,43,10,11,12,13,15,16,17,46,18,87,68,51,74,57,94,25],toolset:[21,52],contrari:71,cyclic:20,i32:[26,34,46,6,62,14,71,40,87,89,8,2,9,60,91,59,86,13,4,81],"_tag":[10,11,12,13,16,17],horizont:4,i8mem:71,fpinst:68,constval:14,xxxtargetlow:46,uncontroversi:62,char6:94,consol:[10,32,71,89,43],built:[26,71,40,28,77,30,2,60,34,85,36,48,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,83,46,47,62,18,96,86,20,52,91,21,57,73,55,44,94,23,56],trip:[26,20,75,0],build:[26,75,27,40,28,1,29,58,77,30,82,60,32!
 ,34,80,35
 ,36,48,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,83,46,47,62,18,84,64,96,20,68,52,91,21,71,54,55,22,44,94,23,56,74],extractel:60,distribut:[20,68,75,6,32,28,1,7,77,8,30,22,95,56,82,64,81],previou:[26,71,27,77,75,60,33,80,6,36,4,81,40,41,42,8,11,12,13,14,16,17,46,64,20,21,57,72,73,94,48,23,89],chart:0,most:[26,53,27,40,28,1,29,77,30,75,31,85,3,60,61,32,33,34,71,6,36,4,81,7,41,42,82,8,9,11,12,13,14,16,17,83,63,46,86,62,18,84,87,64,49,20,68,89,52,69,91,35,73,54,22,44,48,23,56,24,97,25],cygwin:[20,30,71],charg:71,dereferenc:[60,86,14,26],"234000e":[36,17],resolvereloc:61,sector:3,runonmodul:64,gettypedescript:33,carefulli:[62,22,13,40,87],particularli:[75,46,4,63,73,64,60,14],fine:[75,52,38,21,86,40,15,30,3,13,14,18],find:[26,57,27,40,28,1,29,75,3,48,60,32,33,71,35,36,95,39,7,41,42,43,10,11,12,13,14,81,16,17,46,86,62,74,18,87,64,20,68,89,52,70,21,53,55,22,44,91,23,56,97,25],realmag:[12,41],fcpsgn:21,filesizepars:18,printmemoperand:46,"__nv_exp2f":6,hasctrldep:68,unus:[26,5,5!
 1,6,71,87
 ,75,23,3,14],express:[26,71,75,60,5,34,35,36,4,38,81,40,41,42,43,9,10,11,12,13,14,15,16,17,46,86,62,18,33,87,20,68,51,91,57,48],cheaper:14,restart:[64,96,14],target:[26,71,0,40,28,29,58,77,30,75,59,60,61,32,33,34,6,81,7,41,42,43,8,9,10,11,12,13,83,46,86,62,87,64,65,49,67,20,68,52,91,21,53,73,22,94,23,56,24,97],misnam:71,mycustomtyp:57,image_file_machine_arm:92,diloc:87,common:[26,57,71,30,75,3,60,61,32,33,34,80,6,85,48,81,40,41,42,43,9,10,11,12,13,14,16,46,86,62,18,87,64,93,20,68,51,91,35,73,22,44,94,23,56,89],intptrsiz:62,"__nv_isnanf":6,printout:[84,14],decompos:[33,22],atomtyp:87,reserv:[71,60,94,46,77],mrm1m:46,ccdelegateto:46,someth:[26,71,30,75,59,3,60,33,34,85,35,36,4,40,41,42,43,9,10,11,12,13,14,16,17,46,18,93,20,53,22,48,89,25],someti:60,debat:75,smallest:[53,60],subscript:[26,60,87,35],experi:[89,52,87,29,10,56,43],altern:[71,52,46,86,14,18,57,40,92,70,8,55,30,74,48,91,13,60,28,16,81],dw_at_apple_property_gett:87,bourn:[20,18,81],appreci:22,complement:[60,14,86],u!
 nrol:[26,
 60,0],popul:[91,20,33,1,6],alon:[62,48,18,71,8,22,16,56,44],tempor:60,densemapinfo:14,cpufreq:29,corei7:[8,0],simpli:[26,75,28,3,60,80,35,36,4,81,7,43,8,10,14,44,17,46,86,18,84,87,64,20,70,71,22,16,48,56,24],fldcww:71,point:[57,0,27,40,77,75,85,3,60,61,33,71,6,36,48,38,7,41,42,43,10,11,12,13,14,15,16,17,46,86,62,18,87,64,65,19,67,20,68,51,52,70,21,35,73,55,94,91,96,56,74],instanti:[61,68,57,85,46,18,1,64,14],alloca:[26,86,62,14,71,40,87,72,13,60],classof:85,shutdown:14,suppli:[20,34,57,60,87,53,29,77,64,74,9,94,91,24,14],setinternallinkag:14,throughout:[61,20,94,56,3,60],backend:[71,28,60,32,33,95,81,14,45,83,46,86,62,67,20,68,70,21,53,73,91,97],global_begin:[75,14],dovetail:[13,40],aarch64:[21,88],linkonce_odr:[60,94,6],reformat:24,multiclassobject:25,image_sym_class_extern:92,lto_codegen_add_must_preserve_symbol:74,unnecessarili:[64,35],gap:60,feat_jit:71,understand:[26,71,1,30,75,3,60,33,34,35,38,81,40,8,9,13,15,86,62,64,69,91,57,22,94,23,56,24,89,25],repetit:71,p20:6,is!
 storetost
 ackslot:46,raw:[61,5,71,79,90,76,18,84,49,24,28],unifi:[14,34,9,94,26],fun:[34,38,19,9,56,10,11,12,13,15,17],anonym:[26,68,75,46,36,48,87,40,41,42,43,64,30,22,10,11,12,13,25,16,17],everyon:[75,22,9,34],subsect:[89,14],propag:[26,51,20,60,18,71,91,3,14],lto_codegen_add_modul:74,mystic:[34,9],semispac:62,itself:[57,27,40,1,78,75,60,33,34,71,35,36,95,81,7,41,42,43,8,9,10,11,12,13,14,16,17,85,47,62,48,18,87,64,86,20,52,74,53,22,94,91,23,56,25],codegen_func:[10,11,12,13,17],ualpha:25,case_branch_weight:2,myseqel:57,incarn:33,benign:28,nameflag:87,sym:[27,93],keyt:14,moment:[62,60,73,17],aliassettrack:35,travers:[26,71,85,62,1,64,23,14],task:[33,62,91,77,3,14],n_bucket:87,epilogu:[62,21,60,46],parenthes:[75,48,1,8,60,16],uint32_t:[57,87],spend:1,instr_begin:13,ldc:21,obscur:14,ipconstprop:26,ldr:24,shape:[60,14,87,85,77],world:[20,34,62,38,87,64,30,9,89,60,15],depriv:14,stwu:71,cut:[18,46],shiftinst:75,snan:60,singlesourc:[8,28],"0b000000":46,restructuredtext:[20,89],objectbodi:2!
 5,win:[75
 ,14,35],rgm:64,bin:[20,27,95,18,7,8,55,30,44],"0x00001023":87,big:[68,75,46,27,14,71,40,29,41,8,36,22,67,12,13,60,17],judgement:22,fucomip:71,phinod:[75,40,41,42],ccassigntoregwithshadow:46,knock:75,semi:[23,62,34,9],constmerg:26,has_jit:23,aliasset:[46,35],often:[26,53,57,71,75,60,32,33,34,85,6,4,81,40,43,8,9,10,13,14,16,46,86,62,18,63,87,68,52,70,35,22,48,56],steensgaard:35,weakodrlinkag:14,dllimport:[60,94],back:[57,7,77,75,60,32,80,6,36,81,40,41,42,43,8,10,11,13,14,86,87,20,52,70,71,72,54,22,91],bach:3,"0x00002000":87,mirror:[20,62,41,42,11,12],densemap:14,sizeof:[34,6,60,81,9,14],sparcreg:46,scale:[62,71,75,85,86],arcmt:29,per:[26,71,28,1,31,60,80,6,43,10,14,85,62,18,87,64,93,52,74,21,57,73,94,91,23,56,25],bruce:14,substitut:[26,68,71,62,1,73,8,4],mathemat:[48,81,60,16,6],larg:[26,75,28,77,30,31,59,60,6,95,43,8,10,70,44,46,18,87,67,20,68,14,21,71,22,94,56],chandlerc:69,reproduc:[53,40,8,22,13,70],createentryblockalloca:40,bb0_1:6,intial:14,patient:64,c0c0c0:71,initials!
 e:37,addp
 drr:68,adc64rr:68,adc64rm:68,addpdrm:68,float_of_str:[10,11,12,13,15,16,17],deadtypeelim:[26,14],bugpoint:[20,5,32,95,53,58,64,30,22,26,70],impos:[60,71,14],constraint:[26,33,71,46,14,84,68,64,60],createfadd:[36,40,41,42,43],litconfig:1,forexprast:[40,41,42],disclosur:22,timberwolfmc:28,ostream:[75,14],nsz:60,frames:62,nsw:[60,86],inclus:[68,46,56,3,97,60,44],errno:[60,35],megabyt:[20,95],x86_fastcallcc:94,subst:[68,25],includ:[26,71,91,40,28,1,75,77,30,2,31,59,3,48,60,61,32,33,34,88,80,6,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,83,46,85,62,74,18,84,87,64,86,20,68,52,69,90,70,21,35,73,55,22,44,95,23,56,24,97,25],cptmp0:46,cptmp1:46,forward:[25,33,71,91,26,36,14,38,35,68,42,87,75,48,94,49,3,60,15,16,17],image_scn_align_1byt:92,tinyptrvector:14,reorgan:57,dwarfdump:87,int8_t:57,translat:[20,34,79,97,46,26,60,18,35,73,57,87,75,9,86,71,14,21,81],llvmfoldingbuild:10,codeblock:[62,20],concaten:[25,68,20,14,8,60],internaltarget:56,exported_symbol_fil:56,movsx16rr8w:71,dw_tag!
 _const:87
 ,movnt:60,v8i16:46,curr:15,xxxiter:14,utilis:21,somemap:75,codgen:17,isdigit:[36,48,38,40,41,42,43],prevail:80,singli:62,cmake:[20,52,47,32,7,64,96,30,23,89],crypt:22,sequenti:[4,71,91,94,60,14],declas:60,dw_at_apple_property_retain:87,llvm_target_arch:52,vg_leak:1,asymmetr:86,llvm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,89,90,91,93,94,95,96,97],mismatch:[36,81,40,41,42,43,10,11,12,13,60,24,17],globalvar:94,tok_numb:[36,48,38,40,41,42,43],libtool:[20,81,56],extrahelp:18,tok_extern:[36,48,38,40,41,42,43],image_sym_type_float:92,downcast:85,i16:[71,60,46,6],tradeoff:[10,62,73,43],required_librari:23,type_code_float:94,dwarfregnum:46,"0fb5bfbe8e":6,addescapingus:35,queri:[26,34,46,35,18,71,73,87,64,75,9,49,59,14,21],strex:73,regallocregistri:64,demangl:[66,93,87],pred_beg!
 in:14,pri
 vat:[75,85,46,6,14,87,96,94,23,60],sensit:[64,57,39,52,35],elsewher:[56,46],createtargetasminfo:46,granular:3,cumoduleloaddata:6,noop:60,"6666ff":71,priority_queu:14,immsubreg:46,vla:86,named_valu:[10,11,12,13,17],cudeviceptr:6,volum:[32,14,87,56],implicitli:[71,75,60,34,36,48,38,41,42,43,9,10,11,12,13,14,15,16,17,18,64,68,57,22,94,56],postord:51,ddd:80,pbqp:[71,65],"0x8":87,fortun:[34,40,42,43,9,10,11,13,14],veli:71,dw_virtuality__virtu:87,"0x3":14,"0x2":[14,87],"0x1":[14,87],"0x0":[14,94],toplevelexpr:[36,48,40,41,42,43,10,11,12,13,16,17],"0x4":87,leakag:21,accomod:6,append:[68,52,80,60,79,87,8,94,95,11,14,44],"0x1f84":66,resembl:86,unwound:60,access:[26,57,0,71,30,75,60,61,33,34,80,6,86,40,8,9,13,14,46,47,62,18,87,64,93,20,68,21,35,73,22,96],agg1:60,agg3:60,agg2:60,deduc:[26,68,25],camlp4:[15,16],sint:60,"0xk":60,objects:60,sink:[26,18,35],"0xm":60,"0xl":60,"0xc":94,getsourc:20,sine:[60,46],implicit:[68,75,46,60,71,42,11,14],"0xe":94,"0xd":94,remark:70,libc:[20,34,60,75,!
 22,9,14],
 myhead:87,fpregsregclass:46,cerr:6,implement:[26,57,27,71,1,75,85,3,82,60,61,32,33,34,80,6,36,48,38,86,40,41,42,43,9,10,11,12,13,14,15,16,17,45,46,47,62,18,87,64,65,20,51,74,21,35,72,73,55,22,91,23,56,24,25],foundat:64,domtre:26,standpoint:14,toshio:71,seamless:55,websit:[21,53,77],projlibspath:56,select_isd_stor:46,insertvalu:60,int32ti:14,trait:[57,14],image_scn_align_512byt:92,trail:[57,86,14,18,1,87,60],account:[20,85,69,62,22,96],scalabl:35,alia:[26,51,46,35,32,18,0,73,64,93,94,86,71,60],rdynam:[12,13,41,43],obvious:[26,33,71,86,35,27,14,18,38,75,68,64,22,48,60,15,16],unread:[75,73],fetch:[20,21,2,60,71],aliv:[64,26,71,14],abcd:94,sought:60,spruce:87,msvc:[71,14],formmask:46,serial:[56,33,57,44],everywher:[8,10,57,43],gcc:[26,71,0,7,28,77,75,60,32,34,88,95,81,40,9,13,14,46,86,18,84,87,65,20,91,21,53,73,55,22,56],rootcount:62,optyp:46,add32rm:68,inteldialect:60,llvm_lit_tools_dir:[30,52],usub:60,smovq:71,add64mr:68,powerpc64:88,getehframesect:61,inst:[26,68,14,46],getsi!
 gjmp_buft
 yp:75,llvm_include_dir:52,redund:[26,51,18,71,43,10,14],philosophi:[32,70,87,77,23,74],physic:[68,71,14,46],bind:[68,75,46,36,25,21,57,40,41,42,43,48,10,11,12,13,60,81,16,17],llvm_library_dir:52,correspond:[26,57,30,75,59,60,33,85,6,36,4,39,42,8,11,71,14,81,16,17,83,46,86,62,48,18,87,64,65,19,66,20,68,51,52,70,53,73,22,94,91,25],afterloop:[40,41,42,11,12,13],noitin:67,fallback:94,loopendbb:[40,41,42],c11b17:71,ptr_rc:71,symbolt:14,cpu_x86_64:57,cflag:[56,44],bunch:[38,28,81,41,43,10,12,14,15],acycl:[71,51,46,97],outputdebuginfo:18,labor:18,i1942652:60,typemap:33,immtyp:68,dag:[25,68,51,46,4,71,73,97,14],uncategor:18,passnam:84,dbgopt:87,spell:75,dai:[32,34,52,77,22,9,14],mention:[32,68,75,85,14,18,71,72,87,94,23,60],symbol1:19,nval:60,mylist:57,isimplicitdef:68,strive:[8,75],createfcmpult:[36,40,41,42,43],parseexpress:[36,48,40,41,42,43],mem2reg:[62,26,13,14,40],destarchivelib:56,dllvm_libdir_suffix:52,machinebasicblock:[71,14,46],add16ri8:68,lie:18,postdomfronti:26,intelli!
 g:[60,14]
 ,cmake_module_path:52,addtypenam:14,llvmbug:32,llvmsupport:[56,44],fluctuat:35,paramattr:94,twice:[20,27,14,43,64,30,10,56,60],createmyregisteralloc:64,rev:[10,11,12,13,16,17],ret:[26,68,81,86,6,36,60,71,40,87,42,43,8,62,72,10,11,13,4,89,17],stub:[88,71,14,46],typenam:[33,14],rel:[75,27,28,1,77,31,60,32,4,81,42,11,14,44,62,18,19,71,72,73,94,24],rem:71,rec:[10,11,12,13,15,16,17],barrier0:6,ref:[20,68,26,6,36,48,35,40,41,42,43,64,10,11,12,13,16,17],defens:22,math:[75,6,18,0,38,41,87,65,21,67,12,60,15],clarifi:[73,87],insid:[26,75,27,28,1,60,32,7,82,8,71,14,44,85,47,62,87,64,20,68,57,94,25],qux:60,attrbuild:49,standalon:[23,71],invas:[22,57],bleed:32,indent:[57,75,89],re2:21,image_file_machine_armv7:92,retain:[51,14,18,81,87,64,22,56,60],ud2:71,suffix:[64,33,75,52,80,46,36,14,18,1,8,79,65,76,56,60,17],targetregsterinfo:71,pgr:32,secondlastinst:46,facil:[75,35,62,18,1,87,30,56,3,81,44],misoptim:2,target_data:[10,11,12,13],messag:[26,53,52,80,90,20,32,18,1,75,70,57,64,22,91,4,28!
 ],llvmuse
 dlib:56,comparefp:68,debuginfo:[8,26,87],ogt:60,mytool:56,s32:6,"__objc_imageinfo":60,initialize_ag_pass:64,image_file_aggressive_ws_trim:92,source_i386:66,prune:26,structur:[26,71,0,28,58,30,75,60,61,34,80,35,36,4,38,39,40,41,42,43,8,9,10,11,12,13,14,15,16,17,46,47,62,48,18,87,64,49,86,68,51,70,21,57,73,94,91,23,56,89,74],charact:[1,60,80,36,4,38,40,41,42,43,8,10,11,12,13,14,15,16,17,18,87,93,68,71,94,48,56,24,25],"123mb":18,then_val:[11,12,13],plaintext:20,deprec:[8,28,14,87,46],ispack:94,have:[26,53,57,27,40,28,1,29,77,30,75,31,59,3,48,60,81,61,32,33,34,71,6,36,4,38,39,7,41,42,43,8,9,10,11,12,13,14,15,16,17,46,86,62,85,18,84,87,64,96,93,19,49,80,20,68,52,69,70,21,35,72,73,55,22,44,94,91,23,56,24,89,25],tidi:64,min:[27,60],mid:60,in64bitmod:71,sspreq:[60,94],mix:[86,0,4,71,55,74,23,14],builtin:[20,6,18,1,40,41,47,73,64,94,12,13,60,21,16],startval:[40,41,42],p3i8:6,mit:22,analysi:[26,0,28,31,59,60,32,33,35,36,81,40,41,42,43,10,13,86,62,84,87,64,20,51,52,74,71,73,25],poison!
 _yet_agai
 n:60,unless:[26,75,28,60,5,4,81,40,42,8,11,13,14,46,86,18,64,65,20,90,70,22,91,56,89],preliminari:[26,46],setpreservescfg:64,eight:[71,60,80],llvm_shutdown_obj:14,transcript:[10,43],memorydependenceanalysi:35,arm_aapcs_vfpcc:94,gather:[0,91,18,8,22,23,14,44],request:[61,68,80,69,62,74,22,94,91,60],image_file_machine_mipsfpu16:92,getdirectori:87,institer:14,occasion:[62,94],addpassestoemitmc:61,addtmp:[36,40,41,42,43,10,11,12,13,17],dllexport:[60,94],ifconvers:46,text:[75,28,4,33,34,80,38,8,9,15,46,18,93,19,68,52,69,21,71,92,22,56,24,89,25],ifconvert:46,sanitize_thread:60,setter:[14,87],dw_tag_pointer_typ:87,textual:[68,51,71,43,8,65,10,24,81],loweroper:46,categor:[26,18,46],src_root:20,"__morestack":72,cpunam:[67,65],inferior:82,data64bitsdirect:46,print_newlin:[10,11,12,13],lower_bound:14,litvalu:94,sysv:93,disagre:60,bear:4,is_base_of:85,image_sym_class_member_of_struct:92,increas:[26,75,0,36,53,22,67,74,17],gcwrite:[62,60],at_end:[10,11,12,13,17],callpcrel32:68,integr:[2!
 6,81,52,4
 5,62,74,18,1,47,64,58,23,60,21],printlabel:46,conform:[20,1,62,14,21,57,60,81],project_nam:44,emitfnstart:71,dw_tag_file_typ:87,reform:75,pattern:[33,71,46,6,36,4,18,38,68,58,73,8,75,60,56,86,14,15,16,87],boundari:[26,71,60,87,94],"__builtin_msa":21,callgraphsccpass:64,progress:[51,52,38,1,77,22,88,71,14,15],"0b100":68,"0b101":68,switchtosect:71,nvptx64:6,phase3:27,plugin:[32,62,95,21,84,55,67],equal:[26,68,81,85,46,35,60,18,71,40,41,42,2,94,48,11,12,13,14,16],instanc:[75,27,1,77,4,61,32,34,85,36,48,8,9,71,14,16,17,46,62,18,87,64,68,52,57],valuelistn:25,comment:[26,71,75,60,34,36,4,38,40,41,42,43,8,9,10,11,12,13,14,15,16,17,85,47,62,68,69,21,57,22,48,23,56,25],guidelin:[14,75,7,89],setmcjitmemorymanag:61,v2i32:60,defini:59,addresssanit:60,autovector:0,component_1:23,component_0:23,assert:[64,26,53,52,46,20,27,18,6,40,29,41,54,75,77,56,57,71,14,81],determinist:[70,71,14,35],multi:[50,32,18,74,21],plain:[62,64,89,14],defin:[26,53,91,57,40,28,1,77,75,31,59,3,60,32,33,34,71,6,3!
 6,4,38,81
 ,7,41,42,43,8,9,10,11,12,13,14,15,16,17,45,46,47,62,48,18,87,64,93,19,86,80,20,68,52,74,35,73,54,22,44,94,95,23,56,89,25],deem:[33,53,60,77],operandtyp:46,noimplicitfloat:[60,94],helper:[61,75,46,35,36,48,18,1,40,41,42,43,8,12,13,14,15,16,17],almost:[20,33,51,62,21,71,75,3,14],irreduc:26,maystor:68,isreturn:68,build_alloca:13,substanti:[75,35,21,43,10,60],prose:75,unneed:[13,40],llvm_enable_zlib:52,japanes:20,codepath:73,infer:[71,85,47,57,75,65,67,56],backtrac:71,cmakecach:52,valueopt:18,dealloc:[62,14],default_branch_weight:2,sm_30:71,image_scn_align_32byt:92,sm_35:71,mcsection:71,center:71,neural:28,nevertheless:60,getopcod:[14,46],builder:[20,32,36,48,21,40,41,42,43,96,49,10,11,12,13,16,17],dfpregsregisterclass:46,setp:6,choos:[71,59,60,36,95,38,42,43,10,11,14,15,44,17,46,18,87,64,67,52,53,22,16,48,96,56],setvector:14,usual:[75,28,31,60,33,34,85,35,4,8,9,70,46,86,62,18,84,87,64,20,68,52,14,71,72,73,55,22,94,56,89,74],unari:[34,38,40,41,9,12,13,25,15],tarjan:64,getglobal!
 list:14,n
 umberexprast:[36,48,40,41,42,43],memmov:60,settabl:56,p19:6,tough:[48,16],cortex:[7,29,49],gendfapacket:71,adt:[20,14,52],tight:74,add_cfg_simplif:[10,11,12,13],uwtabl:[60,87],add:[26,53,91,57,27,40,28,1,75,48,59,3,82,60,32,33,34,71,6,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,46,86,62,85,18,84,87,64,49,80,20,68,52,69,70,21,35,73,54,22,44,94,95,96,56,25],adc:[26,51,14,35],citizen:14,dced:14,match:[26,71,28,1,4,75,60,5,85,36,95,38,39,43,8,10,11,12,13,14,15,16,17,46,86,62,18,33,87,64,58,20,68,70,57,73,44,94,91,23,56,74],apple_typ:87,hypersparc:46,llvm_yaml_is_document_list_vector:57,image_file_net_run_from_swap:92,punctuat:[75,25],realiz:[10,12,43,33,41],llvalu:[10,11,12,13,17],insert:[26,75,3,60,80,35,36,40,41,42,43,10,11,12,13,70,17,46,62,18,87,64,65,67,14,71,73],like:[26,57,27,40,28,75,29,30,2,85,3,60,81,61,33,34,71,6,36,4,38,39,7,41,42,43,8,9,10,11,12,13,14,15,16,17,46,86,62,74,18,87,64,93,80,20,68,52,69,70,21,35,72,73,54,22,44,94,48,23,56,24,89,25],studi:44,sstrea!
 m:75,regi
 steranalysisgroup:[64,35],inferenc:71,c1x:[60,73],soft:[3,87,67],crawler:62,unreach:[26,5,62,81,40,41,42,43,10,11,12,13,60],convei:[91,60],registermcobjectstream:71,proper:[75,85,46,14,1,73,60],getparamtyp:14,release_1:20,tmp:[86,62,60,71,40,87,43,8,66,10,13,4,44,14],nvcc:71,add_instruction_combin:[10,11,12,13],llvmrock:75,webcl:21,esp:[68,71,4],"0th":86,nvcl:6,"__internal_accurate_powf":6,dw_tag_structure_typ:87,image_scn_lnk_nreloc_ovfl:92,dce:[26,18,33,95],noisi:[26,22,14],host:[61,20,75,52,6,62,60,21,71,7,29,8,56,14,81],although:[64,20,33,71,52,85,47,62,18,1,41,73,8,30,75,94,23,56,89,14,17],isfloatingpointti:14,simpler:[26,33,71,40,41,87,12,13,60],about:[26,53,0,27,40,28,1,29,77,30,75,31,59,3,82,60,61,32,33,34,71,6,36,4,38,81,7,41,42,43,9,10,11,12,13,14,15,16,17,46,86,62,85,18,63,87,64,65,50,93,80,20,68,52,69,90,74,21,35,73,54,22,48,94,91,96,56,24,89,25],actual:[26,71,27,28,1,75,85,3,60,61,34,80,35,36,4,38,81,40,41,42,43,8,9,10,11,12,13,14,15,16,17,46,86,48,18,87,64,96,!
 20,68,70,
 57,22,44,94,91,23,56],endcod:75,madechang:62,discard:[60,18,71,19,20],addendum:32,upward:1,guard:[60,75,14,56],been:[26,75,91,27,1,77,31,3,82,60,61,33,34,80,6,36,4,81,41,42,43,9,10,11,12,14,16,17,46,86,62,48,18,84,87,64,20,68,70,21,71,73,22,44,95,56,89,25],ifexpr:[40,41,42,11,12,13],leverag:21,rcx:68,eh_fram:91,naveen:26,rcn:27,getelementptrinst:14,biggest:71,log10:[60,0],functionlisttyp:14,unexpect:[75,28,40,30,22,13,60],f4rc:71,bur:51,brand:64,machinefunctionpass:[64,46],bui:29,uninstal:[56,52],oauth:69,inlin:[26,75,60,34,6,38,81,42,43,9,10,11,71,14,18,84,87,64,66,20,69,91,21,57,22],bug:[71,27,40,28,4,77,30,75,60,32,5,34,36,95,39,7,8,9,13,14,81,17,85,93,20,68,70,21,53,22,25],wise:60,mcpu:[46,6,7,8,65,67],wish:[20,33,53,52,46,86,18,1,68,77,56,14],srcarglist:60,rc1:[27,77],rc2:[27,77],emitjumptableinfo:46,pin:60,hashfunctiontyp:87,dure:[62,20,33,46,0,27,14,18,71,87,77,8,36,74,32,91,59,60,28,17],pic:[75,46,53,7,67,71],int64_t:[57,14],probabl:[20,34,86,60,18,56,75,29,42,8,22,!
 9,44,31,1
 1,48,71,14,81,16],llvm_append_vc_rev:52,oak:87,detail:[57,0,71,77,30,75,31,3,60,32,34,80,35,36,38,81,40,41,8,9,12,13,14,15,44,17,46,86,18,87,64,96,20,68,51,52,70,21,53,72,73,22,91,23,56,24,74],virtual:[26,75,1,3,4,46,35,36,48,81,40,41,42,43,13,14,17,83,85,62,87,64,49,71],out:[26,57,27,40,28,1,29,77,30,75,31,59,3,60,33,34,71,35,36,48,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,46,47,62,18,63,87,64,66,67,86,80,20,68,52,70,21,53,73,55,22,94,91,56],apple_objc:87,zeroormor:18,winzip:30,al_aliasset:46,frontier:[26,13,40],afterbb:[40,41,42],binoprh:[36,48,40,41,42,43,10,11,12,13,16,17],predsens:59,unshadow:[40,41,42,11,12,13],vliw:[71,97],twoaddressinstructionpass:71,eliminateframeindex:46,poorli:75,getreginfo:71,undef:[14,81,4,73,60],isvi:46,spec:[25,57,14,28,53,87,77,8,60],add_incom:[11,12],concret:[26,68,85,46,18,71,43,64,94,10,77,14],under:[75,1,60,34,6,95,81,8,9,16,45,46,18,64,23,20,71,55,22,48,96,56],runhelp:75,playground:[38,15],everi:[26,71,27,28,1,75,29,77,2,3,60,32,34,6!
 ,48,81,40
 ,42,43,8,9,10,11,13,14,85,62,18,84,87,64,20,68,51,70,35,72,73,22,94,23,56],risk:77,f934:46,rise:75,risc:[73,46],upstream:20,printfunctionpass:26,llvm_yaml_strong_typedef:57,mygc:62,isv9:46,isdefinit:87,x86_64:[20,71,27,60,21,57,7,29,8,66,4],zlib:[20,52],x86call:68,xxxinstrinfo:[59,46],naiv:26,direct:[57,27,1,4,77,75,3,60,95,40,13,14,46,18,87,64,19,68,51,71,56,97],nail:[11,42],xor32rr:71,llvmtransformutil:44,blockinfo:94,profileinfo:26,blue:87,hide:[18,75],introspect:[24,74,49],foundfoo:75,poison:60,hi16:71,conduct:22,postdomin:26,functiontyp:[36,40,41,42,43,14],studio:[20,75,52,32,21,30],debugg:[61,26,34,20,64,32,71,87,42,70,8,75,9,11,93,82,60],path:[26,75,7,28,1,30,80,6,95,81,40,8,13,14,44,83,47,62,64,65,67,20,52,91,35,73,55,56,97],dlopen:[64,56],forum:[32,60],typebuild:14,mypassopt:64,anymor:[64,26,21,14],pointcount:62,precis:[26,85,46,35,36,48,38,71,73,87,65,67,60,15,16,17],portabl:[32,34,62,14,21,1,75,9,56,3,71,60,81],nontempl:18,printd:[34,40,41,9,12,13],strai:8,printf!
 :[20,70,8
 1,40,41,87,55,30,74,12,13,60],ymin:[12,41],smallsetvector:14,describ:[26,71,28,1,58,77,75,59,60,61,32,33,34,80,6,36,48,38,86,41,42,43,9,10,11,12,14,15,16,17,46,47,62,85,18,87,64,65,19,20,68,91,21,53,22,44,94,23,56,74],would:[26,57,0,77,30,75,31,3,60,34,35,36,4,81,41,42,43,8,9,10,11,12,71,14,16,17,85,86,62,18,87,64,96,65,20,68,51,53,73,55,22,44,94,48,23,56,89,25],gcstrategi:62,asset:21,addincom:[40,41,42],include_directori:52,must:[26,53,57,40,28,1,77,75,85,3,60,61,33,71,6,36,4,81,7,41,42,8,11,12,13,14,44,17,46,86,62,18,87,64,19,80,20,68,51,52,74,21,35,73,22,94,91,23,56,89,25],shoot:[10,43],join:[64,60,14,67],getnumoperand:14,image_file_machine_mipsfpu:92,runfunct:[14,82],introduc:[26,68,85,46,35,60,71,40,41,42,73,77,11,12,13,4],overrid:[76,26,68,71,85,46,20,14,18,35,64,65,67,56,60,25],"__data":60,virtreg2indexfunctor:71,inadvis:86,registerehfram:61,dw_tag_label:87,attract:[62,22],makellvm:20,enc:87,end:[26,53,0,27,40,28,77,75,85,3,48,60,81,32,34,79,71,6,36,4,38,39,7,41,42,4!
 3,8,9,10,
 11,12,13,14,15,16,17,46,86,62,74,18,84,87,64,65,19,80,20,68,52,70,35,57,22,44,94,91,56,89,25],r10:[68,71,72,6],pipefail:[21,1],concis:[18,71,75,86],hasnam:14,env:27,frameless:71,ancestor:[60,85],collaps:60,dialect:[24,60],mess:[20,73,26],befor:[26,53,0,27,40,28,77,30,75,85,60,61,33,34,71,6,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,46,86,62,48,18,84,87,64,67,80,20,68,52,70,35,73,57,22,91,56],getreservedreg:46,const_iter:14,parallel:[20,51,52,0,21,1,54,96,56,71,60,44],bootstrap:20,r_arm_thm_movw_abs_nc:7,perform:[26,71,0,27,28,1,29,77,75,3,60,61,33,34,80,6,36,81,40,8,9,13,14,44,17,46,86,62,18,84,87,64,65,20,68,51,52,70,21,35,73,22,91,23,56,74],includedir:[56,83],environ:[64,20,71,52,26,62,60,18,1,73,54,55,56,3,14,21,81],reloc:[61,71,46,53,7,75,19,67,50],enter:[20,71,69,70,1,87,43,48,94,91,10,14,16],exclus:[18,60,73],composit:[14,87],over:[26,75,60,34,35,36,38,81,40,41,42,9,11,12,13,70,15,17,85,86,62,74,68,51,69,14,71,94,25],commasepar:18,imul:71,blatent:[13,40],option!
 al_dir:[5
 6,44],str_offset:87,rfunc:5,parseparenexpr:[36,48,40,41,42,43],align32bit:94,imm:[24,71,68,46],image_sym_type_dword:92,tramp:60,replaceinstwithinst:14,getorinsertfunct:14,llvmbitread:44,comprehens:[8,20,21,26],settruncstoreact:46,cfgsimplifi:14,getlazyresolverfunct:46,echo:[20,89,56],const_global_iter:14,"0x60500020":92,exampletest:1,modrefresult:35,each:[26,53,57,27,71,28,1,77,75,59,3,48,60,61,32,33,85,80,6,36,4,38,81,40,41,42,43,8,10,11,12,13,14,15,16,17,83,63,46,86,62,74,18,84,87,64,65,49,67,50,93,20,68,52,90,70,35,73,54,22,44,94,91,23,56,25],use_begin:[75,14],sk_lastsquar:85,prohibit:[74,73],abbrevwidth:94,gprc:71,ptrtoreplacedint:14,tag_pointer_typ:87,goe:[57,52,71,46,6,62,14,53,40,73,87,91,56,24,13,60,81],newli:[26,36,41,42,43,55,10,11,12,14,17],laid:[10,60,71,14,43],adjust:[75,46,81,40,13,60,44],rs2:46,got:[71,18,53,43,10,14,21],unimagin:26,frem:60,debug_pubnam:87,precaut:14,threadidx:6,free:[64,34,88,35,36,21,38,75,73,43,8,62,51,9,77,10,56,71,14,15,17],getfilenam:87!
 ,rangelis
 t:25,galina:96,precompil:6,distract:22,puzzl:53,r9d:68,r9b:68,filter:[8,59,60,91],addrspac:[60,6],rais:[26,62,60,70,91,10,11,12,13,14,15,16,17],runtimedyldimpl:61,r9w:68,differnt:57,onto:[20,62,71,87,77,22,60],rang:[75,60,32,35,38,41,43,10,12,14,15,85,86,62,18,87,64,65,68,70,21,71,91],neededsafepoint:62,xnorrr:46,wordsiz:62,rank:26,restrict:[25,33,81,86,0,62,60,18,71,73,87,64,22,19,91,14],datastructur:14,alreadi:[57,71,75,60,33,85,35,36,38,81,40,41,42,43,8,10,11,12,13,14,15,44,17,46,62,18,87,64,19,20,52,21,53,72,22,89],hackabl:[38,15],createcfgsimplificationpass:[40,41,42,43],primari:[32,35,36,60,38,71,40,41,42,43,62,48,10,11,12,13,14,15,16,17],llvmsrc:44,rewritten:71,exp2:[60,0],top:[26,71,28,1,75,60,34,35,36,4,81,40,41,42,43,8,9,10,11,12,13,14,16,17,86,47,18,87,64,67,20,52,91,57,55,22,44,94,48,23,56,25],seq_cst:[60,73],downsid:14,toi:[34,36,48,38,40,41,42,43,9,10,11,12,13,15,16,17],ton:[38,15],too:[57,29,30,75,3,60,34,48,40,8,9,13,70,16,18,64,20,68,52,14,71,55,56],tom:57,!
 toc:71,in
 itialize_native_target:[10,11,12,13],createalloca:40,tool:[26,53,27,1,58,78,30,75,31,3,82,60,81,32,5,6,36,4,38,39,42,43,8,37,10,11,71,14,15,44,17,83,46,47,62,18,63,87,64,19,50,20,68,51,52,69,70,21,35,54,55,22,94,95,23,56,74],usesmetadata:62,took:[36,40,41,42,43,10,11,12,13,17],targetgroup:23,conserv:[75,35,62,60,73,77,64,74],dw_at_apple_property_nonatom:87,expr:[5,97,48,40,41,42,10,11,12,13,16,17],globalalia:64,fashion:[20,33,60,46],ran:64,ram:96,dw_tag_string_typ:87,lbd:45,further:[20,75,52,94,46,86,62,4,87,30,22,60,91,56,14,44],rax:[68,46],adc32mi:68,unresolv:[56,1,9,34],thorough:75,sk_somewhatspecialsquar:85,xfail:[8,28,1],contact:[64,96,21,22,44],thoroughli:[11,42],adc32mr:68,atom_count0:87,though:[26,75,28,60,33,36,48,40,42,8,10,13,14,16,17,85,86,62,18,87,64,91,71,73,74],visitfab:33,glob:5,"__apple_typ":87,bss:67,sethi:46,bsd:[56,93,22,80],"0x00000002":87,"0x00000003":87,"0x00000000":87,"0x00000004":87,"0x00000009":87,flow:[26,57,0,71,75,60,61,34,6,36,48,38,39,40,41,42!
 ,43,9,10,
 11,12,13,14,15,16,17,45,46,64,70,21,35,22,91,89,74],roots_begin:62,getorcreatefoo:14,abbrev:94,declar:[26,71,75,3,60,33,85,6,36,4,38,81,40,41,42,43,10,11,12,13,14,15,16,17,46,18,87,64,20,68,35,94,48,23,56,25],radix:75,prepend:[14,87],"_build":20,saga:[11,42],isnorm:21,"0x70b298":64,random:[75,14,1,58,70,22,37,95,60],radiu:85,radic:71,dfapacket:71,absolut:[20,33,75,46,60,18,7,64,4],bitcoderead:33,createreassociatepass:[40,41,42,43],configur:[75,0,27,28,1,29,77,30,3,4,32,6,81,7,8,14,44,46,64,96,65,20,71,54,55,22,23,56],nextprec:[36,48,40,41,42,43],multiclassid:25,getreg:[71,46],llvm_yaml_is_sequence_vector:57,label0:60,twiddl:[40,41,42,43,10,11,12,13,60],watch:[22,75],image_scn_type_no_pad:92,pointertyp:14,report:[26,27,28,1,77,31,60,32,35,36,8,14,17,63,87,64,65,20,70,53,55,23,74],reconstruct:[87,80,86],sparclet:46,aliasanalysisdebugg:35,start_val:[11,12,13],sunit:71,isoper:[40,41],basicblock:[26,75,20,36,40,41,42,43,64,62,11,14],stringwithcstr:87,lto_module_is_object_file_fo!
 r_target:
 74,habit:[26,75],nuw:60,memory_order_releas:[60,73],storesdnod:46,attributeset:49,bitvector:14,nul:[12,14,41],num:[62,46],libsampl:44,corrupt:[91,34,9,80],hopefulli:[26,75,35,18,73,43,64,94,10,89],databas:[34,9,57],image_file_machine_mips16:92,discoveri:1,valb:6,tolmach94:62,mul:[26,68,6,36,4,86,60,17],approach:[26,75,85,46,86,70,18,71,72,87,8,74,59,14,21],weak:[74,81,40,73,93,94,13,60,14],protect:[75,46,60,21,71,73,87,94,3,14],notatom:73,critedge1:6,fault:[20,22,95],r7xx:88,mybarflag:57,lto_module_cr:74,kwd:[10,11,12,13,15,16,17],coldcc:[60,94],max_int_bit:14,trust:[22,75],nake:[60,94],xemac:[20,56],nonsens:[13,40,89],getglobalcontext:[36,40,41,42,43,14],accumul:[26,0,10,11,12,13,16,17],oldbind:[13,40],quickli:[84,20,53,80,32,62,70,18,35,54,87,8,30,75,56,3,71,60],getsymbolt:14,"0x000003bd":87,msec:0,xxx:[28,75,4,46],uncommon:91,expected_v:60,testcaselength:14,craft:14,"catch":[86,36,91,18,43,22,10,82,60,17],smallbitvector:14,image_sym_class_undefined_stat:92,simplevalu:25,!
 bitcod:[2
 6,71,76,58,30,31,60,32,5,79,80,6,95,39,14,81,83,63,84,33,64,65,67,20,90,70,53,55,93,94,56,74],basic_p:68,basic_r:68,curvar:[13,40],cumemalloc:6,mcsymbol:[62,71],p_reg:71,image_sym_type_mo:92,svr4:80,vk_argument:75,registermypass:64,tediou:57,list_property_nam:23,suggest:[64,75,35,60,7,54,22,14,44],ilp32:[34,9],disposit:22,dooneiter:70,complet:[26,71,1,58,77,30,75,3,60,61,32,6,36,95,38,40,41,42,43,8,10,11,12,13,15,16,17,46,62,18,84,87,64,20,68,51,91,21,35,22,94,48,56,74],sched:[67,71,46],darwin9:4,binaryexprast:[36,48,40,41,42,43],build_ret:[10,11,12,13,17],introductori:32,property_nam:23,redefin:[68,36,40,41,12,13,17],sethiddenflag:18,image_scn_mem_not_pag:92,bugzilla:[8,27,22,77,32],everyth:[77,30,60,32,6,36,48,38,41,42,8,11,12,15,16,17,86,18,64,20,71,73,55,56],spencer:3,addend:60,makevehicl:75,finalizememori:61,"0x01":68,meta:[62,14,21,71,87,60],shorthand:68,expos:[20,71,26,60,18,1,40,35,70,64,74,73,3,75,13,14,21],interfer:[91,86],elf:[61,88,71,87,50,60],"0x7fffffffe018":!
 82,els:[2
 6,71,0,28,30,75,3,60,33,34,6,36,4,38,40,41,42,43,8,9,10,11,12,13,14,15,16,17,46,18,67,68,57,55,22,48],at_artifici:87,explanatori:28,elt:60,xnor:46,setloadxact:46,disableencod:68,howtosubmitabug:20,"______________________":14,thumb2:[71,49],gr64:71,end_:[11,12,13],apart:[14,35],unindex:46,arbitrari:[75,1,60,34,35,36,48,38,86,40,43,9,10,13,14,15,16,17,46,47,62,18,87,64,68,91,71,22,94,23],contradict:22,build_add:[10,11,12,13,17],hunk:68,hung:14,ifexprast:[11,40,41,42],llvm_use_sanit:52,excerpt:6,"000000e":[36,40,42,43,10,11,13,17],enumcas:57,indirect:[60,71,14,81,46],successfulli:[35,53,7,41,77,96,12],live_end:62,icc:[87,0],guaranteedtailcallopt:60,armv7:29,armv6:29,unstabl:[27,29],registerclass:[68,71,46],core:[64,20,68,40,88,35,36,60,21,7,29,42,41,8,96,22,23,43,14,87],compiler_rt:22,tour:[48,16],subtmp:[36,40,41,42,43,10,11,12,13,17],cast210:60,meyer:75,chapter:[32,34,36,48,38,40,41,42,43,9,10,11,12,13,15,16,17],min_int_bit:14,canreserveresourc:71,surround:[60,86,4,73,26],un!
 fortun:[3
 4,42,43,64,75,9,10,11,14],distinct:[26,68,94,86,35,36,4,71,8,60,23,56,14,17],g_inlined_into_f:66,algo:64,bitsetcas:57,approxim:[26,30,1],produc:[26,57,40,1,4,75,31,3,60,34,71,36,95,39,7,42,43,9,10,11,13,14,81,17,63,46,86,62,84,87,64,65,80,20,70,21,53,73,55,22,23,56,24],addpsrr:68,instcombin:[26,81,14,70],regist:[26,57,0,71,4,82,60,61,6,36,95,81,40,41,42,43,10,11,12,13,14,17,46,62,84,64,65,67,20,68,91,21,35,22,96,24,97],encod:[32,68,71,80,46,20,91,14,57,40,87,65,94,31,67,13,60],othervt:46,parse_bin_rh:[10,11,12,13,16,17],createfmul:[36,40,41,42,43],objectso:56,storag:[6,62,14,18,71,87,94,60],addpsrm:68,git:[20,52,69,55],x86targetasminfo:46,"class":[26,71,75,59,3,60,61,32,33,34,85,35,36,48,40,41,42,43,9,10,13,14,16,17,46,62,18,87,64,49,20,68,51,57,54,94,56,24,97,25],stuck:[34,9],reli:[75,86,0,27,14,71,40,87,8,62,22,74,56,13,60,81],gid:80,image_sym_type_enum:92,synthesiz:21,sitofp:[36,60,17],head:[20,68,75,62,25,21,89,60],medium:67,modulepass:[64,35,6],p0i32:4,heap:[34,35,62,6!
 0,57,40,5
 1,9,72,13,14],icmp:[60,14,94],counsel:22,attr:[60,87,94],fundament:[32,33,75,46,86,60,18,71,68,64,49,97,25],opensus:20,autoconf:[20,81,46,44,77],loadregfromstackslot:[71,46],adorn:89,uncoop:62,trig:46,eieio:60,"_ztv3bar":4,rgpassmanag:64,assembl:[81,76,28,58,30,31,60,32,33,79,6,39,43,8,88,10,45,46,86,62,84,65,19,67,20,68,21,71,72,22,94,23,56,24,97],pipe:[3,21,1,4],readonli:[26,60,87,94],tirefactori:75,tip:[20,34,32,38,64,22,9,70,15],tid:6,node:[26,57,0,71,2,31,60,32,33,85,6,36,48,40,41,42,43,10,11,12,13,14,16,17,46,87,64,51,35],smallset:14,consid:[26,75,27,29,59,3,60,34,35,95,38,81,40,42,82,9,11,13,14,15,16,85,86,62,18,87,64,93,68,51,71,94,48,56,25],idx3:86,global_dtor:60,idx1:[60,86],idx0:60,uniformli:75,libcuda:6,faster:[20,75,80,14,21,29,70,91,96,56,60,87],bullet:[81,85],freebench:28,serious:30,offsetof:[34,9],backward:[0,62,18,94,49,14],getintrinsicid:62,focus:[8,71,39,14,46],catagor:26,signific:[33,75,35,62,14,38,41,42,64,22,74,94,12,60,15],llc:[64,20,71,46,6,62,95,53,!
 72,58,70,
 8,30,65,67,56,4],n32:60,row:59,addregisterclass:[71,46],readabl:[20,71,79,90,26,76,63,57,73,87,64,75,31,56,89,60],pop_back:[18,14],sourc:[26,53,57,27,28,1,58,77,30,75,3,82,60,32,34,6,36,4,81,7,43,8,9,10,71,14,44,17,83,46,47,62,18,84,87,64,65,66,86,20,52,70,21,35,22,95,23,56,74],overcom:8,feasibl:[60,7],armv8:88,cool:[36,18,40,41,42,43,64,10,11,12,13,17],cuctxcreat:6,curop:46,blockdim:6,quick:[26,34,52,80,69,35,27,70,18,86,7,87,43,8,22,9,10,75,64],release_26:20,release_27:20,release_24:20,release_25:20,"__builtin_longjmp":91,release_23:20,release_20:20,release_21:20,release_28:20,release_29:20,magnif:[41,12,15,38],endcond:[13,40,41,42],port:[20,34,0,21,71,30,9,96,3,81],llvmlib:[56,44],"64bit":27,alphajitinfo:46,exitcond:60,sinc:[53,57,27,7,29,30,75,59,3,60,61,85,71,6,36,48,38,81,40,41,42,43,10,11,12,13,14,16,17,46,86,62,18,87,64,80,20,91,35,72,22,94,56,89,25],u32:6,llvmld:56,declare_funct:[10,11,12,13,17],old_valu:13,memory_order_relax:[60,73],testsut:56,fmag:80,dw_tag_restr!
 ict_typ:8
 7,preorder:85,tire:[68,12,75,41],createbasicaliasanalysispass:[40,41,42,43],switchsect:[62,71],r6xx:88,dorit:0,weird:71,automaton:71,semant:[68,51,91,6,36,60,71,75,73,42,87,64,62,74,11,23,3,24,14,81,17],targets_to_build:[8,7,46],builder_at:13,circumv:18,tweak:[54,18,85],visibl:[75,80,6,14,18,71,73,87,64,74,94,60],msy:20,memori:[26,53,0,71,1,29,75,60,81,61,33,34,6,95,38,39,40,82,9,13,14,15,46,86,62,87,64,51,52,21,35,72,73,57,24,74],camlp4of:[10,11,12,13,16,17],pred:[6,60,40,42,11,13,14],preg:71,pref:[60,14],todai:[75,73,86],handler:[91,71,60,73],instalia:71,breviti:6,criteria:77,msg:60,andw:4,prev:14,reorder:[60,4,73,87],plug:[36,17],capit:75,share:[26,53,28,75,59,3,60,6,36,95,81,7,41,82,8,71,14,44,17,87,64,65,67,20,68,52,70,57,73,54,94,56,74],drown:28,prototyp:[26,5,75,46,36,48,87,40,33,42,41,64,10,11,12,13,60,43,16,17],build_br:[11,12,13],religi:75,registerinfo:[71,46],function_typ:[10,11,12,13,17],purpos:[20,68,75,86,6,27,60,18,71,87,43,64,36,22,56,26,3,14],dbginfo:26,str!
 eam:[75,0
 ,76,4,60,5,79,95,10,11,12,71,14,15,16,17,46,84,64,93,20,13,90,57,94,48],sidelength:85,parse_binary_preced:[12,13],add8rr:71,critic:[26,75,35,27,48,77,64,62,67,16],alwai:[26,71,28,1,75,2,31,3,60,5,34,80,35,36,4,81,40,41,42,43,8,9,10,11,12,13,14,44,17,85,86,18,87,20,51,69,21,57,22,94,48,23,56,74],differenti:[23,3,69,56],stepval:[40,41,42],twoargfp:68,anyon:[22,73,46,87],fourth:[64,11,18,60,46],cstptr:60,"__nv_isinff":6,double_typ:[10,11,12,13,17],clone:[20,1,40,64,55,13,14],mcdisassembl:71,interconnect:21,geforc:6,colfield:59,practic:[26,51,86,38,36,60,18,81,75,73,42,43,62,22,10,11,87,14,15,17],firstlett:82,calltmp6:[13,40],predic:[68,75,46,73,59,60],the_fpm:[10,11,12,13],cse:[10,33,51,73,43],destmodul:56,preced:[26,1,60,35,36,48,38,40,41,42,43,8,10,11,12,13,14,15,16,17,47,87,93,25],combin:[26,71,0,77,31,60,33,34,36,48,86,9,70,16,17,46,47,62,18,84,64,19,14,21,57,22,94],image_file_machine_amd64:92,isfinitenonzero:21,blocker:27,ac_init:44,blarg:14,microscop:75,size_t:[62,57,74]!
 ,mainli:4
 4,canari:60,gte:60,branch_weight:2,pinsrd:4,platform:[29,77,30,3,60,32,88,81,7,41,43,8,10,14,62,64,96,20,52,21,71,73,54,22,23,56,74],gtu:6,gtx:6,underneath:[8,20,44],cst:60,flagspointi:57,inoperandlist:[68,46],term:[26,51,32,25,35,75,73,87,8,22,91,3,71,60,81],name:[26,71,91,27,40,28,1,77,30,75,31,59,3,82,60,81,5,34,79,80,6,36,4,38,39,7,41,42,43,8,48,9,76,10,11,12,13,14,15,16,17,83,46,47,62,85,18,84,33,87,64,96,65,19,66,67,86,93,20,68,89,52,69,90,74,21,57,92,22,44,94,95,23,56,24,97,25],getoperatornam:[40,41],realist:[62,48,68,16],cellspac:71,sequentiallyconsist:73,callsit:[26,14,91],varexprast:40,the_execution_engin:[10,11,12,13],individu:[20,33,75,80,26,14,28,1,68,70,8,30,22,32,94,31,23,24,60],otherspecialsquar:85,const0:94,getdoubleti:[36,40,41,42,43],hacker:[32,22],profit:[26,71,0],decimalinteg:25,profil:[20,81,26,95,63,84,87,58,64,2,56,44],roundp:0,iscxxclass:87,factori:[26,33,75,14],aliase:[60,94],"\u03c6":60,migrat:22,write_escap:64,integertyp:14,theori:[34,9,57],boehm!
 :62,presc
 rib:75,synchron:[74,60,73],refus:[26,5,52,90,76,84,79],motion:[20,51,35,64,26,60],turn:[26,75,60,33,34,80,36,48,81,9,70,16,17,46,62,18,87,20,14,71,73,54,56,89,74],place:[26,71,0,27,1,75,60,33,34,80,36,48,38,40,41,43,8,9,10,12,13,14,15,44,17,46,86,62,18,87,64,96,67,20,68,70,21,57,55,22,91,23,56],ture:[10,48,16,43],imposs:[34,46,35,73,22,9],origin:[26,71,80,86,20,60,47,87,91,56,3,4,14],suspend:62,sanitize_memori:60,arrai:[26,0,60,34,80,6,48,40,8,9,10,11,12,13,14,16,17,46,86,62,87,91,71,35,94],bou_fals:18,transform:[26,75,59,4,32,33,35,36,60,81,40,41,42,43,10,13,14,44,17,46,62,84,87,64,20,68,52,70,21,71,73],rodata:46,predefin:[64,12,1,41],unrecogn:18,"0x00003550":87,given:[26,71,1,30,31,85,3,60,61,33,80,35,36,48,39,41,12,14,81,16,17,46,47,18,84,87,64,66,20,52,91,57,73,55,94,23,56,25],frameindex:46,image_sym_class_external_def:92,necessarili:[20,75,86,27,81,87,60],llvm_int_ti:33,circl:85,white:88,cope:[18,14],copi:[26,71,0,77,75,60,61,6,4,81,7,8,14,44,83,46,62,18,87,64,67,20,51!
 ,52,70,35
 ,72,73,55,94,56,89],specifi:[26,53,57,71,28,1,77,30,75,3,60,32,5,34,79,80,6,36,4,81,40,41,42,43,8,9,37,76,10,11,12,13,14,16,17,83,46,86,62,48,18,84,87,64,65,19,66,67,50,93,20,68,52,90,70,35,73,91,44,94,95,23,56,97,25],image_scn_mem_execut:92,enclos:[68,75,4,8,94,14],grunt:18,releasei:27,serv:[32,86,26,14,1,87,8,56,25],denot:[20,71,62,57,94,60],image_sym_type_doubl:92,subexpress:[51,35,48,40,41,42,43,64,10,11,12,13,16],getoperationnam:33,posix:[93,52,80],balanc:[75,73],posit:[20,71,91,74,18,57,7,41,42,67,22,94,56,59,11,12,60,16],ebp:[68,71],xxxgenasmwrit:46,seri:[20,71,52,14,38,53,43,64,22,94,91,10,88,60,15],pre:[26,33,51,20,27,53,77,36,22,67,56,71,14,44,17],isfunct:87,subroutin:[62,87],doiniti:[46,62,40,41,42,43,64],bitwis:[26,60],techniqu:[71,46,0,62,60,38,35,40,41,42,43,64,70,48,10,11,12,13,14,15,16],ebx:[68,71,19],moreov:[26,71,60],datapath:21,codegen_proto:[10,11,12,13,17],ideal:[23,75,14,46],sure:[71,0,27,7,29,77,75,3,33,34,35,36,48,81,40,41,42,43,8,9,13,14,17,85,18,87!
 ,64,20,52
 ,53,73,54,55,22,96,56],multipli:[26,33,51,60,71],clearer:75,frin:21,gunzip:[20,30],fco:46,bb0_30:6,later:[26,75,28,60,61,36,4,43,8,10,11,12,13,14,44,17,46,87,64,20,21,71,16,48,56,89],quantiti:60,mybison:28,runtim:[26,71,0,3,43,60,34,88,41,82,9,12,70,46,62,18,87,64,20,14,21,57,72,22,91],readjust:71,xxxasmprint:46,cs2:35,cmakelist:[52,47],apple_namespac:87,build_cal:[10,11,12,13,17],uncondit:[26,46,42,11,12,13,60],dw_lang_cobol74:87,cheap:[26,75,14,73],permiss:[61,20,22,80,96],hack:[26,34,38,7,64,9,15],culinkst:6,tend:[20,75,86,27,21,39,87,22,23,14],explicitli:[14,20,68,34,52,81,26,36,60,18,35,61,75,9,86,71,4,28,17],lua:62,derivedtyp:[33,36,40,41,42,43,14],written:[26,53,0,76,75,31,3,60,5,34,6,38,81,41,42,8,9,11,12,71,14,15,46,47,87,19,68,21,35,57,22,23,56],gulp:75,sk_circl:85,analyz:[26,84,20,28,56,87,42,64,30,58,31,11,71,14],abs_fp32:68,analys:[26,33,84,32,14,35,87,64,20,71,60],llvm_scalar_opt:[10,11,12,13],mcsectionmacho:71,jazz:44,ssp:[60,87,94],module_code_gcnam:94,alloc!
 at:[71,46
 ],crude:26,dyn:50,tailor:29,use_llvm_executionengin:[10,11,12,13],sse:[71,60,46,49],regtyp:46,ssa:[26,34,81,46,36,60,38,71,40,41,42,62,51,9,11,12,13,14,15,17],dw_tag_packed_typ:87,reveal:86,isconstantpoolindex:46,dramat:[75,18,43,65,10,60],intrins:[26,33,46,6,62,14,21,0,72,73,87,32,91,97,60],fastcc:[71,60,81,94],bison:28,scott:75,backedg:[11,12,41,42,26],n16:6,lnt:[8,27,28,7],deadargelim:26,atomic_:73,detect:[26,39,52,0,4,1,87,43,60,10,14],mov32ri:71,review:[32,69,20,77,30,22,3,89],image_scn_cnt_uninitialized_data:92,abs_f:68,cycl:[74,60],bitset:[57,46],collect2:55,come:[71,75,59,60,33,34,80,6,36,95,38,40,42,43,8,9,10,11,13,14,15,44,17,86,62,87,64,20,68,52,57,22,94],latch:60,at_apple_runtime_class:87,region:[26,51,91,64,94,60],quiet:[56,18,1,82],contract:[60,85],nocaptur:[26,60,94],llvm_start_multithread:14,entir:[26,53,0,28,1,75,31,60,34,80,6,36,81,43,8,9,10,71,14,17,46,86,62,18,63,87,64,20,35,57,22,94,23,56],image_scn_mem_purg:92,imgrel:19,image_file_machine_powerpcfp:92,!
 nnn:80,co
 lor:[71,14,87],pow:[6,60,0],inspir:[26,60],period:[8,70,22,60],pop:[62,60,71,40,42,94,11,13,14],hblcnsviw:18,image_file_machine_sh4:92,image_file_machine_sh5:92,colon:[68,52,57,8,23,4],image_file_machine_sh3:92,dw_form_ref4:87,coupl:[68,34,14,41,42,73,64,22,9,11,12,60,74],test_source_root:1,sectionnumb:92,"abstract":[26,71,75,3,60,85,36,48,38,81,40,41,42,43,10,11,12,13,14,15,16,17,46,62,87,64,68,51,57,94,74],debug_str:87,variableexprast:[36,48,40,41,42,43],mytype1:57,andrew:62,mytype2:57,mrmdestmem:46,instrssrr:68,intertwin:51,"case":[26,57,40,28,75,29,58,2,59,3,48,60,61,32,5,34,71,35,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,83,46,85,62,74,18,84,33,87,64,86,80,20,68,52,70,53,72,73,22,44,94,95,56,24,89,25],addimm:71,module_code_alia:94,permut:60,stackgrowsdown:46,registerwithsubreg:46,type_code_point:94,cast:[25,68,34,85,86,60,18,40,41,42,43,75,9,10,14,21],tblgen:[33,52,46,71,7,68,58,56,97],anytim:81,isextern:87,clutter:22,image_file_up_system_onli:92,rangepiec:25,d!
 14:46,d15
 :46,addedcomplex:68,value_desc:18,d10:46,d11:46,d12:46,d13:46,alphabet:56,check:[26,57,0,27,40,28,1,29,77,30,75,60,34,71,6,36,4,38,7,41,42,43,8,9,10,11,12,13,14,15,16,17,85,86,48,18,87,64,80,20,68,52,91,21,53,72,73,55,22,95,96,56,89,74],html:[20,33,52,27,95,28,71,7,77,36,17],intreg:[59,46],eventu:[26,85,60,28,42,11,4],hasadsizeprefix:68,week:22,image_sym_class_label:92,nest:[68,71,46,0,62,91,1,35,42,87,64,75,48,94,56,23,11,89,60,16],confidenti:22,driver:[88,6,36,48,38,40,41,42,43,44,10,11,12,13,74,15,16,17],driven:[26,34,46,35,18,71,40,43,8,9,10,13,4,15],devoid:71,setversionprint:18,viewgraph:14,moder:14,justifi:[74,80],iterat:14,"__main":64,model:[26,71,0,1,59,60,32,36,48,81,40,13,14,16,17,46,86,62,18,87,67,21,53,73,57,94,74],customreadbarri:62,unimpl:[64,75],when:[26,53,91,0,27,71,28,1,77,30,75,85,3,82,60,61,32,33,34,80,6,36,4,38,81,40,41,42,43,8,9,10,11,12,13,14,15,16,17,83,63,46,86,62,74,18,84,87,64,93,67,50,20,68,52,69,70,21,35,72,73,57,54,22,48,94,95,23,56,89,25],"0x0!
 00003f3":
 87,redwin:71,kill:[64,95,71,70],refactor:[13,40],dynamic_cast:[40,75,14,85],miscellan:[88,80,18,64,60,28,44],widest:22,hint:[75,86,36,70,17,60,14],except:[26,57,71,1,75,31,3,60,32,34,79,80,6,36,4,38,40,41,43,9,10,11,12,13,14,15,16,17,46,86,18,64,65,67,20,68,91,21,35,73,94,23,56,25],cxx:[20,27,81,7,55,56],blob:[27,75,94],notori:3,disrupt:[89,60],image_sym_dtype_point:92,predrel:59,subtargetfeatur:46,createbr:[40,41,42],image_sym_class_union_tag:92,"0x000003ff":71,saniti:[23,20,52,56],"0x1000":87,whitespac:[20,36,25,38,40,41,42,43,22,48,10,11,12,13,4,15,16,17],image_scn_align_256byt:92,cooper:[62,55],targetinstrinfo:[71,46],evergreen:88,trampolin:60,at_apple_property_attribut:87,freez:[81,77],slice:[25,68,14],gvn:[26,35,40,41,42,43,64],easili:[64,20,53,26,62,18,47,7,87,57,8,75,23,3,71,14,21],legal:[20,33,46,6,14,71,73,8,22,24,86,60],gridsizex:6,encodecompactunwindregisterswithoutfram:71,gridsizez:6,derferenc:14,libfil:83,freed:[72,14,35],garbag:[32,34,62,38,81,51,9,94,60,15],!
 inspect:[
 86,14,71,87,64,94,48,60],boolordefault:18,oneargfprw:68,immut:[64,60,14,49],execv:3,stacklet:72,errata:88,cmptmp:[36,40,41,42,43,10,11,12,13,17],cuda:[21,71,88,6],image_scn_align_16byt:92,onon:60,tape:20,routin:[20,34,62,48,38,1,43,64,22,9,10,3,71,14,15,16],llvmsetdisasmopt:24,dw_at_nam:87,tbcc:46,lastli:[8,64,49],target_triplet:8,overrod:68,idx2:86,cpu_powerpc:57,possbil:57,unconvent:[34,9],classess:46,fcc_g:46,getbuff:57,strict:[36,4,87,23,14,17],interfac:[26,71,1,75,59,3,82,60,32,34,88,6,36,48,38,81,43,9,10,14,15,16,17,46,62,18,87,64,49,20,68,52,69,35,55,23,74],mm4:68,strictli:[20,6,62,60,56,87,42,11,3,4],blocklen_32:94,machin:[75,0,1,29,77,82,60,61,32,34,6,4,7,43,8,9,10,14,46,62,87,64,65,19,67,20,51,52,21,71,92,96,97],fcc_u:46,mm6:68,regard:[32,75,60,81,77],ocaml_lib:[10,11,12,13,17],mm0:[68,71],setjmp_buf:91,procedur:[51,52,38,18,77,88,14,15,44],longer:[26,75,80,62,21,71,40,89,64,22,49,13,14,81,44],notat:[20,68,80,25,18,57,60],nmake:52,runonregion:64,parsetoplevelexpr:!
 [36,48,40
 ,41,42,43],handletoplevelexpress:[36,48,40,41,42,43],dstindex:46,x86_stdcall:71,clrq:71,clrw:71,cbe:53,strongli:[68,34,62,7,40,42,51,9,11,75,13],clrb:71,intro:[32,68,13,40,88],deletevalu:35,umax:60,encompass:[29,49],rearrang:51,intra:35,tok_eof:[36,48,38,40,41,42,43],clrl:71,incorrect:[36,53,40,41,42,43,10,11,12,13,60,17],call2:4,purdu:25,multiclass:[68,25,46],idiom:[36,18,14,17],symbol:[26,71,40,58,75,31,82,60,61,34,80,35,36,7,41,42,43,9,11,12,13,14,17,46,62,18,87,93,19,66,67,50,20,68,51,21,57,92,54,94,56,74],briefli:64,mrmsrcreg:46,llvmcreatedisasm:24,buildmi:71,ilist_nod:14,getdisplaynam:87,callq:72,directori:[75,27,28,1,77,30,3,32,81,7,8,14,44,83,46,87,64,96,20,68,52,21,71,55,22,23,56,97],invest:33,calle:[26,68,81,46,36,48,71,40,41,42,43,64,10,11,12,13,60,17],potenti:[26,71,35,70,18,1,38,42,77,22,48,91,11,75,60,15,16,81],degrad:62,"__sync_":73,metatada:2,all:[26,53,91,0,27,40,28,1,75,29,58,77,30,2,86,31,59,3,82,60,81,61,32,5,34,71,6,36,4,38,39,7,41,42,43,8,48,9,10,11,12!
 ,13,14,15
 ,16,17,83,63,46,85,62,74,18,84,33,87,64,96,65,66,67,50,93,80,20,68,51,52,70,21,35,73,57,55,22,44,94,95,23,56,97,25],replacealluseswith:[51,14],dist:[20,14,56],fp_to_sint:46,lack:[86,62,60,71,77,54,10,25],scalar:[26,51,46,0,62,71,18,57,40,41,42,43,23,13,60],basicblockutil:14,pty:60,ptx:[20,71,88,6],follow:[26,53,91,0,27,40,28,1,29,58,77,75,31,59,3,48,60,33,79,71,6,85,4,38,81,7,41,42,82,8,11,12,13,14,15,16,46,86,62,74,18,84,87,64,96,93,19,80,20,68,52,69,70,35,73,57,54,55,22,44,94,95,23,56,24,89,25],spcc:46,ptr:[60,14,46,6],uint8_t:57,getaddressingmod:46,init:[20,18,40,64,13,60],program:[26,53,91,0,71,28,1,58,78,30,75,3,82,60,32,5,34,88,80,6,4,38,81,40,42,43,8,9,10,11,13,14,15,16,86,63,85,47,62,48,18,84,87,64,65,66,67,50,20,51,70,21,35,57,54,55,22,44,94,95,56,97,74],deepcheck:14,lsbit:14,far:[33,34,35,36,48,18,40,41,87,64,9,23,12,13,14,16,17],faq:[60,34,9,81,32],urem:[33,71,60],worst:[14,34,9,72],toolbuildpath:56,failur:[64,20,53,57,27,4,28,1,29,70,8,30,22,60,95,77,14,15,16,87!
 ],fab:[60
 ,0],unoffici:86,experimental_dir:56,isunpredicatedtermin:46,basicaliasanalysi:[64,26,35],subsubsect:89,feat_reli:71,lisp:[62,34,9],sectionnam:94,list:[26,53,48,0,27,71,85,1,75,58,77,2,31,59,82,60,81,61,32,33,34,88,80,6,36,95,38,39,40,41,42,43,8,9,10,11,12,13,14,15,16,17,83,46,47,62,74,18,84,87,89,64,65,49,67,93,20,68,51,52,69,70,21,35,72,73,57,54,22,44,94,91,23,56,24,97,25],lli:[20,95,53,58,82,64,30,65,67],llvmdev:[32,34,75,73,22,9,25],ten:86,use_llvm_analysi:[10,11,12,13,17],still_poison:60,tex:28,rate:[22,80,94,31],pressur:[71,75,0],design:[26,71,91,28,1,75,3,4,61,32,34,35,60,38,81,40,82,9,13,14,15,44,86,46,47,62,18,87,64,96,49,50,68,51,70,21,57,73,22,94,95,23,74],storageclass:92,hasard:62,mrm0r:46,what:[26,53,57,27,40,28,58,77,30,75,3,60,32,33,34,71,6,36,4,38,81,7,41,42,43,9,10,11,12,13,14,15,16,17,46,86,48,18,84,87,64,96,65,80,20,68,51,52,69,90,70,35,73,55,22,44,94,91,23,56,89,25],namedindex:46,sub:[20,33,71,94,46,36,4,21,1,68,73,8,87,22,60,56,14,17],sun:[8,64],sum:[60,!
 14,94,0],
 brief:[20,75,52,35,62,18,53],tailcallopt:[71,60],asmprint:[62,71,46],version:[71,0,77,30,75,31,82,60,32,33,34,88,6,36,4,81,40,42,43,8,9,10,11,13,14,44,17,83,46,18,87,64,67,50,20,52,69,90,21,35,73,54,55,22,94,96,56,24,97,25],ctpop:[60,46],value_typ:57,themselv:[71,14,18,1,87,22,94,48,23,56,60,16],behaviour:[8,18,75,0],xmm3:68,shouldn:[61,75,35,18,7,15,56,60,38],jitcompilerfn:46,xmm6:68,b32:6,xmm4:68,xmm5:68,build_config:30,xmm8:68,xmm9:68,asmpars:[20,33],misinterpret:[75,70],instrsdrm:68,observ:[34,21,71,73,75,9,60],mac:[80,21,82,64,77,14],xmm2:68,magnitud:60,"0x0000006e":87,filenam:[76,83,5,79,90,93,95,18,84,68,87,78,65,37,31,56,50,97,4,67],heurist:[26,13,60,71,40],sparcasmprint:[71,46],dump_modul:[10,11,12,13,17],hexadecim:[68,18,57,93,19,60],proceed:[62,20,71],ac_config_makefil:44,coverag:[78,22,58],metadata_block:94,forcefulli:86,llvmtargetmachin:46,flat:57,at_apple_property_sett:87,cxa_demangl:87,isload:71,"80x86":96,flag:[71,0,27,75,59,60,6,4,7,82,8,10,11,12,13,17,83,4!
 6,62,18,8
 7,20,52,57,54,55,56],defininit:74,stick:[75,14,29],"0x00000067":87,known:[26,57,27,71,28,77,30,75,60,32,6,36,95,38,81,40,41,42,43,10,11,12,13,14,15,16,17,46,86,64,20,68,91,35,72,44,94,48],ensu:46,valuabl:[28,22],outlin:[64,57],outliv:[26,60],relocationtyp:[75,46],dmpqrtx:80,image_scn_align_8192byt:92,ppc64:[21,71],reevalu:25,"__cxa_throw":91,bjarn:14,revis:[20,75,52,69,87,77,22,14],operandti:71,newlin:[75,80,1,41,94,12,4],divid:[26,33,60,28,71,8,31,3,4],rather:[64,20,71,46,26,27,25,1,75,29,87,35,62,30,22,94,48,86,60,81,16],anxiou:52,hash_map:14,divis:[12,71,60,41],llvmgccdir:28,targetasminfo:[62,46],goat:75,replacewithnewvalu:35,resourc:[64,88,18,14,77],algebra:[26,60],mccontext:71,ranlib:[20,56,55],reflect:[20,46,35,6,41,77,64,12,74],okai:[75,86,36,48,40,41,42,43,11,10,3,12,13,60,16,17],ptxstring:6,"short":[20,57,97,46,6,71,84,1,40,35,42,41,30,22,75,11,12,13,60,81,87],postfix:75,unhid:18,stash:85,ambigu:[85,48,18,41,8,12,25,16],caus:[26,53,57,71,1,75,31,3,60,61,33,80,6,4,3!
 9,40,41,4
 2,8,13,14,81,44,62,48,18,84,64,67,20,70,35,73,55,22,16,95,56],callback:[62,71,14,46,35],prepass:71,fslp:0,headlight:75,runonscc:64,reachabl:[62,52,51,60],geomean:0,next_var:[11,12,13],dso_path:65,style:[75,1,60,32,34,80,35,4,40,9,13,14,44,85,62,18,19,67,68,70,71,73,22,16,48,23,25],lai:[75,86,60,71,40,41,42,43,10,11,12,13,14],harmless:26,anachronist:94,retti:94,might:[71,75,77,30,2,3,60,34,80,35,85,4,81,7,42,9,11,12,13,14,44,46,62,18,84,87,20,51,70,57,73,22,23,56,24,89],alter:[64,56,18,81,60],wouldn:[75,13,40],"return":[26,57,0,71,75,78,30,2,59,3,82,60,61,33,34,80,6,36,37,38,81,40,41,42,43,8,9,10,11,12,13,14,15,16,17,46,62,85,18,63,87,64,49,66,67,50,20,70,35,72,73,22,48,94,91,56,24,89,74],no_instal:56,var_nam:[11,12,13],framework:[26,33,40,71,32,36,14,28,35,38,41,87,64,62,12,13,60,15,17],preheaderbb:[41,42],somebodi:22,bigger:[57,75],strr:46,complexpattern:[71,46],sourcebas:32,module_code_sectionnam:94,level:[26,57,0,71,28,75,31,3,82,60,61,32,34,6,36,4,38,81,40,41,42,43,8,9,!
 10,11,12,
 13,14,15,16,17,86,46,47,62,18,87,64,65,50,20,68,51,52,91,21,35,73,22,44,94,48,23,56,25],"__dwarf":87,refresh:74,const_float:[10,11,12,13,17],difficult:[75,52,35,14,18,41,73,22,74,12,89,60],truncat:[60,46,77],compriz:31,nightli:[32,27,28,77,8,22],weight:[32,2,60],"2x3x4":60,branchinst:2,linkag:[20,71,6,36,14,39,87,94,60,17],regmapping_f:71,asmparsernum:97,expect:[26,71,28,1,75,30,2,3,60,35,36,4,38,86,40,41,42,43,8,10,11,12,13,14,15,16,17,47,62,18,87,64,49,20,68,21,57,72,73,22,94,48,23,25],atom_count:87,slave:96,resulttyp:60,foolproof:64,ccifinreg:46,image_file_line_nums_strip:92,benjamin:62,uncommit:20,advanc:[45,75,46,62,14,18,43,64,22,48,10,89,60,16],guess:52,teach:[36,33,38,15,17],flagflat:57,thrown:[91,60],targetinfo:46,putchar:[36,40,41,42,43,10,11,12,13],thread:[26,71,52,6,62,14,21,1,72,35,73,94,82,60],vararg:[36,14,71,94,60,17],toolnam:[56,44],runtimedyldelf:61,machineframeinfo:71,ccifnotvararg:46,circuit:[12,41],precal:62,libclc:22,bitpack:8,feed:[11,87,42,35],notifi!
 :[22,77,3
 5,0],peculiar:25,dw_at_apple_property_assign:87,feel:[34,35,36,70,21,38,22,9,60,15,17],cuda_success:6,add16mi8:68,smallptrset:14,auroraux:20,cond_val:[11,12,13],construct:[26,71,75,59,60,33,34,80,35,36,48,38,81,40,41,42,43,9,10,11,12,13,14,15,16,17,46,18,87,64,20,68,57,94,56,89,25],blank:[34,80,48,38,75,22,9,89,15,16],slower:[75,62,91,71,14,81],fanci:28,my_jit_tool:56,superpos:14,script:[64,20,81,46,47,27,95,18,1,29,77,8,62,63,22,56,14,28,44],interact:[61,26,34,52,69,46,60,18,71,73,70,64,9,48,14,28,16,87],parsetyp:33,stori:[20,30],gpu:[32,21,88,46,6],gpr:[24,71,68],luckili:62,option:[26,53,57,27,40,1,29,58,77,78,30,31,82,60,61,32,5,79,71,6,36,4,39,7,41,42,43,8,37,76,11,12,13,14,81,44,17,83,63,46,47,62,74,18,84,87,64,65,49,66,67,50,93,80,20,68,52,69,90,70,35,73,54,55,22,94,95,23,56,24,97,25],syncthread:6,wswitch:75,st_gid:80,cmake_c_flag:52,mcasmpars:71,secondcondit:14,albeit:[13,40],kind:[26,75,2,31,60,80,81,40,41,12,13,14,85,62,18,84,87,65,49,68,91,71,73,22,23,56,89,74],as!
 sert_vali
 d_funct:[10,11,12,13,17],doubli:[72,14],whenev:[75,35,4,18,1,82,8,59,60,95,23,56,14,38],remot:[61,20],remov:[26,71,76,77,75,85,3,60,5,34,80,6,36,4,81,40,41,42,43,9,10,11,14,44,46,18,84,87,64,65,49,20,51,70,21,35,54,22,91,56,74],empty_subregsset:46,valuesymbolt:[20,14],dinkumwar:14,cleaner:[18,75,14],body_v:13,nnan:60,ysvn:77,dedic:46,"0b000100":46,violat:[75,86,62,42,22,11,60],intregsclass:46,paramidx1:94,paramidx0:94,exec:95,unsur:25,neverhassideeffect:68,english:[20,75],reach:[26,75,46,62,23,60],flagsround:57,assignvirt2phi:71,image_rel_amd64_addr32nb:19,amaz:[12,41],dw_tag_enumeration_typ:87,xmm7:68,blockid:94,destruct:[20,34,9],libopag:54,sandybridg:0,arg_empti:14,rtl:71,intti:60,optimizationlevel:18,inapplic:29,brtarget:46,penalti:[60,14],bfd:55,front:[26,71,77,75,60,32,34,38,81,40,41,42,43,9,10,11,12,13,14,15,44,86,62,84,87,20,91,53,22],create_add:17,image_file_large_address_awar:92,hash_funct:87,stackoffset:62,shlibext:[8,56],address_s:6,pushfq:71,"0x0001023":87,alia!
 sopt:18,s
 purious:8,mydoclist:57,mydoclisttyp:57,fastest:96,sizabl:14,stdcall:71,sextload:46,llvmdummi:46,sk_otherspecialsquar:85,getvaluetyp:46,getpointertonamedfunct:61,"0x1234":87,use_empti:14,arr:[60,14,86],stump:46,llvmprof:[26,63],simm13:46,shared_librari:[56,44],proactiv:[22,70],mutabl:[45,38,40,41,42,11,12,13,60,15],arc:69,dumb:[34,9],arg:[75,1,43,60,36,95,38,40,41,42,82,10,11,12,13,15,16,17,18,67,53,48,25],unreserv:87,disadvantag:[74,18,14,49],icc_:46,unqualifi:71,arm:[20,88,46,32,21,71,7,29,73,8,24],property_valu:23,simultan:[8,20,14,0],setupmachinefunct:46,inconveni:[13,40,81],inst_end:14,maprequir:57,pubtyp:87,condv:[40,41,42],extensioan:27,syntact:[10,60,4,43],unabbrev:94,sole:[22,14],aspir:[12,41],setbid:94,succeed:[64,1,60],outfil:37,solv:[34,86,35,87,71,40,41,77,22,9,12,13],setindexedloadact:46,v128:[60,6],isdopcod:33,interprocedur:[64,26,74,60,35],blissfulli:18,isomorph:81,available_extern:[60,94],context:[57,75,60,6,36,48,81,40,41,42,43,8,10,11,12,13,14,16,17,85,86,!
 18,87,64,
 68,51,69,91,35,73,96,24,25],subclassref:25,internallinkag:14,tgt:97,getsrc:20,die_offset_bas:87,sweep:62,lbar:71,arbitrarili:[11,60,85,42,87],mistak:75,java:[26,34,62,60,73,9,14],due:[25,51,35,27,4,53,75,29,82,62,2,74,91,71,60],whoa:[10,43],strategi:[40,18,13,60,71],thunk:[26,71],flight:60,append_block:[10,11,12,13,17],activeperl:20,feat_tailcal:71,demand:[20,13,40,71,94],instructor:46,echocmd:56,eatomtypedietag:87,frozen:82,batch:30,dagtodagisel:33,abov:[26,57,27,40,28,75,59,48,60,61,33,34,71,35,36,4,38,81,7,41,42,43,8,9,10,11,12,13,14,15,16,17,46,86,62,85,18,87,64,66,80,20,68,52,53,72,44,94,95,24,89,74],cmp32ri:71,getlinenumb:87,runonfunct:[46,35,62,14,64,70],image_file_machine_am33:92,rip:[8,68],x8b:92,demot:26,illinoi:[22,75,81],mioperandinfo:46,minim:[75,80,86,74,87,71,41,73,44,67,3,12,48,60,16],getnumel:14,higher:[20,22,32,0,14,35,30,2,9,34,48,26,71,60,81,16],x83:92,x87:60,x86:[57,0,77,75,4,33,88,60,7,8,46,65,19,67,20,68,52,21,71,72,73,23],wherea:[60,71,14,91],robust:!
 [8,24],wh
 erev:[75,14],obit:60,stateless:26,lower:[26,75,0,60,33,34,35,48,81,40,41,9,12,13,16,46,86,62,84,87,20,71,97],buildmod:[8,56],machineri:[28,85],discourag:[3,18,14,56],find_packag:52,emitjumptableaddress:46,searchabl:56,chees:75,propos:[22,87],module_code_asm:94,stripwarnmsg:56,islocaltounit:87,regardless:[26,5,75,79,90,62,76,84,40,87,54,30,13,60],waymark:14,parse_var_init:13,exposit:[38,15,43],getbinarycodeforinstr:46,lmalloc:18,type_code_label:94,finder:32,view_function_cfg_onli:11,complaint:[34,9],vendor:60,erasefrompar:[46,36,40,41,42,43,62,14],v64:[60,6],mypassnam:14,preexist:26,awaken:91,image_sym_class_bit_field:92,pers_fn:60,ptrb:6,llvm_yaml_is_flow_sequence_vector:57,xmm10:68,xmm11:68,xmm12:68,xmm13:68,xmm14:68,hatsiz:57,normalizedpolar:57,cst_code_wide_integ:94,"1st":87,global:[26,71,0,1,75,31,82,60,81,5,34,80,6,36,4,38,39,40,41,42,43,9,10,13,14,15,44,17,46,86,62,18,87,64,93,20,91,35,73,94,74],understood:[60,34,9,71],litter:22,unspecifi:[28,71,60,6],f88017:71,consci!
 ou:20,sur
 pris:[14,34,9,60],multmp:[36,40,41,42,43,10,11,12,13,17],glibc:[20,81],image_scn_mem_read:92,prof:[63,58],patchset:20,proc:[20,29,46],emitinstruct:[71,46],assignvirt2stackslot:71,runtimedyld:61,lhs_val:[10,11,12,13,17],ispointertyp:75,"_unwind_resum":91,testfunc:[10,43],arg_begin:[36,40,41,42,43,14],image_file_machine_wcemipsv2:92,registerasmprint:46,runonloop:64,threadid:6,tok_then:[40,41,42],runonbasicblock:64,plethora:[20,81,14],branchfold:46,prec:[12,13,40,41],artifici:87,operandmap:46,question:[75,30,60,32,34,35,48,81,40,42,9,11,13,14,44,86,87,20,69,21,22,16,56,89],fast:[75,46,14,21,71,40,29,87,64,65,13,60,89,97],lldb:[23,22,87,82],arithmet:[26,86,0,36,60,71,40,13,14,17],fptrunc:60,"__cxa_call_unexpect":91,aliasanalysi:[35,40,41,42,43,64,60],files:37,lto_codegen_set_pic_model:74,of_channel:[10,11,12,13,16,17],gcca:79,yrc1:77,delta:53,consist:[75,28,1,77,31,3,60,35,36,4,40,41,42,43,10,11,12,13,17,46,86,62,18,87,93,49,68,91,71,73,22,94,23,56,25],caller:[26,81,46,36,70,21!
 ,71,72,41
 ,42,87,64,62,11,12,60,17],eqtyp:33,fcmp:[36,40,42,10,11,12,13,60,17],parsedefinit:[36,48,40,41,42,43],mflop:0,msa:21,tdrr:67,highlight:[20,68,71,14,89],worklist:[26,14],tooldir:56,icc_val:46,cleargraphattr:14,phieliminationid:71,cciftyp:46,pat:[71,46],"0x0000000000dc8872":82,sdvalu:[71,46],registerdescriptor:46,nice:[26,4,34,36,48,38,40,41,42,43,8,9,10,11,12,13,14,15,16,17,18,64,68,73],ecosystem:[23,14],at_decl_fil:87,storeregtostackslot:[71,46],parseprimari:[36,48,40,41,42,43,12],domfronti:26,containsfoo:75,ccpromotetotyp:46,meaning:[86,62,14,84,67,89,60],thedoc:57,ccifcc:46,dllvm_default_target_tripl:7,ternari:71,gr1:60,elementtyp:60,gr8:[71,46],spillsiz:46,runtest:[27,7],cmpq:72,tag_structure_typ:87,module_code_globalvar:94,edi:[68,71,4],block_begin:[10,11,12,13,17],gmake:[64,20,28,81,44],dispel:86,int8ti:14,edu:25,edx:[68,71],uphold:60,xxxiseldagtodag:46,codesourceri:20,else_bb:[11,12,13],vptr:[60,14],needstub:46,va_end:60,formbit:68,fpformbit:68,mcinst:71,whichev:87,w6!
 4:20,vadv
 :28,emitconstantpool:46,relev:[88,85,35,60,71,7,73,42,54,59,23,11,4],mandelhelp:[12,41],"0x0002023":87,maxsiz:75,loop_end_bb:[11,12,13],h_inlined_into_g:66,pleas:[53,27,29,77,30,75,59,60,34,6,36,81,7,8,9,71,14,17,45,46,96,20,68,89,69,21,35,73,22,23,97,25],smaller:[26,75,69,62,14,28,71,22,60],"_main":[66,92],lcuda:6,cfg:[64,26,71,60,21,1,42,8,30,2,11,14],memset:[26,60,73],fold:[26,33,46,35,36,14,71,73,43,64,10,60],investig:[28,34,9],ctor:[75,60,81],compat:[26,75,30,60,32,33,34,80,6,81,8,9,62,18,87,19,49,67,91,71,73,22,94],memcpyopt:[26,73,35],image_file_machine_i386:92,compar:[26,0,27,28,59,60,35,4,39,40,41,42,8,11,12,13,14,44,86,87,68,91,71,16,48,56],mainlin:[20,22,77],proj_obj_root:[56,44],finishassembl:62,dllvm_targets_to_build:[52,7],chose:[10,27,43],sexi:[38,15],ocamlbuild_plugin:[10,11,12,13,17],destbitcodelib:56,libltdl:56,sext:60,sse41:4,larger:[5,75,46,14,21,71,33,87,22,94,31,60],shader:[88,21,71,75],nsstring:87,unattend:70,typic:[26,75,31,60,61,34,80,35,85,4,8,9,14!
 ,44,46,86
 ,62,84,87,64,93,20,51,90,91,71,23,56,24,74],apr:3,appli:[26,75,27,77,3,60,61,34,80,35,40,41,43,9,10,12,13,14,46,86,74,18,84,87,64,19,20,68,70,21,71,73,22,96,25],app:[54,75,14],inequ:71,loopcond:[40,41,42,11,12,13],api:[75,32,88,6,36,81,43,10,14,17,62,18,68,52,21,71,35,54,55,22,23,24],opcod:[68,75,85,46,36,14,71,40,41,73,48,59,12,60,16,17],transformutil:23,gnuwin32:[30,52],emitconstpooladdress:46,fed:71,from:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,25,26,27,28,30,31,32,33,34,35,36,95,38,39,40,41,42,43,44,46,47,50,51,52,53,54,55,56,57,58,59,60,61,62,84,64,65,66,67,68,70,71,72,73,74,75,76,77,79,80,81,82,83,85,86,87,88,69,91,93,94,48,96,97],usb:29,ineg:71,few:[26,75,0,77,3,60,34,80,6,36,48,41,43,8,9,10,12,14,44,17,46,62,84,87,64,20,70,71,73,22,16,94,23,56],usr:[20,52,6,18,7,55,56],regconstraint:71,my_addit:87,sort:[34,52,93,60,18,53,40,73,42,43,22,9,48,10,11,75,13,14,81,16,87],clever:[34,9,85],ap2:60,dxr:21,cimag:[12,41],adc64mi8:68,llvmtooldir:56,tok_iden!
 tifi:[36,
 48,38,40,41,42,43],is_zero_undef:60,localdynam:[60,94],augment:[12,14,41],lbb0_2:72,annot:[51,6,63,87,24,60],annoi:75,no_dead_strip:60,endian:[94,71,60,87,46],typesequ:33,getregclass:71,proof:2,cta:6,quickstart:[20,32,28,7,8,55,89],tar:[20,27,7,77,30,56],isindirectbranch:68,movapd:4,tag:[20,75,62,14,57,87,77,94,56,24,60],proprietari:22,tab:[75,4],xmin:[12,41],tag_apple_properti:87,predicate_stor:46,six:[71,1,73],getregisteredopt:18,subdirectori:[20,52,46,28,1,77,8,23,44],instead:[26,57,71,1,77,75,59,3,82,60,32,5,34,85,6,36,48,38,81,40,41,43,9,10,12,13,14,15,16,17,63,46,47,62,18,84,64,93,19,67,86,20,51,90,70,21,35,72,73,22,94,23,56,25],constantfp:[36,40,41,42,43,14,17],sin:[57,0,36,48,38,35,43,10,60,15,16,17],chri:[75,71,77,64,22,9,34],sil:68,tension:[13,40],fpext:60,vehicletyp:75,hazard:51,singlethread:60,printdens:[12,41],attent:[8,22,60,46],hasiniti:14,xarch:20,mynewpass:95,light:[75,60],llvm_build_exampl:52,freebsd:[20,21,71,77],elid:[62,68],elig:[26,60],elim:[65,87],dw_!
 tag_memb:
 87,getanalysisifavail:64,build_fsub:17,projlibsopt:56,reilli:14,initroot:62,srcdir:8,"80x87":71,in32bitmod:71,crash:[26,34,20,62,95,53,70,9,67,14],nonneg:60,devel:27,successor:[26,71,46,14,39,75,60],module_code_purgev:94,trac:96,edit:[20,14,52,44,80],trap:[60,86],codegenprepar:26,instsp:46,forcibl:60,image_scn_align_8byt:92,mylistel:57,virtregmap:71,sahf:71,argumentlisttyp:14,const_use_iter:14,customroot:62,llvm_compiler_job:52,pointless:91,distnam:56,categori:[26,75,46,14,18,53,87,8,60,28],sectalign:18,basic_ss:68,stroustrup:14,llvmbb:32,llvmconfig:52,dive:[38,15,85],proviso:22,ac_config_aux_dir:44,powerpc:[20,33,71,52,46,21,57,73,88,60],dictionari:[1,60],deadarghax0r:26,promptli:22,my86_64flag:57,image_sym_class_undefined_label:92,tailcalle:71,lto:[55,51,74],mrm1r:46,flaground:57,isfoo:75,"0x2000":87,prioriti:[60,87,86],unknown:[71,0,29,60,80,36,48,38,40,41,42,43,10,11,12,13,15,16,17,18,57,55],printoperand:46,boil:[85,41,42,22,11,12],misunderstood:[32,81,86],tidbit:[45,34!
 ,35,38,40
 ,9,13,15],shell:[20,81,52,18,1,8,89,70],unabridg:[13,40],juli:62,protocol:75,emac:[20,68,75,56],probe:[71,14],utf:20,bitcodewrit:[33,14],clip:82,favorit:[11,51,42],cohen:3,linker:[75,58,60,32,6,81,7,41,70,83,46,18,87,65,19,20,90,14,71,55,23,56,74],appel89:62,coher:23,lowerfp_to_sint:46,disjoint:[35,60,0],printvar:56,inform:[26,53,57,27,40,28,1,75,29,58,77,78,30,2,31,59,3,82,60,61,32,34,88,71,6,36,4,81,7,41,43,8,9,10,12,13,14,44,17,86,63,46,47,62,85,18,84,87,64,96,93,19,50,20,68,51,52,90,91,21,35,89,55,22,94,95,23,56,24,97,74],diverg:[12,41,86],rout:35,"__unwind_info":71,which:[26,53,91,0,27,40,28,1,75,77,30,2,31,59,3,82,60,61,32,33,34,71,6,36,4,38,39,7,41,42,43,8,48,9,10,11,12,13,14,81,16,17,83,63,85,46,47,62,74,18,84,87,64,96,65,49,67,86,93,80,20,68,51,52,70,21,35,72,73,57,55,22,44,94,95,23,56,24,89,25],movsx32rm16:71,ncsa:22,llvmtarget:44,clash:[75,60],safepointaddress:62,clase:14,sunwspro:20,image_file_machine_ia64:92,dw_op_addr:87,hassideeffect:68,attributelist:49,dens:!
 [60,14,94
 ],addregfrm:46,objroot:8,osuosl:96,determin:[26,57,28,1,77,59,3,60,61,85,80,6,36,48,41,42,8,11,12,71,14,44,17,63,46,18,84,87,64,65,52,91,53,35,16,94,56],nextindvar:60,const_arg_iter:14,setindexedstoreact:46,"30pm":57,mainloop:[36,48,40,41,42,43],filetyp:[30,65],findregress:27,liveinterv:[67,71],mistyp:75,strtol:18,locat:[26,53,0,27,71,28,1,58,3,60,61,32,80,6,4,81,40,41,8,12,13,14,44,46,47,62,18,87,66,86,20,52,91,35,73,57,56,24],strtod:[36,48,18,40,41,42,43,38],much:[26,53,57,27,40,75,31,85,3,60,33,34,71,6,36,48,81,7,43,8,9,10,13,14,16,17,46,74,18,87,64,80,20,68,69,70,35,73,54,55,22,44,96,89,25],eatomtypetypeflag:87,multmp4:[10,43],local:[26,57,71,1,75,60,81,61,6,36,38,39,40,43,8,10,13,14,15,17,62,18,87,64,65,67,20,51,21,35,93,94,56,25],multmp1:[36,17],multmp2:[36,17],multmp3:[36,17],contribut:[45,32,14,71,64,22,26,60],pypi:81,succe:[76,5,81,79,80,90,85,95,84,40,83,97,8,65,48,31,96,91,13,4,16],buildtool:23,lto_module_t:74,operating_system:60,dw_tag_user_bas:87,selectcod:46,r!
 egallocli
 nearscan:71,partit:[26,71,65,70,29],view:[26,74,28,71,73,42,15,94,11,14,38],modulo:[71,60,87],knowledg:[26,34,71,75,8,22,9,94,56,24,89,60],maketir:75,objectcach:61,dw_form_xxx:87,int16_t:[57,46],terminatorinst:[75,2,14],image_sym_class_enum_tag:92,image_scn_lnk_remov:92,becaus:[26,71,0,40,28,1,77,30,75,59,3,60,61,34,80,35,36,4,38,81,7,41,42,43,9,10,11,12,13,14,15,16,17,46,86,62,85,18,87,64,93,49,20,68,70,57,73,22,48,94,91,56,74],gmail:[20,69],closer:[51,86],entranc:60,framemap:62,divisionbyzero:60,dll:[8,60],favor:[28,22],libsystem:75,beginassembl:62,"__apple_nam":87,rppassmanag:64,image_sym_dtype_funct:92,llvm_enable_assert:52,amen:71,cudamodul:6,sprinkl:14,job:[64,3,52,85,20],mapopt:57,noalia:[86,60,94,35],externallinkag:[36,40,41,42,43,17],exclam:60,addit:[26,53,91,0,71,28,1,77,30,75,31,3,60,5,34,88,6,36,4,40,41,43,8,9,10,12,13,14,16,17,63,46,86,62,48,18,84,87,64,65,19,20,51,70,21,35,73,22,44,94,95,23,56,24],"0x00000120":87,thenbb:[11,40,41,42],constantint:14,tgtm:20,mli!
 mit:95,gr
 ain:[21,14],committe:14,libtinfo:7,uint16_t:[59,57,87,46],pnacl:21,unclear:[13,40,35],parallel_loop_access:60,wall:[64,1,9,34],hyphen:[18,46],wonder:[75,85,86,81,43,10],arriv:86,chmod:20,walk:[64,26,57,14],respect:[75,77,60,46,35,95,81,40,13,14,44,85,86,62,20,68,91,21,71,70,22,24],rpo:51,yaml:[32,57,92],decent:[64,33,14,29,77],xxxcallingconv:46,compos:[56,30,60,80,87],compon:[26,53,28,77,37,61,32,6,60,82,14,44,83,46,47,62,20,51,71,22,23,56],packedvector:14,besid:[75,46,48,18,41,12,16],inbound:[60,86],presenc:[46,4,21,71,73,60,91,14,28],ptxa:6,present:[71,1,60,32,4,40,41,42,11,12,13,14,86,62,18,87,67,20,53,94,56,25],xorrr:46,align:[26,71,88,46,6,62,4,21,57,73,87,74,94,49,86,60],dfpregsclass:46,unsuit:73,constprop:[26,18,14],wili:86,wild:[12,18,41],xorri:46,bb3:60,bb2:[60,94],bb1:[60,94],d_ctor_bas:4,layer:[71,34,9,35],avx:[8,0],instrinfo:[71,46],cctype:[36,48,40,41,42,43],eptr:60,avl:14,motiv:[59,11,13,40,42],dual:22,add64mi32:68,dinstinguish:87,alternativali:52,incq:4,gprof!
 :[20,56],
 xxxschedul:46,cross:[32,52,20,60,7,29,95,14],member:[61,26,33,71,80,46,0,85,14,28,57,75,68,87,8,74,86,60],binary_preced:[12,13],largest:[60,71,19],linaro:29,f64:[71,60,46,6],"0x1b":94,hasjit:46,maptag:57,ssecal:46,hardcodedsmalls:14,bcpl:[68,25],decoupl:68,outputtyp:33,iftru:60,extra_dist:56,inc4:4,"0x10":87,linkagetyp:14,getrawpoint:49,my_function_fast:6,machinefunct:[64,71,14],libdevic:6,getoffset:46,camel:75,converg:[12,41],obtain:[61,26,68,71,52,46,91,53,22,56,3,14],heavili:[62,32,34,9,81],tce:21,tcb:72,now:[71,40,28,1,77,75,60,32,33,34,80,6,36,4,81,7,41,42,43,9,10,11,12,13,14,16,17,85,62,18,87,64,20,52,69,70,21,57,73,22,44,48],methodproto:46,amd64:20,eatomtypenul:87,smith:75,book:[64,32,75,51,14],waypoint:70,emitobject:61,smart:75,llvm_on_win32:3,llvmdisassembler_option_usemarkup:24,agnost:[3,71,87],strconcat:[68,25,46],lightweight:[75,1,14],know:[26,57,0,71,28,1,30,75,82,60,34,35,36,48,81,40,41,42,43,8,9,10,11,12,13,14,16,17,46,62,18,87,64,20,52,69,70,53,73,22,96,89,7!
 4],nor:[2
 6,75,86,62,71,30,94,56,3,60,81],librarynam:[62,56,64,46,44],"7e15":18,hostc:6,hostb:6,hosta:6,incred:[22,75],repurpos:87,unord:[89,60,73,46],"0xff":68,createphi:[40,41,42],unabbrev_record:94,growth:[71,14],"export":[20,35,74,18,71,41,77,55,56,60],superclass:[64,68,14,46,35],package_vers:52,add64ri32:68,not_found:[10,11,12,13,16,17],leaf:[91,21,87],image_sym_class_struct_tag:92,lead:[26,68,71,86,14,18,57,73,55,75,48,56,60,16],sjlj:91,leak:[62,38,1,72,8,15],leaq:72,leav:[26,53,69,46,20,62,18,1,87,55,6,60,81,44],prehead:[11,42,26],leader:75,getnam:[36,87,81,40,41,42,43,64,14],numstr:[36,48,38,40,41,42,43],acronym:32,"enum":[57,75,59,33,46,35,36,48,38,40,41,42,43,14,85,62,18,87,49,68,71,92,97],tdfile:56,xxxgencallingconv:46,eatomtypenameflag:87,rare:[68,94,46,62,4,71,60,91,14],add64mi8:68,column:[20,75,0,28,87,59],type_code_doubl:94,lppassmanag:64,constructor:[61,71,85,46,14,18,57,73,42,64,75,49,60,81],spiller:[67,65,71],disabl:[75,0,27,1,77,4,35,60,81,7,42,11,14,62,18,84,65,67!
 ,20,52,70
 ,21,53,54,55,95,56],stackentri:62,own:[26,75,28,77,3,60,61,33,34,85,38,81,40,41,8,9,12,13,14,15,44,46,62,18,87,64,20,71,55,22,94,23,56],automat:[26,71,1,58,75,60,32,85,35,36,95,81,7,42,43,10,11,14,44,17,46,62,18,63,87,64,96,65,20,68,69,70,57,72,23,56,89],warranti:[64,22],automak:[20,56],build_mod:30,val:[68,46,6,36,14,18,40,41,42,43,48,94,49,60],transfer:[72,60,91],explict:19,threadsanit:60,intention:[64,48,75,60,16],appl:[32,20,27,4,71,87,82,22,60],arg1:[38,15],"var":[68,6,40,87,13,60],incorr:2,varexpr:[13,40],mailer:22,"0x7fffffff":60,codegen_expr:[10,11,12,13,17],lazyresolverfn:46,made:[26,75,57,60,32,34,35,36,81,40,41,42,43,9,11,13,14,44,85,86,87,64,91,71,72,22,94,56,89],temp:53,whether:[26,71,75,60,33,34,80,35,85,48,81,40,41,42,9,11,12,13,14,44,46,86,62,18,84,65,67,20,68,52,69,70,53,55,16,94,91,23,74],troubl:[20,18,22,30],record:[68,34,28,84,65,63,22,9,94,67,93,97,25],below:[26,71,0,27,28,29,77,30,60,5,80,6,85,4,40,41,8,10,12,13,14,16,46,18,87,64,65,20,52,35,72,22,44,9!
 4,48,23,5
 6],structtyp:14,ptrreg:71,targetdescript:46,llvmasmpars:[33,44],numberexpr:[36,48,40,41,42,43,10,11,12,13,16,17],significantli:[60,21,42,64,74,48,94,31,11,14,16],link_libs_in_shar:56,rl5:6,create_entry_block_alloca:13,sparseset:14,rl7:6,mutual:[36,18,38,15,17],targetfunc:14,minsizerel:52,the_modul:[10,11,12,13,17],percent:35,constantfold:33,parsecommandlineopt:18,other:[26,53,0,27,40,28,1,75,29,77,30,2,59,3,60,81,61,32,33,34,88,71,6,36,4,38,39,7,41,42,43,8,9,10,11,12,13,14,15,16,17,45,46,85,62,74,18,84,87,89,64,65,19,49,66,86,93,80,20,68,51,52,69,70,21,35,73,57,55,22,48,94,91,23,56,97,25],bool:[57,75,33,46,35,36,40,41,42,43,10,11,12,13,14,17,85,62,18,87,64,52,71],branch:[26,75,77,2,60,32,88,81,40,41,42,11,12,13,14,46,62,20,69,91,71,22],neelakantam:26,inst_iter:14,keep_symbol:56,junk:[10,11,12,13,16,17],xxxsubtarget:46,indexedmap:[71,14],add_subdirectori:52,debian:[54,20,7],stringmap:[18,14,6],experienc:70,sass:6,reliabl:[71,1],subregclasslist:46,pdata:19,emerg:82,auxiliari:!
 46,invari
 :[26,51,35,14,64,20,60],istermin:68},objtypes:{"0":"std:option"},titles:["Auto-Vectorization in LLVM","lit - LLVM Integrated Tester","LLVM Branch Weight Metadata","System Library","FileCheck - Flexible pattern matching file verifier","llvm-extract - extract a function from an LLVM module","User Guide for NVPTX Back-end","How To Cross-Compile Clang/LLVM using Clang/LLVM","LLVM Testing Infrastructure Guide","8. Kaleidoscope: Conclusion and other useful LLVM tidbits","4. Kaleidoscope: Adding JIT and Optimizer Support","5. Kaleidoscope: Extending the Language: Control Flow","6. Kaleidoscope: Extending the Language: User-defined Operators","7. Kaleidoscope: Extending the Language: Mutable Variables","LLVM Programmer’s Manual","1. Kaleidoscope: Tutorial Introduction and the Lexer","2. Kaleidoscope: Implementing a Parser and AST","3. Kaleidoscope: Code generation to LLVM IR","CommandLine 2.0 Library Manual","LLVM Extensions","Getting Started with the LLVM System","LLVM 3.4.1!
  Release 
 Notes","LLVM Developer Policy","LLVMBuild Guide","LLVM’s Optional Rich Disassembly Output","TableGen Language Reference","LLVM’s Analysis and Transform Passes","How To Validate a New Release","LLVM test-suite Makefile Guide","How To Build On ARM","Getting Started with the LLVM System using Microsoft Visual Studio","llvm-bcanalyzer - LLVM bitcode analyzer","Overview","Extending LLVM: Adding instructions, intrinsics, types, etc.","8. Kaleidoscope: Conclusion and other useful LLVM tidbits","LLVM Alias Analysis Infrastructure","3. Kaleidoscope: Code generation to LLVM IR","llvm-stress - generate random .ll files","1. Kaleidoscope: Tutorial Introduction and the Lexer","llvm-diff - LLVM structural ‘diff’","7. Kaleidoscope: Extending the Language: Mutable Variables","6. Kaleidoscope: Extending the Language: User-defined Operators","5. Kaleidoscope: Extending the Language: Control Flow","4. Kaleidoscope: Adding JIT and Optimizer Support","Creating an LLVM Pr!
 oject","L
 LVM Tutorial: Table of Contents","Writing an LLVM Backend","llvm-build - LLVM Project Build Utility","2. Kaleidoscope: Implementing a Parser and AST","How To Use Attributes","llvm-readobj - LLVM Object Reader","The LLVM Lexicon","Building LLVM with CMake","How to submit an LLVM bug report","Advice on Packaging LLVM","The LLVM gold plugin","LLVM Makefile Guide","YAML I/O","LLVM Command Guide","How To Use Instruction Mappings","LLVM Language Reference Manual","MCJIT Design and Implementation","Accurate Garbage Collection with LLVM","llvm-prof - print execution profile of LLVM program","Writing an LLVM Pass","llc - LLVM static compiler","llvm-symbolizer - convert addresses into source code locations","lli - directly execute programs from LLVM bitcode","TableGen Fundamentals","Code Reviews with Phabricator","LLVM bugpoint tool: design and usage","The LLVM Target-Independent Code Generator","Segmented Stacks in LLVM","LLVM Atomic Instructions and Concurrency Guide","LLVM Link Ti!
 me Optimi
 zation: Design and Implementation","LLVM Coding Standards","llvm-dis - LLVM disassembler","How To Release LLVM To The Public","llvm-cov - emit coverage information","llvm-as - LLVM assembler","llvm-ar - LLVM archiver","Frequently Asked Questions (FAQ)","Debugging JIT-ed Code With GDB","llvm-config - Print LLVM compilation options","opt - LLVM optimizer","How to set up LLVM-style RTTI for your class hierarchy","The Often Misunderstood GEP Instruction","Source Level Debugging with LLVM","Architecture & Platform Information for Compiler Writers","Sphinx Quickstart Template","llvm-link - LLVM bitcode linker","Exception Handling in LLVM","yaml2obj","llvm-nm - list LLVM bitcode and object file’s symbol table","LLVM Bitcode File Format","bugpoint - automatic test case reduction tool","How To Add Your Build Configuration To LLVM Buildbot Infrastructure","tblgen - Target Description To C++ Code Generator"],objnames:{"0":["std","option","option"]},filenames:["Vectorizers","!
 CommandGu
 ide/lit","BranchWeightMetadata","SystemLibrary","CommandGuide/FileCheck","CommandGuide/llvm-extract","NVPTXUsage","HowToCrossCompileLLVM","TestingGuide","tutorial/OCamlLangImpl8","tutorial/OCamlLangImpl4","tutorial/OCamlLangImpl5","tutorial/OCamlLangImpl6","tutorial/OCamlLangImpl7","ProgrammersManual","tutorial/OCamlLangImpl1","tutorial/OCamlLangImpl2","tutorial/OCamlLangImpl3","CommandLine","Extensions","GettingStarted","ReleaseNotes","DeveloperPolicy","LLVMBuild","MarkedUpDisassembly","TableGen/LangRef","Passes","ReleaseProcess","TestSuiteMakefileGuide","HowToBuildOnARM","GettingStartedVS","CommandGuide/llvm-bcanalyzer","index","ExtendingLLVM","tutorial/LangImpl8","AliasAnalysis","tutorial/LangImpl3","CommandGuide/llvm-stress","tutorial/LangImpl1","CommandGuide/llvm-diff","tutorial/LangImpl7","tutorial/LangImpl6","tutorial/LangImpl5","tutorial/LangImpl4","Projects","tutorial/index","WritingAnLLVMBackend","CommandGuide/llvm-build","tutorial/LangImpl2","HowToUseAttributes",!
 "CommandG
 uide/llvm-readobj","Lexicon","CMake","HowToSubmitABug","Packaging","GoldPlugin","MakefileGuide","YamlIO","CommandGuide/index","HowToUseInstrMappings","LangRef","MCJITDesignAndImplementation","GarbageCollection","CommandGuide/llvm-prof","WritingAnLLVMPass","CommandGuide/llc","CommandGuide/llvm-symbolizer","CommandGuide/lli","TableGenFundamentals","Phabricator","Bugpoint","CodeGenerator","SegmentedStacks","Atomics","LinkTimeOptimization","CodingStandards","CommandGuide/llvm-dis","HowToReleaseLLVM","CommandGuide/llvm-cov","CommandGuide/llvm-as","CommandGuide/llvm-ar","FAQ","DebuggingJITedCode","CommandGuide/llvm-config","CommandGuide/opt","HowToSetUpLLVMStyleRTTI","GetElementPtr","SourceLevelDebugging","CompilerWriterInfo","SphinxQuickstartTemplate","CommandGuide/llvm-link","ExceptionHandling","yaml2obj","CommandGuide/llvm-nm","BitCodeFormat","CommandGuide/bugpoint","HowToAddABuilder","CommandGuide/tblgen"]})
\ No newline at end of file

Added: www-releases/trunk/3.4.2/docs/tutorial/LangImpl1.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.4.2/docs/tutorial/LangImpl1.html?rev=211020&view=auto
==============================================================================
--- www-releases/trunk/3.4.2/docs/tutorial/LangImpl1.html (added)
+++ www-releases/trunk/3.4.2/docs/tutorial/LangImpl1.html Mon Jun 16 08:19:07 2014
@@ -0,0 +1,350 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>1. Kaleidoscope: Tutorial Introduction and the Lexer — LLVM 3.4 documentation</title>
+    
+    <link rel="stylesheet" href="../_static/llvm-theme.css" type="text/css" />
+    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../',
+        VERSION:     '3.4',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../_static/jquery.js"></script>
+    <script type="text/javascript" src="../_static/underscore.js"></script>
+    <script type="text/javascript" src="../_static/doctools.js"></script>
+    <link rel="top" title="LLVM 3.4 documentation" href="../index.html" />
+    <link rel="up" title="LLVM Tutorial: Table of Contents" href="index.html" />
+    <link rel="next" title="2. Kaleidoscope: Implementing a Parser and AST" href="LangImpl2.html" />
+    <link rel="prev" title="LLVM Tutorial: Table of Contents" href="index.html" />
+<style type="text/css">
+  table.right { float: right; margin-left: 20px; }
+  table.right td { border: 1px solid #ccc; }
+</style>
+
+  </head>
+  <body>
+<div class="logo">
+  <a href="../index.html">
+    <img src="../_static/logo.png"
+         alt="LLVM Logo" width="250" height="88"/></a>
+</div>
+
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="LangImpl2.html" title="2. Kaleidoscope: Implementing a Parser and AST"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="index.html" title="LLVM Tutorial: Table of Contents"
+             accesskey="P">previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="../index.html">Documentation</a>»</li>
+
+          <li><a href="index.html" accesskey="U">LLVM Tutorial: Table of Contents</a> »</li> 
+      </ul>
+    </div>
+
+
+    <div class="document">
+      <div class="documentwrapper">
+          <div class="body">
+            
+  <div class="section" id="kaleidoscope-tutorial-introduction-and-the-lexer">
+<h1>1. Kaleidoscope: Tutorial Introduction and the Lexer<a class="headerlink" href="#kaleidoscope-tutorial-introduction-and-the-lexer" title="Permalink to this headline">¶</a></h1>
+<div class="contents local topic" id="contents">
+<ul class="simple">
+<li><a class="reference internal" href="#tutorial-introduction" id="id1">Tutorial Introduction</a></li>
+<li><a class="reference internal" href="#the-basic-language" id="id2">The Basic Language</a></li>
+<li><a class="reference internal" href="#the-lexer" id="id3">The Lexer</a></li>
+</ul>
+</div>
+<div class="section" id="tutorial-introduction">
+<h2><a class="toc-backref" href="#id1">1.1. Tutorial Introduction</a><a class="headerlink" href="#tutorial-introduction" title="Permalink to this headline">¶</a></h2>
+<p>Welcome to the “Implementing a language with LLVM” tutorial. This
+tutorial runs through the implementation of a simple language, showing
+how fun and easy it can be. This tutorial will get you up and started as
+well as help to build a framework you can extend to other languages. The
+code in this tutorial can also be used as a playground to hack on other
+LLVM specific things.</p>
+<p>The goal of this tutorial is to progressively unveil our language,
+describing how it is built up over time. This will let us cover a fairly
+broad range of language design and LLVM-specific usage issues, showing
+and explaining the code for it all along the way, without overwhelming
+you with tons of details up front.</p>
+<p>It is useful to point out ahead of time that this tutorial is really
+about teaching compiler techniques and LLVM specifically, <em>not</em> about
+teaching modern and sane software engineering principles. In practice,
+this means that we’ll take a number of shortcuts to simplify the
+exposition. For example, the code leaks memory, uses global variables
+all over the place, doesn’t use nice design patterns like
+<a class="reference external" href="http://en.wikipedia.org/wiki/Visitor_pattern">visitors</a>, etc... but
+it is very simple. If you dig in and use the code as a basis for future
+projects, fixing these deficiencies shouldn’t be hard.</p>
+<p>I’ve tried to put this tutorial together in a way that makes chapters
+easy to skip over if you are already familiar with or are uninterested
+in the various pieces. The structure of the tutorial is:</p>
+<ul class="simple">
+<li><a class="reference external" href="#language">Chapter #1</a>: Introduction to the Kaleidoscope
+language, and the definition of its Lexer - This shows where we are
+going and the basic functionality that we want it to do. In order to
+make this tutorial maximally understandable and hackable, we choose
+to implement everything in C++ instead of using lexer and parser
+generators. LLVM obviously works just fine with such tools, feel free
+to use one if you prefer.</li>
+<li><a class="reference external" href="LangImpl2.html">Chapter #2</a>: Implementing a Parser and AST -
+With the lexer in place, we can talk about parsing techniques and
+basic AST construction. This tutorial describes recursive descent
+parsing and operator precedence parsing. Nothing in Chapters 1 or 2
+is LLVM-specific, the code doesn’t even link in LLVM at this point.
+:)</li>
+<li><a class="reference external" href="LangImpl3.html">Chapter #3</a>: Code generation to LLVM IR - With
+the AST ready, we can show off how easy generation of LLVM IR really
+is.</li>
+<li><a class="reference external" href="LangImpl4.html">Chapter #4</a>: Adding JIT and Optimizer Support
+- Because a lot of people are interested in using LLVM as a JIT,
+we’ll dive right into it and show you the 3 lines it takes to add JIT
+support. LLVM is also useful in many other ways, but this is one
+simple and “sexy” way to show off its power. :)</li>
+<li><a class="reference external" href="LangImpl5.html">Chapter #5</a>: Extending the Language: Control
+Flow - With the language up and running, we show how to extend it
+with control flow operations (if/then/else and a ‘for’ loop). This
+gives us a chance to talk about simple SSA construction and control
+flow.</li>
+<li><a class="reference external" href="LangImpl6.html">Chapter #6</a>: Extending the Language:
+User-defined Operators - This is a silly but fun chapter that talks
+about extending the language to let the user program define their own
+arbitrary unary and binary operators (with assignable precedence!).
+This lets us build a significant piece of the “language” as library
+routines.</li>
+<li><a class="reference external" href="LangImpl7.html">Chapter #7</a>: Extending the Language: Mutable
+Variables - This chapter talks about adding user-defined local
+variables along with an assignment operator. The interesting part
+about this is how easy and trivial it is to construct SSA form in
+LLVM: no, LLVM does <em>not</em> require your front-end to construct SSA
+form!</li>
+<li><a class="reference external" href="LangImpl8.html">Chapter #8</a>: Conclusion and other useful LLVM
+tidbits - This chapter wraps up the series by talking about
+potential ways to extend the language, but also includes a bunch of
+pointers to info about “special topics” like adding garbage
+collection support, exceptions, debugging, support for “spaghetti
+stacks”, and a bunch of other tips and tricks.</li>
+</ul>
+<p>By the end of the tutorial, we’ll have written a bit less than 700 lines
+of non-comment, non-blank, lines of code. With this small amount of
+code, we’ll have built up a very reasonable compiler for a non-trivial
+language including a hand-written lexer, parser, AST, as well as code
+generation support with a JIT compiler. While other systems may have
+interesting “hello world” tutorials, I think the breadth of this
+tutorial is a great testament to the strengths of LLVM and why you
+should consider it if you’re interested in language or compiler design.</p>
+<p>A note about this tutorial: we expect you to extend the language and
+play with it on your own. Take the code and go crazy hacking away at it,
+compilers don’t need to be scary creatures - it can be a lot of fun to
+play with languages!</p>
+</div>
+<div class="section" id="the-basic-language">
+<h2><a class="toc-backref" href="#id2">1.2. The Basic Language</a><a class="headerlink" href="#the-basic-language" title="Permalink to this headline">¶</a></h2>
+<p>This tutorial will be illustrated with a toy language that we’ll call
+“<a class="reference external" href="http://en.wikipedia.org/wiki/Kaleidoscope">Kaleidoscope</a>” (derived
+from “meaning beautiful, form, and view”). Kaleidoscope is a procedural
+language that allows you to define functions, use conditionals, math,
+etc. Over the course of the tutorial, we’ll extend Kaleidoscope to
+support the if/then/else construct, a for loop, user defined operators,
+JIT compilation with a simple command line interface, etc.</p>
+<p>Because we want to keep things simple, the only datatype in Kaleidoscope
+is a 64-bit floating point type (aka ‘double’ in C parlance). As such,
+all values are implicitly double precision and the language doesn’t
+require type declarations. This gives the language a very nice and
+simple syntax. For example, the following simple example computes
+<a class="reference external" href="http://en.wikipedia.org/wiki/Fibonacci_number">Fibonacci numbers:</a></p>
+<div class="highlight-python"><pre># Compute the x'th fibonacci number.
+def fib(x)
+  if x < 3 then
+    1
+  else
+    fib(x-1)+fib(x-2)
+
+# This expression will compute the 40th number.
+fib(40)</pre>
+</div>
+<p>We also allow Kaleidoscope to call into standard library functions (the
+LLVM JIT makes this completely trivial). This means that you can use the
+‘extern’ keyword to define a function before you use it (this is also
+useful for mutually recursive functions). For example:</p>
+<div class="highlight-python"><pre>extern sin(arg);
+extern cos(arg);
+extern atan2(arg1 arg2);
+
+atan2(sin(.4), cos(42))</pre>
+</div>
+<p>A more interesting example is included in Chapter 6 where we write a
+little Kaleidoscope application that <a class="reference external" href="LangImpl6.html#example">displays a Mandelbrot
+Set</a> at various levels of magnification.</p>
+<p>Lets dive into the implementation of this language!</p>
+</div>
+<div class="section" id="the-lexer">
+<h2><a class="toc-backref" href="#id3">1.3. The Lexer</a><a class="headerlink" href="#the-lexer" title="Permalink to this headline">¶</a></h2>
+<p>When it comes to implementing a language, the first thing needed is the
+ability to process a text file and recognize what it says. The
+traditional way to do this is to use a
+“<a class="reference external" href="http://en.wikipedia.org/wiki/Lexical_analysis">lexer</a>” (aka
+‘scanner’) to break the input up into “tokens”. Each token returned by
+the lexer includes a token code and potentially some metadata (e.g. the
+numeric value of a number). First, we define the possibilities:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// The lexer returns tokens [0-255] if it is an unknown character, otherwise one</span>
+<span class="c1">// of these for known things.</span>
+<span class="k">enum</span> <span class="n">Token</span> <span class="p">{</span>
+  <span class="n">tok_eof</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span>
+
+  <span class="c1">// commands</span>
+  <span class="n">tok_def</span> <span class="o">=</span> <span class="o">-</span><span class="mi">2</span><span class="p">,</span> <span class="n">tok_extern</span> <span class="o">=</span> <span class="o">-</span><span class="mi">3</span><span class="p">,</span>
+
+  <span class="c1">// primary</span>
+  <span class="n">tok_identifier</span> <span class="o">=</span> <span class="o">-</span><span class="mi">4</span><span class="p">,</span> <span class="n">tok_number</span> <span class="o">=</span> <span class="o">-</span><span class="mi">5</span><span class="p">,</span>
+<span class="p">};</span>
+
+<span class="k">static</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">IdentifierStr</span><span class="p">;</span>  <span class="c1">// Filled in if tok_identifier</span>
+<span class="k">static</span> <span class="kt">double</span> <span class="n">NumVal</span><span class="p">;</span>              <span class="c1">// Filled in if tok_number</span>
+</pre></div>
+</div>
+<p>Each token returned by our lexer will either be one of the Token enum
+values or it will be an ‘unknown’ character like ‘+’, which is returned
+as its ASCII value. If the current token is an identifier, the
+<tt class="docutils literal"><span class="pre">IdentifierStr</span></tt> global variable holds the name of the identifier. If
+the current token is a numeric literal (like 1.0), <tt class="docutils literal"><span class="pre">NumVal</span></tt> holds its
+value. Note that we use global variables for simplicity, this is not the
+best choice for a real language implementation :).</p>
+<p>The actual implementation of the lexer is a single function named
+<tt class="docutils literal"><span class="pre">gettok</span></tt>. The <tt class="docutils literal"><span class="pre">gettok</span></tt> function is called to return the next token
+from standard input. Its definition starts as:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// gettok - Return the next token from standard input.</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">gettok</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">static</span> <span class="kt">int</span> <span class="n">LastChar</span> <span class="o">=</span> <span class="sc">' '</span><span class="p">;</span>
+
+  <span class="c1">// Skip any whitespace.</span>
+  <span class="k">while</span> <span class="p">(</span><span class="n">isspace</span><span class="p">(</span><span class="n">LastChar</span><span class="p">))</span>
+    <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+</pre></div>
+</div>
+<p><tt class="docutils literal"><span class="pre">gettok</span></tt> works by calling the C <tt class="docutils literal"><span class="pre">getchar()</span></tt> function to read
+characters one at a time from standard input. It eats them as it
+recognizes them and stores the last character read, but not processed,
+in LastChar. The first thing that it has to do is ignore whitespace
+between tokens. This is accomplished with the loop above.</p>
+<p>The next thing <tt class="docutils literal"><span class="pre">gettok</span></tt> needs to do is recognize identifiers and
+specific keywords like “def”. Kaleidoscope does this with this simple
+loop:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">if</span> <span class="p">(</span><span class="n">isalpha</span><span class="p">(</span><span class="n">LastChar</span><span class="p">))</span> <span class="p">{</span> <span class="c1">// identifier: [a-zA-Z][a-zA-Z0-9]*</span>
+  <span class="n">IdentifierStr</span> <span class="o">=</span> <span class="n">LastChar</span><span class="p">;</span>
+  <span class="k">while</span> <span class="p">(</span><span class="n">isalnum</span><span class="p">((</span><span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">())))</span>
+    <span class="n">IdentifierStr</span> <span class="o">+=</span> <span class="n">LastChar</span><span class="p">;</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"def"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_def</span><span class="p">;</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"extern"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_extern</span><span class="p">;</span>
+  <span class="k">return</span> <span class="n">tok_identifier</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Note that this code sets the ‘<tt class="docutils literal"><span class="pre">IdentifierStr</span></tt>‘ global whenever it
+lexes an identifier. Also, since language keywords are matched by the
+same loop, we handle them here inline. Numeric values are similar:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">if</span> <span class="p">(</span><span class="n">isdigit</span><span class="p">(</span><span class="n">LastChar</span><span class="p">)</span> <span class="o">||</span> <span class="n">LastChar</span> <span class="o">==</span> <span class="sc">'.'</span><span class="p">)</span> <span class="p">{</span>   <span class="c1">// Number: [0-9.]+</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">NumStr</span><span class="p">;</span>
+  <span class="k">do</span> <span class="p">{</span>
+    <span class="n">NumStr</span> <span class="o">+=</span> <span class="n">LastChar</span><span class="p">;</span>
+    <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+  <span class="p">}</span> <span class="k">while</span> <span class="p">(</span><span class="n">isdigit</span><span class="p">(</span><span class="n">LastChar</span><span class="p">)</span> <span class="o">||</span> <span class="n">LastChar</span> <span class="o">==</span> <span class="sc">'.'</span><span class="p">);</span>
+
+  <span class="n">NumVal</span> <span class="o">=</span> <span class="n">strtod</span><span class="p">(</span><span class="n">NumStr</span><span class="p">.</span><span class="n">c_str</span><span class="p">(),</span> <span class="mi">0</span><span class="p">);</span>
+  <span class="k">return</span> <span class="n">tok_number</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>This is all pretty straight-forward code for processing input. When
+reading a numeric value from input, we use the C <tt class="docutils literal"><span class="pre">strtod</span></tt> function to
+convert it to a numeric value that we store in <tt class="docutils literal"><span class="pre">NumVal</span></tt>. Note that
+this isn’t doing sufficient error checking: it will incorrectly read
+“1.23.45.67” and handle it as if you typed in “1.23”. Feel free to
+extend it :). Next we handle comments:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">if</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">==</span> <span class="sc">'#'</span><span class="p">)</span> <span class="p">{</span>
+  <span class="c1">// Comment until end of line.</span>
+  <span class="k">do</span> <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+  <span class="k">while</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">!=</span> <span class="n">EOF</span> <span class="o">&&</span> <span class="n">LastChar</span> <span class="o">!=</span> <span class="sc">'\n'</span> <span class="o">&&</span> <span class="n">LastChar</span> <span class="o">!=</span> <span class="sc">'\r'</span><span class="p">);</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">!=</span> <span class="n">EOF</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">gettok</span><span class="p">();</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>We handle comments by skipping to the end of the line and then return
+the next token. Finally, if the input doesn’t match one of the above
+cases, it is either an operator character like ‘+’ or the end of the
+file. These are handled with this code:</p>
+<div class="highlight-c++"><div class="highlight"><pre>  <span class="c1">// Check for end of file.  Don't eat the EOF.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">==</span> <span class="n">EOF</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">tok_eof</span><span class="p">;</span>
+
+  <span class="c1">// Otherwise, just return the character as its ascii value.</span>
+  <span class="kt">int</span> <span class="n">ThisChar</span> <span class="o">=</span> <span class="n">LastChar</span><span class="p">;</span>
+  <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+  <span class="k">return</span> <span class="n">ThisChar</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>With this, we have the complete lexer for the basic Kaleidoscope
+language (the <a class="reference external" href="LangImpl2.html#code">full code listing</a> for the Lexer
+is available in the <a class="reference external" href="LangImpl2.html">next chapter</a> of the tutorial).
+Next we’ll <a class="reference external" href="LangImpl2.html">build a simple parser that uses this to build an Abstract
+Syntax Tree</a>. When we have that, we’ll include a
+driver so that you can use the lexer and parser together.</p>
+<p><a class="reference external" href="LangImpl2.html">Next: Implementing a Parser and AST</a></p>
+</div>
+</div>
+
+
+          </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="LangImpl2.html" title="2. Kaleidoscope: Implementing a Parser and AST"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="index.html" title="LLVM Tutorial: Table of Contents"
+             >previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="../index.html">Documentation</a>»</li>
+
+          <li><a href="index.html" >LLVM Tutorial: Table of Contents</a> »</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        © Copyright 2003-2013, LLVM Project.
+      Last updated on 2014-06-16.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.4.2/docs/tutorial/LangImpl2.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.4.2/docs/tutorial/LangImpl2.html?rev=211020&view=auto
==============================================================================
--- www-releases/trunk/3.4.2/docs/tutorial/LangImpl2.html (added)
+++ www-releases/trunk/3.4.2/docs/tutorial/LangImpl2.html Mon Jun 16 08:19:07 2014
@@ -0,0 +1,1117 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>2. Kaleidoscope: Implementing a Parser and AST — LLVM 3.4 documentation</title>
+    
+    <link rel="stylesheet" href="../_static/llvm-theme.css" type="text/css" />
+    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../',
+        VERSION:     '3.4',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../_static/jquery.js"></script>
+    <script type="text/javascript" src="../_static/underscore.js"></script>
+    <script type="text/javascript" src="../_static/doctools.js"></script>
+    <link rel="top" title="LLVM 3.4 documentation" href="../index.html" />
+    <link rel="up" title="LLVM Tutorial: Table of Contents" href="index.html" />
+    <link rel="next" title="3. Kaleidoscope: Code generation to LLVM IR" href="LangImpl3.html" />
+    <link rel="prev" title="1. Kaleidoscope: Tutorial Introduction and the Lexer" href="LangImpl1.html" />
+<style type="text/css">
+  table.right { float: right; margin-left: 20px; }
+  table.right td { border: 1px solid #ccc; }
+</style>
+
+  </head>
+  <body>
+<div class="logo">
+  <a href="../index.html">
+    <img src="../_static/logo.png"
+         alt="LLVM Logo" width="250" height="88"/></a>
+</div>
+
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="LangImpl3.html" title="3. Kaleidoscope: Code generation to LLVM IR"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="LangImpl1.html" title="1. Kaleidoscope: Tutorial Introduction and the Lexer"
+             accesskey="P">previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="../index.html">Documentation</a>»</li>
+
+          <li><a href="index.html" accesskey="U">LLVM Tutorial: Table of Contents</a> »</li> 
+      </ul>
+    </div>
+
+
+    <div class="document">
+      <div class="documentwrapper">
+          <div class="body">
+            
+  <div class="section" id="kaleidoscope-implementing-a-parser-and-ast">
+<h1>2. Kaleidoscope: Implementing a Parser and AST<a class="headerlink" href="#kaleidoscope-implementing-a-parser-and-ast" title="Permalink to this headline">¶</a></h1>
+<div class="contents local topic" id="contents">
+<ul class="simple">
+<li><a class="reference internal" href="#chapter-2-introduction" id="id2">Chapter 2 Introduction</a></li>
+<li><a class="reference internal" href="#the-abstract-syntax-tree-ast" id="id3">The Abstract Syntax Tree (AST)</a></li>
+<li><a class="reference internal" href="#parser-basics" id="id4">Parser Basics</a></li>
+<li><a class="reference internal" href="#basic-expression-parsing" id="id5">Basic Expression Parsing</a></li>
+<li><a class="reference internal" href="#binary-expression-parsing" id="id6">Binary Expression Parsing</a></li>
+<li><a class="reference internal" href="#parsing-the-rest" id="id7">Parsing the Rest</a></li>
+<li><a class="reference internal" href="#the-driver" id="id8">The Driver</a></li>
+<li><a class="reference internal" href="#conclusions" id="id9">Conclusions</a></li>
+<li><a class="reference internal" href="#full-code-listing" id="id10">Full Code Listing</a></li>
+</ul>
+</div>
+<div class="section" id="chapter-2-introduction">
+<h2><a class="toc-backref" href="#id2">2.1. Chapter 2 Introduction</a><a class="headerlink" href="#chapter-2-introduction" title="Permalink to this headline">¶</a></h2>
+<p>Welcome to Chapter 2 of the “<a class="reference external" href="index.html">Implementing a language with
+LLVM</a>” tutorial. This chapter shows you how to use the
+lexer, built in <a class="reference external" href="LangImpl1.html">Chapter 1</a>, to build a full
+<a class="reference external" href="http://en.wikipedia.org/wiki/Parsing">parser</a> for our Kaleidoscope
+language. Once we have a parser, we’ll define and build an <a class="reference external" href="http://en.wikipedia.org/wiki/Abstract_syntax_tree">Abstract
+Syntax Tree</a> (AST).</p>
+<p>The parser we will build uses a combination of <a class="reference external" href="http://en.wikipedia.org/wiki/Recursive_descent_parser">Recursive Descent
+Parsing</a> and
+<a class="reference external" href="http://en.wikipedia.org/wiki/Operator-precedence_parser">Operator-Precedence
+Parsing</a> to
+parse the Kaleidoscope language (the latter for binary expressions and
+the former for everything else). Before we get to parsing though, lets
+talk about the output of the parser: the Abstract Syntax Tree.</p>
+</div>
+<div class="section" id="the-abstract-syntax-tree-ast">
+<h2><a class="toc-backref" href="#id3">2.2. The Abstract Syntax Tree (AST)</a><a class="headerlink" href="#the-abstract-syntax-tree-ast" title="Permalink to this headline">¶</a></h2>
+<p>The AST for a program captures its behavior in such a way that it is
+easy for later stages of the compiler (e.g. code generation) to
+interpret. We basically want one object for each construct in the
+language, and the AST should closely model the language. In
+Kaleidoscope, we have expressions, a prototype, and a function object.
+We’ll start with expressions first:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// ExprAST - Base class for all expression nodes.</span>
+<span class="k">class</span> <span class="nc">ExprAST</span> <span class="p">{</span>
+<span class="nl">public:</span>
+  <span class="k">virtual</span> <span class="o">~</span><span class="n">ExprAST</span><span class="p">()</span> <span class="p">{}</span>
+<span class="p">};</span>
+
+<span class="c1">/// NumberExprAST - Expression class for numeric literals like "1.0".</span>
+<span class="k">class</span> <span class="nc">NumberExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="kt">double</span> <span class="n">Val</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">NumberExprAST</span><span class="p">(</span><span class="kt">double</span> <span class="n">val</span><span class="p">)</span> <span class="o">:</span> <span class="n">Val</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="p">{}</span>
+<span class="p">};</span>
+</pre></div>
+</div>
+<p>The code above shows the definition of the base ExprAST class and one
+subclass which we use for numeric literals. The important thing to note
+about this code is that the NumberExprAST class captures the numeric
+value of the literal as an instance variable. This allows later phases
+of the compiler to know what the stored numeric value is.</p>
+<p>Right now we only create the AST, so there are no useful accessor
+methods on them. It would be very easy to add a virtual method to pretty
+print the code, for example. Here are the other expression AST node
+definitions that we’ll use in the basic form of the Kaleidoscope
+language:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// VariableExprAST - Expression class for referencing a variable, like "a".</span>
+<span class="k">class</span> <span class="nc">VariableExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">Name</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">VariableExprAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">name</span><span class="p">)</span> <span class="o">:</span> <span class="n">Name</span><span class="p">(</span><span class="n">name</span><span class="p">)</span> <span class="p">{}</span>
+<span class="p">};</span>
+
+<span class="c1">/// BinaryExprAST - Expression class for a binary operator.</span>
+<span class="k">class</span> <span class="nc">BinaryExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="kt">char</span> <span class="n">Op</span><span class="p">;</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">LHS</span><span class="p">,</span> <span class="o">*</span><span class="n">RHS</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">BinaryExprAST</span><span class="p">(</span><span class="kt">char</span> <span class="n">op</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">lhs</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">rhs</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">Op</span><span class="p">(</span><span class="n">op</span><span class="p">),</span> <span class="n">LHS</span><span class="p">(</span><span class="n">lhs</span><span class="p">),</span> <span class="n">RHS</span><span class="p">(</span><span class="n">rhs</span><span class="p">)</span> <span class="p">{}</span>
+<span class="p">};</span>
+
+<span class="c1">/// CallExprAST - Expression class for function calls.</span>
+<span class="k">class</span> <span class="nc">CallExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">Callee</span><span class="p">;</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">ExprAST</span><span class="o">*></span> <span class="n">Args</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">CallExprAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">callee</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">ExprAST</span><span class="o">*></span> <span class="o">&</span><span class="n">args</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">Callee</span><span class="p">(</span><span class="n">callee</span><span class="p">),</span> <span class="n">Args</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="p">{}</span>
+<span class="p">};</span>
+</pre></div>
+</div>
+<p>This is all (intentionally) rather straight-forward: variables capture
+the variable name, binary operators capture their opcode (e.g. ‘+’), and
+calls capture a function name as well as a list of any argument
+expressions. One thing that is nice about our AST is that it captures
+the language features without talking about the syntax of the language.
+Note that there is no discussion about precedence of binary operators,
+lexical structure, etc.</p>
+<p>For our basic language, these are all of the expression nodes we’ll
+define. Because it doesn’t have conditional control flow, it isn’t
+Turing-complete; we’ll fix that in a later installment. The two things
+we need next are a way to talk about the interface to a function, and a
+way to talk about functions themselves:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// PrototypeAST - This class represents the "prototype" for a function,</span>
+<span class="c1">/// which captures its name, and its argument names (thus implicitly the number</span>
+<span class="c1">/// of arguments the function takes).</span>
+<span class="k">class</span> <span class="nc">PrototypeAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">Name</span><span class="p">;</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="n">Args</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">PrototypeAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">name</span><span class="p">,</span> <span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="o">&</span><span class="n">args</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">Name</span><span class="p">(</span><span class="n">name</span><span class="p">),</span> <span class="n">Args</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="p">{}</span>
+<span class="p">};</span>
+
+<span class="c1">/// FunctionAST - This class represents a function definition itself.</span>
+<span class="k">class</span> <span class="nc">FunctionAST</span> <span class="p">{</span>
+  <span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">Proto</span><span class="p">;</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Body</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">FunctionAST</span><span class="p">(</span><span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">proto</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">body</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">Proto</span><span class="p">(</span><span class="n">proto</span><span class="p">),</span> <span class="n">Body</span><span class="p">(</span><span class="n">body</span><span class="p">)</span> <span class="p">{}</span>
+<span class="p">};</span>
+</pre></div>
+</div>
+<p>In Kaleidoscope, functions are typed with just a count of their
+arguments. Since all values are double precision floating point, the
+type of each argument doesn’t need to be stored anywhere. In a more
+aggressive and realistic language, the “ExprAST” class would probably
+have a type field.</p>
+<p>With this scaffolding, we can now talk about parsing expressions and
+function bodies in Kaleidoscope.</p>
+</div>
+<div class="section" id="parser-basics">
+<h2><a class="toc-backref" href="#id4">2.3. Parser Basics</a><a class="headerlink" href="#parser-basics" title="Permalink to this headline">¶</a></h2>
+<p>Now that we have an AST to build, we need to define the parser code to
+build it. The idea here is that we want to parse something like “x+y”
+(which is returned as three tokens by the lexer) into an AST that could
+be generated with calls like this:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">ExprAST</span> <span class="o">*</span><span class="n">X</span> <span class="o">=</span> <span class="k">new</span> <span class="n">VariableExprAST</span><span class="p">(</span><span class="s">"x"</span><span class="p">);</span>
+<span class="n">ExprAST</span> <span class="o">*</span><span class="n">Y</span> <span class="o">=</span> <span class="k">new</span> <span class="n">VariableExprAST</span><span class="p">(</span><span class="s">"y"</span><span class="p">);</span>
+<span class="n">ExprAST</span> <span class="o">*</span><span class="n">Result</span> <span class="o">=</span> <span class="k">new</span> <span class="n">BinaryExprAST</span><span class="p">(</span><span class="sc">'+'</span><span class="p">,</span> <span class="n">X</span><span class="p">,</span> <span class="n">Y</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>In order to do this, we’ll start by defining some basic helper routines:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// CurTok/getNextToken - Provide a simple token buffer.  CurTok is the current</span>
+<span class="c1">/// token the parser is looking at.  getNextToken reads another token from the</span>
+<span class="c1">/// lexer and updates CurTok with its results.</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="n">CurTok</span><span class="p">;</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">getNextToken</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="n">CurTok</span> <span class="o">=</span> <span class="n">gettok</span><span class="p">();</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>This implements a simple token buffer around the lexer. This allows us
+to look one token ahead at what the lexer is returning. Every function
+in our parser will assume that CurTok is the current token that needs to
+be parsed.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// Error* - These are little helper functions for error handling.</span>
+<span class="n">ExprAST</span> <span class="o">*</span><span class="nf">Error</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Error: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">Str</span><span class="p">);</span><span class="k">return</span> <span class="mi">0</span><span class="p">;}</span>
+<span class="n">PrototypeAST</span> <span class="o">*</span><span class="nf">ErrorP</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">Error</span><span class="p">(</span><span class="n">Str</span><span class="p">);</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span>
+<span class="n">FunctionAST</span> <span class="o">*</span><span class="nf">ErrorF</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">Error</span><span class="p">(</span><span class="n">Str</span><span class="p">);</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span>
+</pre></div>
+</div>
+<p>The <tt class="docutils literal"><span class="pre">Error</span></tt> routines are simple helper routines that our parser will
+use to handle errors. The error recovery in our parser will not be the
+best and is not particular user-friendly, but it will be enough for our
+tutorial. These routines make it easier to handle errors in routines
+that have various return types: they always return null.</p>
+<p>With these basic helper functions, we can implement the first piece of
+our grammar: numeric literals.</p>
+</div>
+<div class="section" id="basic-expression-parsing">
+<h2><a class="toc-backref" href="#id5">2.4. Basic Expression Parsing</a><a class="headerlink" href="#basic-expression-parsing" title="Permalink to this headline">¶</a></h2>
+<p>We start with numeric literals, because they are the simplest to
+process. For each production in our grammar, we’ll define a function
+which parses that production. For numeric literals, we have:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// numberexpr ::= number</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseNumberExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Result</span> <span class="o">=</span> <span class="k">new</span> <span class="n">NumberExprAST</span><span class="p">(</span><span class="n">NumVal</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span> <span class="c1">// consume the number</span>
+  <span class="k">return</span> <span class="n">Result</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>This routine is very simple: it expects to be called when the current
+token is a <tt class="docutils literal"><span class="pre">tok_number</span></tt> token. It takes the current number value,
+creates a <tt class="docutils literal"><span class="pre">NumberExprAST</span></tt> node, advances the lexer to the next token,
+and finally returns.</p>
+<p>There are some interesting aspects to this. The most important one is
+that this routine eats all of the tokens that correspond to the
+production and returns the lexer buffer with the next token (which is
+not part of the grammar production) ready to go. This is a fairly
+standard way to go for recursive descent parsers. For a better example,
+the parenthesis operator is defined like this:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// parenexpr ::= '(' expression ')'</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseParenExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat (.</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">V</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">V</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">')'</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected ')'"</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat ).</span>
+  <span class="k">return</span> <span class="n">V</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>This function illustrates a number of interesting things about the
+parser:</p>
+<p>1) It shows how we use the Error routines. When called, this function
+expects that the current token is a ‘(‘ token, but after parsing the
+subexpression, it is possible that there is no ‘)’ waiting. For example,
+if the user types in “(4 x” instead of “(4)”, the parser should emit an
+error. Because errors can occur, the parser needs a way to indicate that
+they happened: in our parser, we return null on an error.</p>
+<p>2) Another interesting aspect of this function is that it uses recursion
+by calling <tt class="docutils literal"><span class="pre">ParseExpression</span></tt> (we will soon see that
+<tt class="docutils literal"><span class="pre">ParseExpression</span></tt> can call <tt class="docutils literal"><span class="pre">ParseParenExpr</span></tt>). This is powerful
+because it allows us to handle recursive grammars, and keeps each
+production very simple. Note that parentheses do not cause construction
+of AST nodes themselves. While we could do it this way, the most
+important role of parentheses are to guide the parser and provide
+grouping. Once the parser constructs the AST, parentheses are not
+needed.</p>
+<p>The next simple production is for handling variable references and
+function calls:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// identifierexpr</span>
+<span class="c1">///   ::= identifier</span>
+<span class="c1">///   ::= identifier '(' expression* ')'</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseIdentifierExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">IdName</span> <span class="o">=</span> <span class="n">IdentifierStr</span><span class="p">;</span>
+
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat identifier.</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">'('</span><span class="p">)</span> <span class="c1">// Simple variable ref.</span>
+    <span class="k">return</span> <span class="k">new</span> <span class="n">VariableExprAST</span><span class="p">(</span><span class="n">IdName</span><span class="p">);</span>
+
+  <span class="c1">// Call.</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat (</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">ExprAST</span><span class="o">*></span> <span class="n">Args</span><span class="p">;</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">')'</span><span class="p">)</span> <span class="p">{</span>
+    <span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+      <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Arg</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+      <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">Arg</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+      <span class="n">Args</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="n">Arg</span><span class="p">);</span>
+
+      <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">==</span> <span class="sc">')'</span><span class="p">)</span> <span class="k">break</span><span class="p">;</span>
+
+      <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">','</span><span class="p">)</span>
+        <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"Expected ')' or ',' in argument list"</span><span class="p">);</span>
+      <span class="n">getNextToken</span><span class="p">();</span>
+    <span class="p">}</span>
+  <span class="p">}</span>
+
+  <span class="c1">// Eat the ')'.</span>
+  <span class="n">getNextToken</span><span class="p">();</span>
+
+  <span class="k">return</span> <span class="k">new</span> <span class="n">CallExprAST</span><span class="p">(</span><span class="n">IdName</span><span class="p">,</span> <span class="n">Args</span><span class="p">);</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>This routine follows the same style as the other routines. (It expects
+to be called if the current token is a <tt class="docutils literal"><span class="pre">tok_identifier</span></tt> token). It
+also has recursion and error handling. One interesting aspect of this is
+that it uses <em>look-ahead</em> to determine if the current identifier is a
+stand alone variable reference or if it is a function call expression.
+It handles this by checking to see if the token after the identifier is
+a ‘(‘ token, constructing either a <tt class="docutils literal"><span class="pre">VariableExprAST</span></tt> or
+<tt class="docutils literal"><span class="pre">CallExprAST</span></tt> node as appropriate.</p>
+<p>Now that we have all of our simple expression-parsing logic in place, we
+can define a helper function to wrap it together into one entry point.
+We call this class of expressions “primary” expressions, for reasons
+that will become more clear <a class="reference external" href="LangImpl6.html#unary">later in the
+tutorial</a>. In order to parse an arbitrary
+primary expression, we need to determine what sort of expression it is:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// primary</span>
+<span class="c1">///   ::= identifierexpr</span>
+<span class="c1">///   ::= numberexpr</span>
+<span class="c1">///   ::= parenexpr</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParsePrimary</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">switch</span> <span class="p">(</span><span class="n">CurTok</span><span class="p">)</span> <span class="p">{</span>
+  <span class="nl">default:</span> <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"unknown token when expecting an expression"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="n">tok_identifier</span>: <span class="k">return</span> <span class="n">ParseIdentifierExpr</span><span class="p">();</span>
+  <span class="k">case</span> <span class="n">tok_number</span>:     <span class="k">return</span> <span class="n">ParseNumberExpr</span><span class="p">();</span>
+  <span class="k">case</span> <span class="sc">'('</span>:            <span class="k">return</span> <span class="n">ParseParenExpr</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Now that you see the definition of this function, it is more obvious why
+we can assume the state of CurTok in the various functions. This uses
+look-ahead to determine which sort of expression is being inspected, and
+then parses it with a function call.</p>
+<p>Now that basic expressions are handled, we need to handle binary
+expressions. They are a bit more complex.</p>
+</div>
+<div class="section" id="binary-expression-parsing">
+<h2><a class="toc-backref" href="#id6">2.5. Binary Expression Parsing</a><a class="headerlink" href="#binary-expression-parsing" title="Permalink to this headline">¶</a></h2>
+<p>Binary expressions are significantly harder to parse because they are
+often ambiguous. For example, when given the string “x+y*z”, the parser
+can choose to parse it as either “(x+y)*z” or “x+(y*z)”. With common
+definitions from mathematics, we expect the later parse, because “*”
+(multiplication) has higher <em>precedence</em> than “+” (addition).</p>
+<p>There are many ways to handle this, but an elegant and efficient way is
+to use <a class="reference external" href="http://en.wikipedia.org/wiki/Operator-precedence_parser">Operator-Precedence
+Parsing</a>.
+This parsing technique uses the precedence of binary operators to guide
+recursion. To start with, we need a table of precedences:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// BinopPrecedence - This holds the precedence for each binary operator that is</span>
+<span class="c1">/// defined.</span>
+<span class="k">static</span> <span class="n">std</span><span class="o">::</span><span class="n">map</span><span class="o"><</span><span class="kt">char</span><span class="p">,</span> <span class="kt">int</span><span class="o">></span> <span class="n">BinopPrecedence</span><span class="p">;</span>
+
+<span class="c1">/// GetTokPrecedence - Get the precedence of the pending binary operator token.</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">GetTokPrecedence</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">isascii</span><span class="p">(</span><span class="n">CurTok</span><span class="p">))</span>
+    <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
+
+  <span class="c1">// Make sure it's a declared binop.</span>
+  <span class="kt">int</span> <span class="n">TokPrec</span> <span class="o">=</span> <span class="n">BinopPrecedence</span><span class="p">[</span><span class="n">CurTok</span><span class="p">];</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">TokPrec</span> <span class="o"><=</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
+  <span class="k">return</span> <span class="n">TokPrec</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Install standard binary operators.</span>
+  <span class="c1">// 1 is lowest precedence.</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'<'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">10</span><span class="p">;</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'+'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">20</span><span class="p">;</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'-'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">20</span><span class="p">;</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'*'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">40</span><span class="p">;</span>  <span class="c1">// highest.</span>
+  <span class="p">...</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>For the basic form of Kaleidoscope, we will only support 4 binary
+operators (this can obviously be extended by you, our brave and intrepid
+reader). The <tt class="docutils literal"><span class="pre">GetTokPrecedence</span></tt> function returns the precedence for
+the current token, or -1 if the token is not a binary operator. Having a
+map makes it easy to add new operators and makes it clear that the
+algorithm doesn’t depend on the specific operators involved, but it
+would be easy enough to eliminate the map and do the comparisons in the
+<tt class="docutils literal"><span class="pre">GetTokPrecedence</span></tt> function. (Or just use a fixed-size array).</p>
+<p>With the helper above defined, we can now start parsing binary
+expressions. The basic idea of operator precedence parsing is to break
+down an expression with potentially ambiguous binary operators into
+pieces. Consider ,for example, the expression “a+b+(c+d)*e*f+g”.
+Operator precedence parsing considers this as a stream of primary
+expressions separated by binary operators. As such, it will first parse
+the leading primary expression “a”, then it will see the pairs [+, b]
+[+, (c+d)] [*, e] [*, f] and [+, g]. Note that because parentheses are
+primary expressions, the binary expression parser doesn’t need to worry
+about nested subexpressions like (c+d) at all.</p>
+<p>To start, an expression is a primary expression potentially followed by
+a sequence of [binop,primaryexpr] pairs:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// expression</span>
+<span class="c1">///   ::= primary binoprhs</span>
+<span class="c1">///</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseExpression</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">LHS</span> <span class="o">=</span> <span class="n">ParsePrimary</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">LHS</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="k">return</span> <span class="n">ParseBinOpRHS</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">LHS</span><span class="p">);</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p><tt class="docutils literal"><span class="pre">ParseBinOpRHS</span></tt> is the function that parses the sequence of pairs for
+us. It takes a precedence and a pointer to an expression for the part
+that has been parsed so far. Note that “x” is a perfectly valid
+expression: As such, “binoprhs” is allowed to be empty, in which case it
+returns the expression that is passed into it. In our example above, the
+code passes the expression for “a” into <tt class="docutils literal"><span class="pre">ParseBinOpRHS</span></tt> and the
+current token is “+”.</p>
+<p>The precedence value passed into <tt class="docutils literal"><span class="pre">ParseBinOpRHS</span></tt> indicates the
+<em>minimal operator precedence</em> that the function is allowed to eat. For
+example, if the current pair stream is [+, x] and <tt class="docutils literal"><span class="pre">ParseBinOpRHS</span></tt> is
+passed in a precedence of 40, it will not consume any tokens (because
+the precedence of ‘+’ is only 20). With this in mind, <tt class="docutils literal"><span class="pre">ParseBinOpRHS</span></tt>
+starts with:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// binoprhs</span>
+<span class="c1">///   ::= ('+' primary)*</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseBinOpRHS</span><span class="p">(</span><span class="kt">int</span> <span class="n">ExprPrec</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">LHS</span><span class="p">)</span> <span class="p">{</span>
+  <span class="c1">// If this is a binop, find its precedence.</span>
+  <span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+    <span class="kt">int</span> <span class="n">TokPrec</span> <span class="o">=</span> <span class="n">GetTokPrecedence</span><span class="p">();</span>
+
+    <span class="c1">// If this is a binop that binds at least as tightly as the current binop,</span>
+    <span class="c1">// consume it, otherwise we are done.</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">TokPrec</span> <span class="o"><</span> <span class="n">ExprPrec</span><span class="p">)</span>
+      <span class="k">return</span> <span class="n">LHS</span><span class="p">;</span>
+</pre></div>
+</div>
+<p>This code gets the precedence of the current token and checks to see if
+if is too low. Because we defined invalid tokens to have a precedence of
+-1, this check implicitly knows that the pair-stream ends when the token
+stream runs out of binary operators. If this check succeeds, we know
+that the token is a binary operator and that it will be included in this
+expression:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// Okay, we know this is a binop.</span>
+<span class="kt">int</span> <span class="n">BinOp</span> <span class="o">=</span> <span class="n">CurTok</span><span class="p">;</span>
+<span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat binop</span>
+
+<span class="c1">// Parse the primary expression after the binary operator.</span>
+<span class="n">ExprAST</span> <span class="o">*</span><span class="n">RHS</span> <span class="o">=</span> <span class="n">ParsePrimary</span><span class="p">();</span>
+<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">RHS</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+</pre></div>
+</div>
+<p>As such, this code eats (and remembers) the binary operator and then
+parses the primary expression that follows. This builds up the whole
+pair, the first of which is [+, b] for the running example.</p>
+<p>Now that we parsed the left-hand side of an expression and one pair of
+the RHS sequence, we have to decide which way the expression associates.
+In particular, we could have “(a+b) binop unparsed” or “a + (b binop
+unparsed)”. To determine this, we look ahead at “binop” to determine its
+precedence and compare it to BinOp’s precedence (which is ‘+’ in this
+case):</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// If BinOp binds less tightly with RHS than the operator after RHS, let</span>
+<span class="c1">// the pending operator take RHS as its LHS.</span>
+<span class="kt">int</span> <span class="n">NextPrec</span> <span class="o">=</span> <span class="n">GetTokPrecedence</span><span class="p">();</span>
+<span class="k">if</span> <span class="p">(</span><span class="n">TokPrec</span> <span class="o"><</span> <span class="n">NextPrec</span><span class="p">)</span> <span class="p">{</span>
+</pre></div>
+</div>
+<p>If the precedence of the binop to the right of “RHS” is lower or equal
+to the precedence of our current operator, then we know that the
+parentheses associate as “(a+b) binop ...”. In our example, the current
+operator is “+” and the next operator is “+”, we know that they have the
+same precedence. In this case we’ll create the AST node for “a+b”, and
+then continue parsing:</p>
+<div class="highlight-c++"><div class="highlight"><pre>      <span class="p">...</span> <span class="k">if</span> <span class="n">body</span> <span class="n">omitted</span> <span class="p">...</span>
+    <span class="p">}</span>
+
+    <span class="c1">// Merge LHS/RHS.</span>
+    <span class="n">LHS</span> <span class="o">=</span> <span class="k">new</span> <span class="n">BinaryExprAST</span><span class="p">(</span><span class="n">BinOp</span><span class="p">,</span> <span class="n">LHS</span><span class="p">,</span> <span class="n">RHS</span><span class="p">);</span>
+  <span class="p">}</span>  <span class="c1">// loop around to the top of the while loop.</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>In our example above, this will turn “a+b+” into “(a+b)” and execute the
+next iteration of the loop, with “+” as the current token. The code
+above will eat, remember, and parse “(c+d)” as the primary expression,
+which makes the current pair equal to [+, (c+d)]. It will then evaluate
+the ‘if’ conditional above with “*” as the binop to the right of the
+primary. In this case, the precedence of “*” is higher than the
+precedence of “+” so the if condition will be entered.</p>
+<p>The critical question left here is “how can the if condition parse the
+right hand side in full”? In particular, to build the AST correctly for
+our example, it needs to get all of “(c+d)*e*f” as the RHS expression
+variable. The code to do this is surprisingly simple (code from the
+above two blocks duplicated for context):</p>
+<div class="highlight-c++"><div class="highlight"><pre>    <span class="c1">// If BinOp binds less tightly with RHS than the operator after RHS, let</span>
+    <span class="c1">// the pending operator take RHS as its LHS.</span>
+    <span class="kt">int</span> <span class="n">NextPrec</span> <span class="o">=</span> <span class="n">GetTokPrecedence</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">TokPrec</span> <span class="o"><</span> <span class="n">NextPrec</span><span class="p">)</span> <span class="p">{</span>
+      <span class="n">RHS</span> <span class="o">=</span> <span class="n">ParseBinOpRHS</span><span class="p">(</span><span class="n">TokPrec</span><span class="o">+</span><span class="mi">1</span><span class="p">,</span> <span class="n">RHS</span><span class="p">);</span>
+      <span class="k">if</span> <span class="p">(</span><span class="n">RHS</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="p">}</span>
+    <span class="c1">// Merge LHS/RHS.</span>
+    <span class="n">LHS</span> <span class="o">=</span> <span class="k">new</span> <span class="n">BinaryExprAST</span><span class="p">(</span><span class="n">BinOp</span><span class="p">,</span> <span class="n">LHS</span><span class="p">,</span> <span class="n">RHS</span><span class="p">);</span>
+  <span class="p">}</span>  <span class="c1">// loop around to the top of the while loop.</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>At this point, we know that the binary operator to the RHS of our
+primary has higher precedence than the binop we are currently parsing.
+As such, we know that any sequence of pairs whose operators are all
+higher precedence than “+” should be parsed together and returned as
+“RHS”. To do this, we recursively invoke the <tt class="docutils literal"><span class="pre">ParseBinOpRHS</span></tt> function
+specifying “TokPrec+1” as the minimum precedence required for it to
+continue. In our example above, this will cause it to return the AST
+node for “(c+d)*e*f” as RHS, which is then set as the RHS of the ‘+’
+expression.</p>
+<p>Finally, on the next iteration of the while loop, the “+g” piece is
+parsed and added to the AST. With this little bit of code (14
+non-trivial lines), we correctly handle fully general binary expression
+parsing in a very elegant way. This was a whirlwind tour of this code,
+and it is somewhat subtle. I recommend running through it with a few
+tough examples to see how it works.</p>
+<p>This wraps up handling of expressions. At this point, we can point the
+parser at an arbitrary token stream and build an expression from it,
+stopping at the first token that is not part of the expression. Next up
+we need to handle function definitions, etc.</p>
+</div>
+<div class="section" id="parsing-the-rest">
+<h2><a class="toc-backref" href="#id7">2.6. Parsing the Rest</a><a class="headerlink" href="#parsing-the-rest" title="Permalink to this headline">¶</a></h2>
+<p>The next thing missing is handling of function prototypes. In
+Kaleidoscope, these are used both for ‘extern’ function declarations as
+well as function body definitions. The code to do this is
+straight-forward and not very interesting (once you’ve survived
+expressions):</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// prototype</span>
+<span class="c1">///   ::= id '(' id* ')'</span>
+<span class="k">static</span> <span class="n">PrototypeAST</span> <span class="o">*</span><span class="nf">ParsePrototype</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="n">tok_identifier</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected function name in prototype"</span><span class="p">);</span>
+
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">FnName</span> <span class="o">=</span> <span class="n">IdentifierStr</span><span class="p">;</span>
+  <span class="n">getNextToken</span><span class="p">();</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">'('</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected '(' in prototype"</span><span class="p">);</span>
+
+  <span class="c1">// Read the list of argument names.</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="n">ArgNames</span><span class="p">;</span>
+  <span class="k">while</span> <span class="p">(</span><span class="n">getNextToken</span><span class="p">()</span> <span class="o">==</span> <span class="n">tok_identifier</span><span class="p">)</span>
+    <span class="n">ArgNames</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="n">IdentifierStr</span><span class="p">);</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">')'</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected ')' in prototype"</span><span class="p">);</span>
+
+  <span class="c1">// success.</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat ')'.</span>
+
+  <span class="k">return</span> <span class="k">new</span> <span class="n">PrototypeAST</span><span class="p">(</span><span class="n">FnName</span><span class="p">,</span> <span class="n">ArgNames</span><span class="p">);</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Given this, a function definition is very simple, just a prototype plus
+an expression to implement the body:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// definition ::= 'def' prototype expression</span>
+<span class="k">static</span> <span class="n">FunctionAST</span> <span class="o">*</span><span class="nf">ParseDefinition</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat def.</span>
+  <span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">Proto</span> <span class="o">=</span> <span class="n">ParsePrototype</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Proto</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">ExprAST</span> <span class="o">*</span><span class="n">E</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">())</span>
+    <span class="k">return</span> <span class="k">new</span> <span class="n">FunctionAST</span><span class="p">(</span><span class="n">Proto</span><span class="p">,</span> <span class="n">E</span><span class="p">);</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>In addition, we support ‘extern’ to declare functions like ‘sin’ and
+‘cos’ as well as to support forward declaration of user functions. These
+‘extern’s are just prototypes with no body:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// external ::= 'extern' prototype</span>
+<span class="k">static</span> <span class="n">PrototypeAST</span> <span class="o">*</span><span class="nf">ParseExtern</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat extern.</span>
+  <span class="k">return</span> <span class="n">ParsePrototype</span><span class="p">();</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Finally, we’ll also let the user type in arbitrary top-level expressions
+and evaluate them on the fly. We will handle this by defining anonymous
+nullary (zero argument) functions for them:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// toplevelexpr ::= expression</span>
+<span class="k">static</span> <span class="n">FunctionAST</span> <span class="o">*</span><span class="nf">ParseTopLevelExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">ExprAST</span> <span class="o">*</span><span class="n">E</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">())</span> <span class="p">{</span>
+    <span class="c1">// Make an anonymous proto.</span>
+    <span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">Proto</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PrototypeAST</span><span class="p">(</span><span class="s">""</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span><span class="p">());</span>
+    <span class="k">return</span> <span class="k">new</span> <span class="n">FunctionAST</span><span class="p">(</span><span class="n">Proto</span><span class="p">,</span> <span class="n">E</span><span class="p">);</span>
+  <span class="p">}</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Now that we have all the pieces, let’s build a little driver that will
+let us actually <em>execute</em> this code we’ve built!</p>
+</div>
+<div class="section" id="the-driver">
+<h2><a class="toc-backref" href="#id8">2.7. The Driver</a><a class="headerlink" href="#the-driver" title="Permalink to this headline">¶</a></h2>
+<p>The driver for this simply invokes all of the parsing pieces with a
+top-level dispatch loop. There isn’t much interesting here, so I’ll just
+include the top-level loop. See <a class="reference external" href="#code">below</a> for full code in the
+“Top-Level Parsing” section.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// top ::= definition | external | expression | ';'</span>
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">MainLoop</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"ready> "</span><span class="p">);</span>
+    <span class="k">switch</span> <span class="p">(</span><span class="n">CurTok</span><span class="p">)</span> <span class="p">{</span>
+    <span class="k">case</span> <span class="n">tok_eof</span>:    <span class="k">return</span><span class="p">;</span>
+    <span class="k">case</span> <span class="sc">';'</span>:        <span class="n">getNextToken</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>  <span class="c1">// ignore top-level semicolons.</span>
+    <span class="k">case</span> <span class="n">tok_def</span>:    <span class="n">HandleDefinition</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>
+    <span class="k">case</span> <span class="n">tok_extern</span>: <span class="n">HandleExtern</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>
+    <span class="nl">default:</span>         <span class="n">HandleTopLevelExpression</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>
+    <span class="p">}</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>The most interesting part of this is that we ignore top-level
+semicolons. Why is this, you ask? The basic reason is that if you type
+“4 + 5” at the command line, the parser doesn’t know whether that is the
+end of what you will type or not. For example, on the next line you
+could type “def foo...” in which case 4+5 is the end of a top-level
+expression. Alternatively you could type “* 6”, which would continue
+the expression. Having top-level semicolons allows you to type “4+5;”,
+and the parser will know you are done.</p>
+</div>
+<div class="section" id="conclusions">
+<h2><a class="toc-backref" href="#id9">2.8. Conclusions</a><a class="headerlink" href="#conclusions" title="Permalink to this headline">¶</a></h2>
+<p>With just under 400 lines of commented code (240 lines of non-comment,
+non-blank code), we fully defined our minimal language, including a
+lexer, parser, and AST builder. With this done, the executable will
+validate Kaleidoscope code and tell us if it is grammatically invalid.
+For example, here is a sample interaction:</p>
+<div class="highlight-bash"><pre>$ ./a.out
+ready> def foo(x y) x+foo(y, 4.0);
+Parsed a function definition.
+ready> def foo(x y) x+y y;
+Parsed a function definition.
+Parsed a top-level expr
+ready> def foo(x y) x+y );
+Parsed a function definition.
+Error: unknown token when expecting an expression
+ready> extern sin(a);
+ready> Parsed an extern
+ready> ^D
+$</pre>
+</div>
+<p>There is a lot of room for extension here. You can define new AST nodes,
+extend the language in many ways, etc. In the <a class="reference external" href="LangImpl3.html">next
+installment</a>, we will describe how to generate LLVM
+Intermediate Representation (IR) from the AST.</p>
+</div>
+<div class="section" id="full-code-listing">
+<h2><a class="toc-backref" href="#id10">2.9. Full Code Listing</a><a class="headerlink" href="#full-code-listing" title="Permalink to this headline">¶</a></h2>
+<p>Here is the complete code listing for this and the previous chapter.
+Note that it is fully self-contained: you don’t need LLVM or any
+external libraries at all for this. (Besides the C and C++ standard
+libraries, of course.) To build this, just compile with:</p>
+<div class="highlight-bash"><div class="highlight"><pre><span class="c"># Compile</span>
+clang++ -g -O3 toy.cpp
+<span class="c"># Run</span>
+./a.out
+</pre></div>
+</div>
+<p>Here is the code:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include <cctype></span>
+<span class="cp">#include <cstdio></span>
+<span class="cp">#include <cstdlib></span>
+<span class="cp">#include <map></span>
+<span class="cp">#include <string></span>
+<span class="cp">#include <vector></span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Lexer</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="c1">// The lexer returns tokens [0-255] if it is an unknown character, otherwise one</span>
+<span class="c1">// of these for known things.</span>
+<span class="k">enum</span> <span class="n">Token</span> <span class="p">{</span>
+  <span class="n">tok_eof</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span>
+
+  <span class="c1">// commands</span>
+  <span class="n">tok_def</span> <span class="o">=</span> <span class="o">-</span><span class="mi">2</span><span class="p">,</span> <span class="n">tok_extern</span> <span class="o">=</span> <span class="o">-</span><span class="mi">3</span><span class="p">,</span>
+
+  <span class="c1">// primary</span>
+  <span class="n">tok_identifier</span> <span class="o">=</span> <span class="o">-</span><span class="mi">4</span><span class="p">,</span> <span class="n">tok_number</span> <span class="o">=</span> <span class="o">-</span><span class="mi">5</span>
+<span class="p">};</span>
+
+<span class="k">static</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">IdentifierStr</span><span class="p">;</span>  <span class="c1">// Filled in if tok_identifier</span>
+<span class="k">static</span> <span class="kt">double</span> <span class="n">NumVal</span><span class="p">;</span>              <span class="c1">// Filled in if tok_number</span>
+
+<span class="c1">/// gettok - Return the next token from standard input.</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">gettok</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">static</span> <span class="kt">int</span> <span class="n">LastChar</span> <span class="o">=</span> <span class="sc">' '</span><span class="p">;</span>
+
+  <span class="c1">// Skip any whitespace.</span>
+  <span class="k">while</span> <span class="p">(</span><span class="n">isspace</span><span class="p">(</span><span class="n">LastChar</span><span class="p">))</span>
+    <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">isalpha</span><span class="p">(</span><span class="n">LastChar</span><span class="p">))</span> <span class="p">{</span> <span class="c1">// identifier: [a-zA-Z][a-zA-Z0-9]*</span>
+    <span class="n">IdentifierStr</span> <span class="o">=</span> <span class="n">LastChar</span><span class="p">;</span>
+    <span class="k">while</span> <span class="p">(</span><span class="n">isalnum</span><span class="p">((</span><span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">())))</span>
+      <span class="n">IdentifierStr</span> <span class="o">+=</span> <span class="n">LastChar</span><span class="p">;</span>
+
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"def"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_def</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"extern"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_extern</span><span class="p">;</span>
+    <span class="k">return</span> <span class="n">tok_identifier</span><span class="p">;</span>
+  <span class="p">}</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">isdigit</span><span class="p">(</span><span class="n">LastChar</span><span class="p">)</span> <span class="o">||</span> <span class="n">LastChar</span> <span class="o">==</span> <span class="sc">'.'</span><span class="p">)</span> <span class="p">{</span>   <span class="c1">// Number: [0-9.]+</span>
+    <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">NumStr</span><span class="p">;</span>
+    <span class="k">do</span> <span class="p">{</span>
+      <span class="n">NumStr</span> <span class="o">+=</span> <span class="n">LastChar</span><span class="p">;</span>
+      <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+    <span class="p">}</span> <span class="k">while</span> <span class="p">(</span><span class="n">isdigit</span><span class="p">(</span><span class="n">LastChar</span><span class="p">)</span> <span class="o">||</span> <span class="n">LastChar</span> <span class="o">==</span> <span class="sc">'.'</span><span class="p">);</span>
+
+    <span class="n">NumVal</span> <span class="o">=</span> <span class="n">strtod</span><span class="p">(</span><span class="n">NumStr</span><span class="p">.</span><span class="n">c_str</span><span class="p">(),</span> <span class="mi">0</span><span class="p">);</span>
+    <span class="k">return</span> <span class="n">tok_number</span><span class="p">;</span>
+  <span class="p">}</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">==</span> <span class="sc">'#'</span><span class="p">)</span> <span class="p">{</span>
+    <span class="c1">// Comment until end of line.</span>
+    <span class="k">do</span> <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+    <span class="k">while</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">!=</span> <span class="n">EOF</span> <span class="o">&&</span> <span class="n">LastChar</span> <span class="o">!=</span> <span class="sc">'\n'</span> <span class="o">&&</span> <span class="n">LastChar</span> <span class="o">!=</span> <span class="sc">'\r'</span><span class="p">);</span>
+    
+    <span class="k">if</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">!=</span> <span class="n">EOF</span><span class="p">)</span>
+      <span class="k">return</span> <span class="n">gettok</span><span class="p">();</span>
+  <span class="p">}</span>
+  
+  <span class="c1">// Check for end of file.  Don't eat the EOF.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">==</span> <span class="n">EOF</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">tok_eof</span><span class="p">;</span>
+
+  <span class="c1">// Otherwise, just return the character as its ascii value.</span>
+  <span class="kt">int</span> <span class="n">ThisChar</span> <span class="o">=</span> <span class="n">LastChar</span><span class="p">;</span>
+  <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+  <span class="k">return</span> <span class="n">ThisChar</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Abstract Syntax Tree (aka Parse Tree)</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="k">namespace</span> <span class="p">{</span>
+<span class="c1">/// ExprAST - Base class for all expression nodes.</span>
+<span class="k">class</span> <span class="nc">ExprAST</span> <span class="p">{</span>
+<span class="nl">public:</span>
+  <span class="k">virtual</span> <span class="o">~</span><span class="n">ExprAST</span><span class="p">()</span> <span class="p">{}</span>
+<span class="p">};</span>
+
+<span class="c1">/// NumberExprAST - Expression class for numeric literals like "1.0".</span>
+<span class="k">class</span> <span class="nc">NumberExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+<span class="nl">public:</span>
+  <span class="n">NumberExprAST</span><span class="p">(</span><span class="kt">double</span> <span class="n">val</span><span class="p">)</span> <span class="p">{}</span>
+<span class="p">};</span>
+
+<span class="c1">/// VariableExprAST - Expression class for referencing a variable, like "a".</span>
+<span class="k">class</span> <span class="nc">VariableExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">Name</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">VariableExprAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">name</span><span class="p">)</span> <span class="o">:</span> <span class="n">Name</span><span class="p">(</span><span class="n">name</span><span class="p">)</span> <span class="p">{}</span>
+<span class="p">};</span>
+
+<span class="c1">/// BinaryExprAST - Expression class for a binary operator.</span>
+<span class="k">class</span> <span class="nc">BinaryExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+<span class="nl">public:</span>
+  <span class="n">BinaryExprAST</span><span class="p">(</span><span class="kt">char</span> <span class="n">op</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">lhs</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">rhs</span><span class="p">)</span> <span class="p">{}</span>
+<span class="p">};</span>
+
+<span class="c1">/// CallExprAST - Expression class for function calls.</span>
+<span class="k">class</span> <span class="nc">CallExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">Callee</span><span class="p">;</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">ExprAST</span><span class="o">*></span> <span class="n">Args</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">CallExprAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">callee</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">ExprAST</span><span class="o">*></span> <span class="o">&</span><span class="n">args</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">Callee</span><span class="p">(</span><span class="n">callee</span><span class="p">),</span> <span class="n">Args</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="p">{}</span>
+<span class="p">};</span>
+
+<span class="c1">/// PrototypeAST - This class represents the "prototype" for a function,</span>
+<span class="c1">/// which captures its name, and its argument names (thus implicitly the number</span>
+<span class="c1">/// of arguments the function takes).</span>
+<span class="k">class</span> <span class="nc">PrototypeAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">Name</span><span class="p">;</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="n">Args</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">PrototypeAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">name</span><span class="p">,</span> <span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="o">&</span><span class="n">args</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">Name</span><span class="p">(</span><span class="n">name</span><span class="p">),</span> <span class="n">Args</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="p">{}</span>
+  
+<span class="p">};</span>
+
+<span class="c1">/// FunctionAST - This class represents a function definition itself.</span>
+<span class="k">class</span> <span class="nc">FunctionAST</span> <span class="p">{</span>
+<span class="nl">public:</span>
+  <span class="n">FunctionAST</span><span class="p">(</span><span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">proto</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">body</span><span class="p">)</span> <span class="p">{}</span>
+<span class="p">};</span>
+<span class="p">}</span> <span class="c1">// end anonymous namespace</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Parser</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="c1">/// CurTok/getNextToken - Provide a simple token buffer.  CurTok is the current</span>
+<span class="c1">/// token the parser is looking at.  getNextToken reads another token from the</span>
+<span class="c1">/// lexer and updates CurTok with its results.</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="n">CurTok</span><span class="p">;</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">getNextToken</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="n">CurTok</span> <span class="o">=</span> <span class="n">gettok</span><span class="p">();</span>
+<span class="p">}</span>
+
+<span class="c1">/// BinopPrecedence - This holds the precedence for each binary operator that is</span>
+<span class="c1">/// defined.</span>
+<span class="k">static</span> <span class="n">std</span><span class="o">::</span><span class="n">map</span><span class="o"><</span><span class="kt">char</span><span class="p">,</span> <span class="kt">int</span><span class="o">></span> <span class="n">BinopPrecedence</span><span class="p">;</span>
+
+<span class="c1">/// GetTokPrecedence - Get the precedence of the pending binary operator token.</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">GetTokPrecedence</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">isascii</span><span class="p">(</span><span class="n">CurTok</span><span class="p">))</span>
+    <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
+  
+  <span class="c1">// Make sure it's a declared binop.</span>
+  <span class="kt">int</span> <span class="n">TokPrec</span> <span class="o">=</span> <span class="n">BinopPrecedence</span><span class="p">[</span><span class="n">CurTok</span><span class="p">];</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">TokPrec</span> <span class="o"><=</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
+  <span class="k">return</span> <span class="n">TokPrec</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// Error* - These are little helper functions for error handling.</span>
+<span class="n">ExprAST</span> <span class="o">*</span><span class="nf">Error</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Error: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">Str</span><span class="p">);</span><span class="k">return</span> <span class="mi">0</span><span class="p">;}</span>
+<span class="n">PrototypeAST</span> <span class="o">*</span><span class="nf">ErrorP</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">Error</span><span class="p">(</span><span class="n">Str</span><span class="p">);</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span>
+
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseExpression</span><span class="p">();</span>
+
+<span class="c1">/// identifierexpr</span>
+<span class="c1">///   ::= identifier</span>
+<span class="c1">///   ::= identifier '(' expression* ')'</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseIdentifierExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">IdName</span> <span class="o">=</span> <span class="n">IdentifierStr</span><span class="p">;</span>
+  
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat identifier.</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">'('</span><span class="p">)</span> <span class="c1">// Simple variable ref.</span>
+    <span class="k">return</span> <span class="k">new</span> <span class="n">VariableExprAST</span><span class="p">(</span><span class="n">IdName</span><span class="p">);</span>
+  
+  <span class="c1">// Call.</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat (</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">ExprAST</span><span class="o">*></span> <span class="n">Args</span><span class="p">;</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">')'</span><span class="p">)</span> <span class="p">{</span>
+    <span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+      <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Arg</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+      <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">Arg</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+      <span class="n">Args</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="n">Arg</span><span class="p">);</span>
+
+      <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">==</span> <span class="sc">')'</span><span class="p">)</span> <span class="k">break</span><span class="p">;</span>
+
+      <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">','</span><span class="p">)</span>
+        <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"Expected ')' or ',' in argument list"</span><span class="p">);</span>
+      <span class="n">getNextToken</span><span class="p">();</span>
+    <span class="p">}</span>
+  <span class="p">}</span>
+
+  <span class="c1">// Eat the ')'.</span>
+  <span class="n">getNextToken</span><span class="p">();</span>
+  
+  <span class="k">return</span> <span class="k">new</span> <span class="n">CallExprAST</span><span class="p">(</span><span class="n">IdName</span><span class="p">,</span> <span class="n">Args</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="c1">/// numberexpr ::= number</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseNumberExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Result</span> <span class="o">=</span> <span class="k">new</span> <span class="n">NumberExprAST</span><span class="p">(</span><span class="n">NumVal</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span> <span class="c1">// consume the number</span>
+  <span class="k">return</span> <span class="n">Result</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// parenexpr ::= '(' expression ')'</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseParenExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat (.</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">V</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">V</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">')'</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected ')'"</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat ).</span>
+  <span class="k">return</span> <span class="n">V</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// primary</span>
+<span class="c1">///   ::= identifierexpr</span>
+<span class="c1">///   ::= numberexpr</span>
+<span class="c1">///   ::= parenexpr</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParsePrimary</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">switch</span> <span class="p">(</span><span class="n">CurTok</span><span class="p">)</span> <span class="p">{</span>
+  <span class="nl">default:</span> <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"unknown token when expecting an expression"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="n">tok_identifier</span>: <span class="k">return</span> <span class="n">ParseIdentifierExpr</span><span class="p">();</span>
+  <span class="k">case</span> <span class="n">tok_number</span>:     <span class="k">return</span> <span class="n">ParseNumberExpr</span><span class="p">();</span>
+  <span class="k">case</span> <span class="sc">'('</span>:            <span class="k">return</span> <span class="n">ParseParenExpr</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="c1">/// binoprhs</span>
+<span class="c1">///   ::= ('+' primary)*</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseBinOpRHS</span><span class="p">(</span><span class="kt">int</span> <span class="n">ExprPrec</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">LHS</span><span class="p">)</span> <span class="p">{</span>
+  <span class="c1">// If this is a binop, find its precedence.</span>
+  <span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+    <span class="kt">int</span> <span class="n">TokPrec</span> <span class="o">=</span> <span class="n">GetTokPrecedence</span><span class="p">();</span>
+    
+    <span class="c1">// If this is a binop that binds at least as tightly as the current binop,</span>
+    <span class="c1">// consume it, otherwise we are done.</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">TokPrec</span> <span class="o"><</span> <span class="n">ExprPrec</span><span class="p">)</span>
+      <span class="k">return</span> <span class="n">LHS</span><span class="p">;</span>
+    
+    <span class="c1">// Okay, we know this is a binop.</span>
+    <span class="kt">int</span> <span class="n">BinOp</span> <span class="o">=</span> <span class="n">CurTok</span><span class="p">;</span>
+    <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat binop</span>
+    
+    <span class="c1">// Parse the primary expression after the binary operator.</span>
+    <span class="n">ExprAST</span> <span class="o">*</span><span class="n">RHS</span> <span class="o">=</span> <span class="n">ParsePrimary</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">RHS</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+    
+    <span class="c1">// If BinOp binds less tightly with RHS than the operator after RHS, let</span>
+    <span class="c1">// the pending operator take RHS as its LHS.</span>
+    <span class="kt">int</span> <span class="n">NextPrec</span> <span class="o">=</span> <span class="n">GetTokPrecedence</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">TokPrec</span> <span class="o"><</span> <span class="n">NextPrec</span><span class="p">)</span> <span class="p">{</span>
+      <span class="n">RHS</span> <span class="o">=</span> <span class="n">ParseBinOpRHS</span><span class="p">(</span><span class="n">TokPrec</span><span class="o">+</span><span class="mi">1</span><span class="p">,</span> <span class="n">RHS</span><span class="p">);</span>
+      <span class="k">if</span> <span class="p">(</span><span class="n">RHS</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="p">}</span>
+    
+    <span class="c1">// Merge LHS/RHS.</span>
+    <span class="n">LHS</span> <span class="o">=</span> <span class="k">new</span> <span class="n">BinaryExprAST</span><span class="p">(</span><span class="n">BinOp</span><span class="p">,</span> <span class="n">LHS</span><span class="p">,</span> <span class="n">RHS</span><span class="p">);</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="c1">/// expression</span>
+<span class="c1">///   ::= primary binoprhs</span>
+<span class="c1">///</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseExpression</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">LHS</span> <span class="o">=</span> <span class="n">ParsePrimary</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">LHS</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="k">return</span> <span class="n">ParseBinOpRHS</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">LHS</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="c1">/// prototype</span>
+<span class="c1">///   ::= id '(' id* ')'</span>
+<span class="k">static</span> <span class="n">PrototypeAST</span> <span class="o">*</span><span class="nf">ParsePrototype</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="n">tok_identifier</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected function name in prototype"</span><span class="p">);</span>
+
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">FnName</span> <span class="o">=</span> <span class="n">IdentifierStr</span><span class="p">;</span>
+  <span class="n">getNextToken</span><span class="p">();</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">'('</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected '(' in prototype"</span><span class="p">);</span>
+  
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="n">ArgNames</span><span class="p">;</span>
+  <span class="k">while</span> <span class="p">(</span><span class="n">getNextToken</span><span class="p">()</span> <span class="o">==</span> <span class="n">tok_identifier</span><span class="p">)</span>
+    <span class="n">ArgNames</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="n">IdentifierStr</span><span class="p">);</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">')'</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected ')' in prototype"</span><span class="p">);</span>
+  
+  <span class="c1">// success.</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat ')'.</span>
+  
+  <span class="k">return</span> <span class="k">new</span> <span class="n">PrototypeAST</span><span class="p">(</span><span class="n">FnName</span><span class="p">,</span> <span class="n">ArgNames</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="c1">/// definition ::= 'def' prototype expression</span>
+<span class="k">static</span> <span class="n">FunctionAST</span> <span class="o">*</span><span class="nf">ParseDefinition</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat def.</span>
+  <span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">Proto</span> <span class="o">=</span> <span class="n">ParsePrototype</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Proto</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">ExprAST</span> <span class="o">*</span><span class="n">E</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">())</span>
+    <span class="k">return</span> <span class="k">new</span> <span class="n">FunctionAST</span><span class="p">(</span><span class="n">Proto</span><span class="p">,</span> <span class="n">E</span><span class="p">);</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// toplevelexpr ::= expression</span>
+<span class="k">static</span> <span class="n">FunctionAST</span> <span class="o">*</span><span class="nf">ParseTopLevelExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">ExprAST</span> <span class="o">*</span><span class="n">E</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">())</span> <span class="p">{</span>
+    <span class="c1">// Make an anonymous proto.</span>
+    <span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">Proto</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PrototypeAST</span><span class="p">(</span><span class="s">""</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span><span class="p">());</span>
+    <span class="k">return</span> <span class="k">new</span> <span class="n">FunctionAST</span><span class="p">(</span><span class="n">Proto</span><span class="p">,</span> <span class="n">E</span><span class="p">);</span>
+  <span class="p">}</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// external ::= 'extern' prototype</span>
+<span class="k">static</span> <span class="n">PrototypeAST</span> <span class="o">*</span><span class="nf">ParseExtern</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat extern.</span>
+  <span class="k">return</span> <span class="n">ParsePrototype</span><span class="p">();</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Top-Level parsing</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">HandleDefinition</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">ParseDefinition</span><span class="p">())</span> <span class="p">{</span>
+    <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Parsed a function definition.</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+    <span class="c1">// Skip token for error recovery.</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">HandleExtern</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">ParseExtern</span><span class="p">())</span> <span class="p">{</span>
+    <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Parsed an extern</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+    <span class="c1">// Skip token for error recovery.</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">HandleTopLevelExpression</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Evaluate a top-level expression into an anonymous function.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">ParseTopLevelExpr</span><span class="p">())</span> <span class="p">{</span>
+    <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Parsed a top-level expr</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+    <span class="c1">// Skip token for error recovery.</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="c1">/// top ::= definition | external | expression | ';'</span>
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">MainLoop</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"ready> "</span><span class="p">);</span>
+    <span class="k">switch</span> <span class="p">(</span><span class="n">CurTok</span><span class="p">)</span> <span class="p">{</span>
+    <span class="k">case</span> <span class="n">tok_eof</span>:    <span class="k">return</span><span class="p">;</span>
+    <span class="k">case</span> <span class="sc">';'</span>:        <span class="n">getNextToken</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>  <span class="c1">// ignore top-level semicolons.</span>
+    <span class="k">case</span> <span class="n">tok_def</span>:    <span class="n">HandleDefinition</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>
+    <span class="k">case</span> <span class="n">tok_extern</span>: <span class="n">HandleExtern</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>
+    <span class="nl">default:</span>         <span class="n">HandleTopLevelExpression</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>
+    <span class="p">}</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Main driver code.</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Install standard binary operators.</span>
+  <span class="c1">// 1 is lowest precedence.</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'<'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">10</span><span class="p">;</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'+'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">20</span><span class="p">;</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'-'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">20</span><span class="p">;</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'*'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">40</span><span class="p">;</span>  <span class="c1">// highest.</span>
+
+  <span class="c1">// Prime the first token.</span>
+  <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"ready> "</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>
+
+  <span class="c1">// Run the main "interpreter loop" now.</span>
+  <span class="n">MainLoop</span><span class="p">();</span>
+
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p><a class="reference external" href="LangImpl3.html">Next: Implementing Code Generation to LLVM IR</a></p>
+</div>
+</div>
+
+
+          </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="LangImpl3.html" title="3. Kaleidoscope: Code generation to LLVM IR"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="LangImpl1.html" title="1. Kaleidoscope: Tutorial Introduction and the Lexer"
+             >previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="../index.html">Documentation</a>»</li>
+
+          <li><a href="index.html" >LLVM Tutorial: Table of Contents</a> »</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        © Copyright 2003-2013, LLVM Project.
+      Last updated on 2014-06-16.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.4.2/docs/tutorial/LangImpl3.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.4.2/docs/tutorial/LangImpl3.html?rev=211020&view=auto
==============================================================================
--- www-releases/trunk/3.4.2/docs/tutorial/LangImpl3.html (added)
+++ www-releases/trunk/3.4.2/docs/tutorial/LangImpl3.html Mon Jun 16 08:19:07 2014
@@ -0,0 +1,1188 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>3. Kaleidoscope: Code generation to LLVM IR — LLVM 3.4 documentation</title>
+    
+    <link rel="stylesheet" href="../_static/llvm-theme.css" type="text/css" />
+    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../',
+        VERSION:     '3.4',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../_static/jquery.js"></script>
+    <script type="text/javascript" src="../_static/underscore.js"></script>
+    <script type="text/javascript" src="../_static/doctools.js"></script>
+    <link rel="top" title="LLVM 3.4 documentation" href="../index.html" />
+    <link rel="up" title="LLVM Tutorial: Table of Contents" href="index.html" />
+    <link rel="next" title="4. Kaleidoscope: Adding JIT and Optimizer Support" href="LangImpl4.html" />
+    <link rel="prev" title="2. Kaleidoscope: Implementing a Parser and AST" href="LangImpl2.html" />
+<style type="text/css">
+  table.right { float: right; margin-left: 20px; }
+  table.right td { border: 1px solid #ccc; }
+</style>
+
+  </head>
+  <body>
+<div class="logo">
+  <a href="../index.html">
+    <img src="../_static/logo.png"
+         alt="LLVM Logo" width="250" height="88"/></a>
+</div>
+
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="LangImpl4.html" title="4. Kaleidoscope: Adding JIT and Optimizer Support"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="LangImpl2.html" title="2. Kaleidoscope: Implementing a Parser and AST"
+             accesskey="P">previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="../index.html">Documentation</a>»</li>
+
+          <li><a href="index.html" accesskey="U">LLVM Tutorial: Table of Contents</a> »</li> 
+      </ul>
+    </div>
+
+
+    <div class="document">
+      <div class="documentwrapper">
+          <div class="body">
+            
+  <div class="section" id="kaleidoscope-code-generation-to-llvm-ir">
+<h1>3. Kaleidoscope: Code generation to LLVM IR<a class="headerlink" href="#kaleidoscope-code-generation-to-llvm-ir" title="Permalink to this headline">¶</a></h1>
+<div class="contents local topic" id="contents">
+<ul class="simple">
+<li><a class="reference internal" href="#chapter-3-introduction" id="id1">Chapter 3 Introduction</a></li>
+<li><a class="reference internal" href="#code-generation-setup" id="id2">Code Generation Setup</a></li>
+<li><a class="reference internal" href="#expression-code-generation" id="id3">Expression Code Generation</a></li>
+<li><a class="reference internal" href="#function-code-generation" id="id4">Function Code Generation</a></li>
+<li><a class="reference internal" href="#driver-changes-and-closing-thoughts" id="id5">Driver Changes and Closing Thoughts</a></li>
+<li><a class="reference internal" href="#full-code-listing" id="id6">Full Code Listing</a></li>
+</ul>
+</div>
+<div class="section" id="chapter-3-introduction">
+<h2><a class="toc-backref" href="#id1">3.1. Chapter 3 Introduction</a><a class="headerlink" href="#chapter-3-introduction" title="Permalink to this headline">¶</a></h2>
+<p>Welcome to Chapter 3 of the “<a class="reference external" href="index.html">Implementing a language with
+LLVM</a>” tutorial. This chapter shows you how to transform
+the <a class="reference external" href="LangImpl2.html">Abstract Syntax Tree</a>, built in Chapter 2, into
+LLVM IR. This will teach you a little bit about how LLVM does things, as
+well as demonstrate how easy it is to use. It’s much more work to build
+a lexer and parser than it is to generate LLVM IR code. :)</p>
+<p><strong>Please note</strong>: the code in this chapter and later require LLVM 2.2 or
+later. LLVM 2.1 and before will not work with it. Also note that you
+need to use a version of this tutorial that matches your LLVM release:
+If you are using an official LLVM release, use the version of the
+documentation included with your release or on the <a class="reference external" href="http://llvm.org/releases/">llvm.org releases
+page</a>.</p>
+</div>
+<div class="section" id="code-generation-setup">
+<h2><a class="toc-backref" href="#id2">3.2. Code Generation Setup</a><a class="headerlink" href="#code-generation-setup" title="Permalink to this headline">¶</a></h2>
+<p>In order to generate LLVM IR, we want some simple setup to get started.
+First we define virtual code generation (codegen) methods in each AST
+class:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// ExprAST - Base class for all expression nodes.</span>
+<span class="k">class</span> <span class="nc">ExprAST</span> <span class="p">{</span>
+<span class="nl">public:</span>
+  <span class="k">virtual</span> <span class="o">~</span><span class="n">ExprAST</span><span class="p">()</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">()</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">};</span>
+
+<span class="c1">/// NumberExprAST - Expression class for numeric literals like "1.0".</span>
+<span class="k">class</span> <span class="nc">NumberExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="kt">double</span> <span class="n">Val</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">NumberExprAST</span><span class="p">(</span><span class="kt">double</span> <span class="n">val</span><span class="p">)</span> <span class="o">:</span> <span class="n">Val</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+<span class="p">...</span>
+</pre></div>
+</div>
+<p>The Codegen() method says to emit IR for that AST node along with all
+the things it depends on, and they all return an LLVM Value object.
+“Value” is the class used to represent a “<a class="reference external" href="http://en.wikipedia.org/wiki/Static_single_assignment_form">Static Single Assignment
+(SSA)</a>
+register” or “SSA value” in LLVM. The most distinct aspect of SSA values
+is that their value is computed as the related instruction executes, and
+it does not get a new value until (and if) the instruction re-executes.
+In other words, there is no way to “change” an SSA value. For more
+information, please read up on <a class="reference external" href="http://en.wikipedia.org/wiki/Static_single_assignment_form">Static Single
+Assignment</a>
+- the concepts are really quite natural once you grok them.</p>
+<p>Note that instead of adding virtual methods to the ExprAST class
+hierarchy, it could also make sense to use a <a class="reference external" href="http://en.wikipedia.org/wiki/Visitor_pattern">visitor
+pattern</a> or some other
+way to model this. Again, this tutorial won’t dwell on good software
+engineering practices: for our purposes, adding a virtual method is
+simplest.</p>
+<p>The second thing we want is an “Error” method like we used for the
+parser, which will be used to report errors found during code generation
+(for example, use of an undeclared parameter):</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">Value</span> <span class="o">*</span><span class="nf">ErrorV</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">Error</span><span class="p">(</span><span class="n">Str</span><span class="p">);</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span>
+
+<span class="k">static</span> <span class="n">Module</span> <span class="o">*</span><span class="n">TheModule</span><span class="p">;</span>
+<span class="k">static</span> <span class="n">IRBuilder</span><span class="o"><></span> <span class="n">Builder</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">());</span>
+<span class="k">static</span> <span class="n">std</span><span class="o">::</span><span class="n">map</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="p">,</span> <span class="n">Value</span><span class="o">*></span> <span class="n">NamedValues</span><span class="p">;</span>
+</pre></div>
+</div>
+<p>The static variables will be used during code generation. <tt class="docutils literal"><span class="pre">TheModule</span></tt>
+is the LLVM construct that contains all of the functions and global
+variables in a chunk of code. In many ways, it is the top-level
+structure that the LLVM IR uses to contain code.</p>
+<p>The <tt class="docutils literal"><span class="pre">Builder</span></tt> object is a helper object that makes it easy to generate
+LLVM instructions. Instances of the
+<tt class="docutils literal"><span class="pre">`IRBuilder</span></tt> <<a class="reference external" href="http://llvm.org/doxygen/IRBuilder_8h-source.html">http://llvm.org/doxygen/IRBuilder_8h-source.html</a>>`_
+class template keep track of the current place to insert instructions
+and has methods to create new instructions.</p>
+<p>The <tt class="docutils literal"><span class="pre">NamedValues</span></tt> map keeps track of which values are defined in the
+current scope and what their LLVM representation is. (In other words, it
+is a symbol table for the code). In this form of Kaleidoscope, the only
+things that can be referenced are function parameters. As such, function
+parameters will be in this map when generating code for their function
+body.</p>
+<p>With these basics in place, we can start talking about how to generate
+code for each expression. Note that this assumes that the <tt class="docutils literal"><span class="pre">Builder</span></tt>
+has been set up to generate code <em>into</em> something. For now, we’ll assume
+that this has already been done, and we’ll just use it to emit code.</p>
+</div>
+<div class="section" id="expression-code-generation">
+<h2><a class="toc-backref" href="#id3">3.3. Expression Code Generation</a><a class="headerlink" href="#expression-code-generation" title="Permalink to this headline">¶</a></h2>
+<p>Generating LLVM code for expression nodes is very straightforward: less
+than 45 lines of commented code for all four of our expression nodes.
+First we’ll do numeric literals:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">Value</span> <span class="o">*</span><span class="n">NumberExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="n">ConstantFP</span><span class="o">::</span><span class="n">get</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="n">APFloat</span><span class="p">(</span><span class="n">Val</span><span class="p">));</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>In the LLVM IR, numeric constants are represented with the
+<tt class="docutils literal"><span class="pre">ConstantFP</span></tt> class, which holds the numeric value in an <tt class="docutils literal"><span class="pre">APFloat</span></tt>
+internally (<tt class="docutils literal"><span class="pre">APFloat</span></tt> has the capability of holding floating point
+constants of Arbitrary Precision). This code basically just creates
+and returns a <tt class="docutils literal"><span class="pre">ConstantFP</span></tt>. Note that in the LLVM IR that constants
+are all uniqued together and shared. For this reason, the API uses the
+“foo::get(...)” idiom instead of “new foo(..)” or “foo::Create(..)”.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">Value</span> <span class="o">*</span><span class="n">VariableExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Look this variable up in the function.</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">V</span> <span class="o">=</span> <span class="n">NamedValues</span><span class="p">[</span><span class="n">Name</span><span class="p">];</span>
+  <span class="k">return</span> <span class="n">V</span> <span class="o">?</span> <span class="n">V</span> <span class="o">:</span> <span class="n">ErrorV</span><span class="p">(</span><span class="s">"Unknown variable name"</span><span class="p">);</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>References to variables are also quite simple using LLVM. In the simple
+version of Kaleidoscope, we assume that the variable has already been
+emitted somewhere and its value is available. In practice, the only
+values that can be in the <tt class="docutils literal"><span class="pre">NamedValues</span></tt> map are function arguments.
+This code simply checks to see that the specified name is in the map (if
+not, an unknown variable is being referenced) and returns the value for
+it. In future chapters, we’ll add support for <a class="reference external" href="LangImpl5.html#for">loop induction
+variables</a> in the symbol table, and for <a class="reference external" href="LangImpl7.html#localvars">local
+variables</a>.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">Value</span> <span class="o">*</span><span class="n">BinaryExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">L</span> <span class="o">=</span> <span class="n">LHS</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">R</span> <span class="o">=</span> <span class="n">RHS</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">L</span> <span class="o">==</span> <span class="mi">0</span> <span class="o">||</span> <span class="n">R</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="k">switch</span> <span class="p">(</span><span class="n">Op</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">case</span> <span class="sc">'+'</span>: <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFAdd</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"addtmp"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="sc">'-'</span>: <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFSub</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"subtmp"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="sc">'*'</span>: <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFMul</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"multmp"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="sc">'<'</span>:
+    <span class="n">L</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFCmpULT</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"cmptmp"</span><span class="p">);</span>
+    <span class="c1">// Convert bool 0/1 to double 0.0 or 1.0</span>
+    <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateUIToFP</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()),</span>
+                                <span class="s">"booltmp"</span><span class="p">);</span>
+  <span class="nl">default:</span> <span class="k">return</span> <span class="nf">ErrorV</span><span class="p">(</span><span class="s">"invalid binary operator"</span><span class="p">);</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Binary operators start to get more interesting. The basic idea here is
+that we recursively emit code for the left-hand side of the expression,
+then the right-hand side, then we compute the result of the binary
+expression. In this code, we do a simple switch on the opcode to create
+the right LLVM instruction.</p>
+<p>In the example above, the LLVM builder class is starting to show its
+value. IRBuilder knows where to insert the newly created instruction,
+all you have to do is specify what instruction to create (e.g. with
+<tt class="docutils literal"><span class="pre">CreateFAdd</span></tt>), which operands to use (<tt class="docutils literal"><span class="pre">L</span></tt> and <tt class="docutils literal"><span class="pre">R</span></tt> here) and
+optionally provide a name for the generated instruction.</p>
+<p>One nice thing about LLVM is that the name is just a hint. For instance,
+if the code above emits multiple “addtmp” variables, LLVM will
+automatically provide each one with an increasing, unique numeric
+suffix. Local value names for instructions are purely optional, but it
+makes it much easier to read the IR dumps.</p>
+<p><a class="reference external" href="../LangRef.html#instref">LLVM instructions</a> are constrained by strict
+rules: for example, the Left and Right operators of an <a class="reference external" href="../LangRef.html#i_add">add
+instruction</a> must have the same type, and the
+result type of the add must match the operand types. Because all values
+in Kaleidoscope are doubles, this makes for very simple code for add,
+sub and mul.</p>
+<p>On the other hand, LLVM specifies that the <a class="reference external" href="../LangRef.html#i_fcmp">fcmp
+instruction</a> always returns an ‘i1’ value (a
+one bit integer). The problem with this is that Kaleidoscope wants the
+value to be a 0.0 or 1.0 value. In order to get these semantics, we
+combine the fcmp instruction with a <a class="reference external" href="../LangRef.html#i_uitofp">uitofp
+instruction</a>. This instruction converts its
+input integer into a floating point value by treating the input as an
+unsigned value. In contrast, if we used the <a class="reference external" href="../LangRef.html#i_sitofp">sitofp
+instruction</a>, the Kaleidoscope ‘<’ operator
+would return 0.0 and -1.0, depending on the input value.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">Value</span> <span class="o">*</span><span class="n">CallExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Look up the name in the global module table.</span>
+  <span class="n">Function</span> <span class="o">*</span><span class="n">CalleeF</span> <span class="o">=</span> <span class="n">TheModule</span><span class="o">-></span><span class="n">getFunction</span><span class="p">(</span><span class="n">Callee</span><span class="p">);</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CalleeF</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorV</span><span class="p">(</span><span class="s">"Unknown function referenced"</span><span class="p">);</span>
+
+  <span class="c1">// If argument mismatch error.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CalleeF</span><span class="o">-></span><span class="n">arg_size</span><span class="p">()</span> <span class="o">!=</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">())</span>
+    <span class="k">return</span> <span class="n">ErrorV</span><span class="p">(</span><span class="s">"Incorrect # arguments passed"</span><span class="p">);</span>
+
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">Value</span><span class="o">*></span> <span class="n">ArgsV</span><span class="p">;</span>
+  <span class="k">for</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">e</span> <span class="o">=</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">();</span> <span class="n">i</span> <span class="o">!=</span> <span class="n">e</span><span class="p">;</span> <span class="o">++</span><span class="n">i</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">ArgsV</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="n">Args</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">-></span><span class="n">Codegen</span><span class="p">());</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">ArgsV</span><span class="p">.</span><span class="n">back</span><span class="p">()</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="p">}</span>
+
+  <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateCall</span><span class="p">(</span><span class="n">CalleeF</span><span class="p">,</span> <span class="n">ArgsV</span><span class="p">,</span> <span class="s">"calltmp"</span><span class="p">);</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Code generation for function calls is quite straightforward with LLVM.
+The code above initially does a function name lookup in the LLVM
+Module’s symbol table. Recall that the LLVM Module is the container that
+holds all of the functions we are JIT’ing. By giving each function the
+same name as what the user specifies, we can use the LLVM symbol table
+to resolve function names for us.</p>
+<p>Once we have the function to call, we recursively codegen each argument
+that is to be passed in, and create an LLVM <a class="reference external" href="../LangRef.html#i_call">call
+instruction</a>. Note that LLVM uses the native C
+calling conventions by default, allowing these calls to also call into
+standard library functions like “sin” and “cos”, with no additional
+effort.</p>
+<p>This wraps up our handling of the four basic expressions that we have so
+far in Kaleidoscope. Feel free to go in and add some more. For example,
+by browsing the <a class="reference external" href="../LangRef.html">LLVM language reference</a> you’ll find
+several other interesting instructions that are really easy to plug into
+our basic framework.</p>
+</div>
+<div class="section" id="function-code-generation">
+<h2><a class="toc-backref" href="#id4">3.4. Function Code Generation</a><a class="headerlink" href="#function-code-generation" title="Permalink to this headline">¶</a></h2>
+<p>Code generation for prototypes and functions must handle a number of
+details, which make their code less beautiful than expression code
+generation, but allows us to illustrate some important points. First,
+lets talk about code generation for prototypes: they are used both for
+function bodies and external function declarations. The code starts
+with:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">Function</span> <span class="o">*</span><span class="n">PrototypeAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Make the function type:  double(double,double) etc.</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">Type</span><span class="o">*></span> <span class="n">Doubles</span><span class="p">(</span><span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">(),</span>
+                             <span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()));</span>
+  <span class="n">FunctionType</span> <span class="o">*</span><span class="n">FT</span> <span class="o">=</span> <span class="n">FunctionType</span><span class="o">::</span><span class="n">get</span><span class="p">(</span><span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()),</span>
+                                       <span class="n">Doubles</span><span class="p">,</span> <span class="nb">false</span><span class="p">);</span>
+
+  <span class="n">Function</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">Function</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">FT</span><span class="p">,</span> <span class="n">Function</span><span class="o">::</span><span class="n">ExternalLinkage</span><span class="p">,</span> <span class="n">Name</span><span class="p">,</span> <span class="n">TheModule</span><span class="p">);</span>
+</pre></div>
+</div>
+<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 call to <tt class="docutils literal"><span class="pre">FunctionType::get</span></tt> creates the <tt class="docutils literal"><span class="pre">FunctionType</span></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 class="docutils literal"><span class="pre">Functiontype::get</span></tt> method to
+create a function type that takes “N” doubles as arguments, returns one
+double as a result, and that is not vararg (the false parameter
+indicates this). Note that Types in LLVM are uniqued just like Constants
+are, so you don’t “new” a type, you “get” it.</p>
+<p>The final line above actually creates the function that the prototype
+will correspond to. This indicates the type, linkage and name to use, as
+well as which module to insert into. “<a class="reference external" href="../LangRef.html#linkage">external
+linkage</a>” means that the function may be
+defined outside the current module and/or that it is callable by
+functions outside the module. The Name passed in is the name the user
+specified: since “<tt class="docutils literal"><span class="pre">TheModule</span></tt>” is specified, this name is registered
+in “<tt class="docutils literal"><span class="pre">TheModule</span></tt>“s symbol table, which is used by the function call
+code above.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// If F conflicted, there was already something named 'Name'.  If it has a</span>
+<span class="c1">// body, don't allow redefinition or reextern.</span>
+<span class="k">if</span> <span class="p">(</span><span class="n">F</span><span class="o">-></span><span class="n">getName</span><span class="p">()</span> <span class="o">!=</span> <span class="n">Name</span><span class="p">)</span> <span class="p">{</span>
+  <span class="c1">// Delete the one we just made and get the existing one.</span>
+  <span class="n">F</span><span class="o">-></span><span class="n">eraseFromParent</span><span class="p">();</span>
+  <span class="n">F</span> <span class="o">=</span> <span class="n">TheModule</span><span class="o">-></span><span class="n">getFunction</span><span class="p">(</span><span class="n">Name</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>The Module symbol table works just like the Function symbol table when
+it comes to name conflicts: if a new function is created with a name
+that was previously added to the symbol table, the new function will get
+implicitly renamed when added to the Module. The code above exploits
+this fact to determine if there was a previous definition of this
+function.</p>
+<p>In Kaleidoscope, I choose to allow redefinitions of functions in two
+cases: first, we want to allow ‘extern’ing a function more than once, as
+long as the prototypes for the externs match (since all arguments have
+the same type, we just have to check that the number of arguments
+match). Second, we want to allow ‘extern’ing a function and then
+defining a body for it. This is useful when defining mutually recursive
+functions.</p>
+<p>In order to implement this, the code above first checks to see if there
+is a collision on the name of the function. If so, it deletes the
+function we just created (by calling <tt class="docutils literal"><span class="pre">eraseFromParent</span></tt>) and then
+calling <tt class="docutils literal"><span class="pre">getFunction</span></tt> to get the existing function with the specified
+name. Note that many APIs in LLVM have “erase” forms and “remove” forms.
+The “remove” form unlinks the object from its parent (e.g. a Function
+from a Module) and returns it. The “erase” form unlinks the object and
+then deletes it.</p>
+<div class="highlight-c++"><div class="highlight"><pre>  <span class="c1">// If F already has a body, reject this.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">F</span><span class="o">-></span><span class="n">empty</span><span class="p">())</span> <span class="p">{</span>
+    <span class="n">ErrorF</span><span class="p">(</span><span class="s">"redefinition of function"</span><span class="p">);</span>
+    <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="p">}</span>
+
+  <span class="c1">// If F took a different number of args, reject.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">F</span><span class="o">-></span><span class="n">arg_size</span><span class="p">()</span> <span class="o">!=</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">())</span> <span class="p">{</span>
+    <span class="n">ErrorF</span><span class="p">(</span><span class="s">"redefinition of function with different # args"</span><span class="p">);</span>
+    <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>In order to verify the logic above, we first check to see if the
+pre-existing function is “empty”. In this case, empty means that it has
+no basic blocks in it, which means it has no body. If it has no body, it
+is a forward declaration. Since we don’t allow anything after a full
+definition of the function, the code rejects this case. If the previous
+reference to a function was an ‘extern’, we simply verify that the
+number of arguments for that definition and this one match up. If not,
+we emit an error.</p>
+<div class="highlight-c++"><div class="highlight"><pre>  <span class="c1">// Set names for all arguments.</span>
+  <span class="kt">unsigned</span> <span class="n">Idx</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="k">for</span> <span class="p">(</span><span class="n">Function</span><span class="o">::</span><span class="n">arg_iterator</span> <span class="n">AI</span> <span class="o">=</span> <span class="n">F</span><span class="o">-></span><span class="n">arg_begin</span><span class="p">();</span> <span class="n">Idx</span> <span class="o">!=</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">();</span>
+       <span class="o">++</span><span class="n">AI</span><span class="p">,</span> <span class="o">++</span><span class="n">Idx</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">AI</span><span class="o">-></span><span class="n">setName</span><span class="p">(</span><span class="n">Args</span><span class="p">[</span><span class="n">Idx</span><span class="p">]);</span>
+
+    <span class="c1">// Add arguments to variable symbol table.</span>
+    <span class="n">NamedValues</span><span class="p">[</span><span class="n">Args</span><span class="p">[</span><span class="n">Idx</span><span class="p">]]</span> <span class="o">=</span> <span class="n">AI</span><span class="p">;</span>
+  <span class="p">}</span>
+  <span class="k">return</span> <span class="n">F</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>The last bit of code for prototypes loops over all of the arguments in
+the function, setting the name of the LLVM Argument objects to match,
+and registering the arguments in the <tt class="docutils literal"><span class="pre">NamedValues</span></tt> map for future use
+by the <tt class="docutils literal"><span class="pre">VariableExprAST</span></tt> AST node. Once this is set up, it returns the
+Function object to the caller. Note that we don’t check for conflicting
+argument names here (e.g. “extern foo(a b a)”). Doing so would be very
+straight-forward with the mechanics we have already used above.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">Function</span> <span class="o">*</span><span class="n">FunctionAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">NamedValues</span><span class="p">.</span><span class="n">clear</span><span class="p">();</span>
+
+  <span class="n">Function</span> <span class="o">*</span><span class="n">TheFunction</span> <span class="o">=</span> <span class="n">Proto</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">TheFunction</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
+    <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+</pre></div>
+</div>
+<p>Code generation for function definitions starts out simply enough: we
+just codegen the prototype (Proto) and verify that it is ok. We then
+clear out the <tt class="docutils literal"><span class="pre">NamedValues</span></tt> map to make sure that there isn’t anything
+in it from the last function we compiled. Code generation of the
+prototype ensures that there is an LLVM Function object that is ready to
+go for us.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// Create a new basic block to start insertion into.</span>
+<span class="n">BasicBlock</span> <span class="o">*</span><span class="n">BB</span> <span class="o">=</span> <span class="n">BasicBlock</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="s">"entry"</span><span class="p">,</span> <span class="n">TheFunction</span><span class="p">);</span>
+<span class="n">Builder</span><span class="p">.</span><span class="n">SetInsertPoint</span><span class="p">(</span><span class="n">BB</span><span class="p">);</span>
+
+<span class="k">if</span> <span class="p">(</span><span class="n">Value</span> <span class="o">*</span><span class="n">RetVal</span> <span class="o">=</span> <span class="n">Body</span><span class="o">-></span><span class="n">Codegen</span><span class="p">())</span> <span class="p">{</span>
+</pre></div>
+</div>
+<p>Now we get to the point where the <tt class="docutils literal"><span class="pre">Builder</span></tt> is set up. The first line
+creates a new <a class="reference external" href="http://en.wikipedia.org/wiki/Basic_block">basic block</a>
+(named “entry”), which is inserted into <tt class="docutils literal"><span class="pre">TheFunction</span></tt>. The second line
+then tells the builder that new instructions should be inserted into the
+end of the new basic block. Basic blocks in LLVM are an important part
+of functions that define the <a class="reference external" href="http://en.wikipedia.org/wiki/Control_flow_graph">Control Flow
+Graph</a>. Since we
+don’t have any control flow, our functions will only contain one block
+at this point. We’ll fix this in <a class="reference external" href="LangImpl5.html">Chapter 5</a> :).</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">if</span> <span class="p">(</span><span class="n">Value</span> <span class="o">*</span><span class="n">RetVal</span> <span class="o">=</span> <span class="n">Body</span><span class="o">-></span><span class="n">Codegen</span><span class="p">())</span> <span class="p">{</span>
+  <span class="c1">// Finish off the function.</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">CreateRet</span><span class="p">(</span><span class="n">RetVal</span><span class="p">);</span>
+
+  <span class="c1">// Validate the generated code, checking for consistency.</span>
+  <span class="n">verifyFunction</span><span class="p">(</span><span class="o">*</span><span class="n">TheFunction</span><span class="p">);</span>
+
+  <span class="k">return</span> <span class="n">TheFunction</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Once the insertion point is set up, we call the <tt class="docutils literal"><span class="pre">CodeGen()</span></tt> method for
+the root expression of the function. If no error happens, this emits
+code to compute the expression into the entry block and returns the
+value that was computed. Assuming no error, we then create an LLVM <a class="reference external" href="../LangRef.html#i_ret">ret
+instruction</a>, which completes the function.
+Once the function is built, we call <tt class="docutils literal"><span class="pre">verifyFunction</span></tt>, which is
+provided by LLVM. This function does a variety of consistency checks on
+the generated code, to determine if our compiler is doing everything
+right. Using this is important: it can catch a lot of bugs. Once the
+function is finished and validated, we return it.</p>
+<div class="highlight-c++"><div class="highlight"><pre>  <span class="c1">// Error reading body, remove function.</span>
+  <span class="n">TheFunction</span><span class="o">-></span><span class="n">eraseFromParent</span><span class="p">();</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>The only piece left here is handling of the error case. For simplicity,
+we handle this by merely deleting the function we produced with the
+<tt class="docutils literal"><span class="pre">eraseFromParent</span></tt> method. This allows the user to redefine a function
+that they incorrectly typed in before: if we didn’t delete it, it would
+live in the symbol table, with a body, preventing future redefinition.</p>
+<p>This code does have a bug, though. Since the <tt class="docutils literal"><span class="pre">PrototypeAST::Codegen</span></tt>
+can return a previously defined forward declaration, our code can
+actually delete a forward declaration. There are a number of ways to fix
+this bug, see what you can come up with! Here is a testcase:</p>
+<div class="highlight-python"><pre>extern foo(a b);     # ok, defines foo.
+def foo(a b) c;      # error, 'c' is invalid.
+def bar() foo(1, 2); # error, unknown function "foo"</pre>
+</div>
+</div>
+<div class="section" id="driver-changes-and-closing-thoughts">
+<h2><a class="toc-backref" href="#id5">3.5. Driver Changes and Closing Thoughts</a><a class="headerlink" href="#driver-changes-and-closing-thoughts" title="Permalink to this headline">¶</a></h2>
+<p>For now, code generation to LLVM doesn’t really get us much, except that
+we can look at the pretty IR calls. The sample code inserts calls to
+Codegen into the “<tt class="docutils literal"><span class="pre">HandleDefinition</span></tt>”, “<tt class="docutils literal"><span class="pre">HandleExtern</span></tt>” etc
+functions, and then dumps out the LLVM IR. This gives a nice way to look
+at the LLVM IR for simple functions. For example:</p>
+<div class="highlight-python"><pre>ready> 4+5;
+Read top-level expression:
+define double @0() {
+entry:
+  ret double 9.000000e+00
+}</pre>
+</div>
+<p>Note how the parser turns the top-level expression into anonymous
+functions for us. This will be handy when we add <a class="reference external" href="LangImpl4.html#jit">JIT
+support</a> in the next chapter. Also note that the
+code is very literally transcribed, no optimizations are being performed
+except simple constant folding done by IRBuilder. We will <a class="reference external" href="LangImpl4.html#trivialconstfold">add
+optimizations</a> explicitly in the next
+chapter.</p>
+<div class="highlight-python"><pre>ready> def foo(a b) a*a + 2*a*b + b*b;
+Read function definition:
+define double @foo(double %a, double %b) {
+entry:
+  %multmp = fmul double %a, %a
+  %multmp1 = fmul double 2.000000e+00, %a
+  %multmp2 = fmul double %multmp1, %b
+  %addtmp = fadd double %multmp, %multmp2
+  %multmp3 = fmul double %b, %b
+  %addtmp4 = fadd double %addtmp, %multmp3
+  ret double %addtmp4
+}</pre>
+</div>
+<p>This shows some simple arithmetic. Notice the striking similarity to the
+LLVM builder calls that we use to create the instructions.</p>
+<div class="highlight-python"><pre>ready> def bar(a) foo(a, 4.0) + bar(31337);
+Read function definition:
+define double @bar(double %a) {
+entry:
+  %calltmp = call double @foo(double %a, double 4.000000e+00)
+  %calltmp1 = call double @bar(double 3.133700e+04)
+  %addtmp = fadd double %calltmp, %calltmp1
+  ret double %addtmp
+}</pre>
+</div>
+<p>This shows some function calls. Note that this function will take a long
+time to execute if you call it. In the future we’ll add conditional
+control flow to actually make recursion useful :).</p>
+<div class="highlight-python"><pre>ready> extern cos(x);
+Read extern:
+declare double @cos(double)
+
+ready> cos(1.234);
+Read top-level expression:
+define double @1() {
+entry:
+  %calltmp = call double @cos(double 1.234000e+00)
+  ret double %calltmp
+}</pre>
+</div>
+<p>This shows an extern for the libm “cos” function, and a call to it.</p>
+<div class="highlight-python"><pre>ready> ^D
+; ModuleID = 'my cool jit'
+
+define double @0() {
+entry:
+  %addtmp = fadd double 4.000000e+00, 5.000000e+00
+  ret double %addtmp
+}
+
+define double @foo(double %a, double %b) {
+entry:
+  %multmp = fmul double %a, %a
+  %multmp1 = fmul double 2.000000e+00, %a
+  %multmp2 = fmul double %multmp1, %b
+  %addtmp = fadd double %multmp, %multmp2
+  %multmp3 = fmul double %b, %b
+  %addtmp4 = fadd double %addtmp, %multmp3
+  ret double %addtmp4
+}
+
+define double @bar(double %a) {
+entry:
+  %calltmp = call double @foo(double %a, double 4.000000e+00)
+  %calltmp1 = call double @bar(double 3.133700e+04)
+  %addtmp = fadd double %calltmp, %calltmp1
+  ret double %addtmp
+}
+
+declare double @cos(double)
+
+define double @1() {
+entry:
+  %calltmp = call double @cos(double 1.234000e+00)
+  ret double %calltmp
+}</pre>
+</div>
+<p>When you quit the current demo, it dumps out the IR for the entire
+module generated. Here you can see the big picture with all the
+functions referencing each other.</p>
+<p>This wraps up the third chapter of the Kaleidoscope tutorial. Up next,
+we’ll describe how to <a class="reference external" href="LangImpl4.html">add JIT codegen and optimizer
+support</a> to this so we can actually start running
+code!</p>
+</div>
+<div class="section" id="full-code-listing">
+<h2><a class="toc-backref" href="#id6">3.6. Full Code Listing</a><a class="headerlink" href="#full-code-listing" title="Permalink to this headline">¶</a></h2>
+<p>Here is the complete code listing for our running example, enhanced with
+the LLVM code generator. Because this uses the LLVM libraries, we need
+to link them in. To do this, we use the
+<a class="reference external" href="http://llvm.org/cmds/llvm-config.html">llvm-config</a> tool to inform
+our makefile/command line about which options to use:</p>
+<div class="highlight-bash"><div class="highlight"><pre><span class="c"># Compile</span>
+clang++ -g -O3 toy.cpp <span class="sb">`</span>llvm-config --cppflags --ldflags --libs core<span class="sb">`</span> -o toy
+<span class="c"># Run</span>
+./toy
+</pre></div>
+</div>
+<p>Here is the code:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include "llvm/Analysis/Verifier.h"</span>
+<span class="cp">#include "llvm/IR/DerivedTypes.h"</span>
+<span class="cp">#include "llvm/IR/IRBuilder.h"</span>
+<span class="cp">#include "llvm/IR/LLVMContext.h"</span>
+<span class="cp">#include "llvm/IR/Module.h"</span>
+<span class="cp">#include <cctype></span>
+<span class="cp">#include <cstdio></span>
+<span class="cp">#include <map></span>
+<span class="cp">#include <string></span>
+<span class="cp">#include <vector></span>
+<span class="k">using</span> <span class="k">namespace</span> <span class="n">llvm</span><span class="p">;</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Lexer</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="c1">// The lexer returns tokens [0-255] if it is an unknown character, otherwise one</span>
+<span class="c1">// of these for known things.</span>
+<span class="k">enum</span> <span class="n">Token</span> <span class="p">{</span>
+  <span class="n">tok_eof</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span>
+
+  <span class="c1">// commands</span>
+  <span class="n">tok_def</span> <span class="o">=</span> <span class="o">-</span><span class="mi">2</span><span class="p">,</span> <span class="n">tok_extern</span> <span class="o">=</span> <span class="o">-</span><span class="mi">3</span><span class="p">,</span>
+
+  <span class="c1">// primary</span>
+  <span class="n">tok_identifier</span> <span class="o">=</span> <span class="o">-</span><span class="mi">4</span><span class="p">,</span> <span class="n">tok_number</span> <span class="o">=</span> <span class="o">-</span><span class="mi">5</span>
+<span class="p">};</span>
+
+<span class="k">static</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">IdentifierStr</span><span class="p">;</span>  <span class="c1">// Filled in if tok_identifier</span>
+<span class="k">static</span> <span class="kt">double</span> <span class="n">NumVal</span><span class="p">;</span>              <span class="c1">// Filled in if tok_number</span>
+
+<span class="c1">/// gettok - Return the next token from standard input.</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">gettok</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">static</span> <span class="kt">int</span> <span class="n">LastChar</span> <span class="o">=</span> <span class="sc">' '</span><span class="p">;</span>
+
+  <span class="c1">// Skip any whitespace.</span>
+  <span class="k">while</span> <span class="p">(</span><span class="n">isspace</span><span class="p">(</span><span class="n">LastChar</span><span class="p">))</span>
+    <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">isalpha</span><span class="p">(</span><span class="n">LastChar</span><span class="p">))</span> <span class="p">{</span> <span class="c1">// identifier: [a-zA-Z][a-zA-Z0-9]*</span>
+    <span class="n">IdentifierStr</span> <span class="o">=</span> <span class="n">LastChar</span><span class="p">;</span>
+    <span class="k">while</span> <span class="p">(</span><span class="n">isalnum</span><span class="p">((</span><span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">())))</span>
+      <span class="n">IdentifierStr</span> <span class="o">+=</span> <span class="n">LastChar</span><span class="p">;</span>
+
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"def"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_def</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"extern"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_extern</span><span class="p">;</span>
+    <span class="k">return</span> <span class="n">tok_identifier</span><span class="p">;</span>
+  <span class="p">}</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">isdigit</span><span class="p">(</span><span class="n">LastChar</span><span class="p">)</span> <span class="o">||</span> <span class="n">LastChar</span> <span class="o">==</span> <span class="sc">'.'</span><span class="p">)</span> <span class="p">{</span>   <span class="c1">// Number: [0-9.]+</span>
+    <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">NumStr</span><span class="p">;</span>
+    <span class="k">do</span> <span class="p">{</span>
+      <span class="n">NumStr</span> <span class="o">+=</span> <span class="n">LastChar</span><span class="p">;</span>
+      <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+    <span class="p">}</span> <span class="k">while</span> <span class="p">(</span><span class="n">isdigit</span><span class="p">(</span><span class="n">LastChar</span><span class="p">)</span> <span class="o">||</span> <span class="n">LastChar</span> <span class="o">==</span> <span class="sc">'.'</span><span class="p">);</span>
+
+    <span class="n">NumVal</span> <span class="o">=</span> <span class="n">strtod</span><span class="p">(</span><span class="n">NumStr</span><span class="p">.</span><span class="n">c_str</span><span class="p">(),</span> <span class="mi">0</span><span class="p">);</span>
+    <span class="k">return</span> <span class="n">tok_number</span><span class="p">;</span>
+  <span class="p">}</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">==</span> <span class="sc">'#'</span><span class="p">)</span> <span class="p">{</span>
+    <span class="c1">// Comment until end of line.</span>
+    <span class="k">do</span> <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+    <span class="k">while</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">!=</span> <span class="n">EOF</span> <span class="o">&&</span> <span class="n">LastChar</span> <span class="o">!=</span> <span class="sc">'\n'</span> <span class="o">&&</span> <span class="n">LastChar</span> <span class="o">!=</span> <span class="sc">'\r'</span><span class="p">);</span>
+    
+    <span class="k">if</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">!=</span> <span class="n">EOF</span><span class="p">)</span>
+      <span class="k">return</span> <span class="n">gettok</span><span class="p">();</span>
+  <span class="p">}</span>
+  
+  <span class="c1">// Check for end of file.  Don't eat the EOF.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">==</span> <span class="n">EOF</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">tok_eof</span><span class="p">;</span>
+
+  <span class="c1">// Otherwise, just return the character as its ascii value.</span>
+  <span class="kt">int</span> <span class="n">ThisChar</span> <span class="o">=</span> <span class="n">LastChar</span><span class="p">;</span>
+  <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+  <span class="k">return</span> <span class="n">ThisChar</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Abstract Syntax Tree (aka Parse Tree)</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="k">namespace</span> <span class="p">{</span>
+<span class="c1">/// ExprAST - Base class for all expression nodes.</span>
+<span class="k">class</span> <span class="nc">ExprAST</span> <span class="p">{</span>
+<span class="nl">public:</span>
+  <span class="k">virtual</span> <span class="o">~</span><span class="n">ExprAST</span><span class="p">()</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">()</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">};</span>
+
+<span class="c1">/// NumberExprAST - Expression class for numeric literals like "1.0".</span>
+<span class="k">class</span> <span class="nc">NumberExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="kt">double</span> <span class="n">Val</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">NumberExprAST</span><span class="p">(</span><span class="kt">double</span> <span class="n">val</span><span class="p">)</span> <span class="o">:</span> <span class="n">Val</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// VariableExprAST - Expression class for referencing a variable, like "a".</span>
+<span class="k">class</span> <span class="nc">VariableExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">Name</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">VariableExprAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">name</span><span class="p">)</span> <span class="o">:</span> <span class="n">Name</span><span class="p">(</span><span class="n">name</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// BinaryExprAST - Expression class for a binary operator.</span>
+<span class="k">class</span> <span class="nc">BinaryExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="kt">char</span> <span class="n">Op</span><span class="p">;</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">LHS</span><span class="p">,</span> <span class="o">*</span><span class="n">RHS</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">BinaryExprAST</span><span class="p">(</span><span class="kt">char</span> <span class="n">op</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">lhs</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">rhs</span><span class="p">)</span> 
+    <span class="o">:</span> <span class="n">Op</span><span class="p">(</span><span class="n">op</span><span class="p">),</span> <span class="n">LHS</span><span class="p">(</span><span class="n">lhs</span><span class="p">),</span> <span class="n">RHS</span><span class="p">(</span><span class="n">rhs</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// CallExprAST - Expression class for function calls.</span>
+<span class="k">class</span> <span class="nc">CallExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">Callee</span><span class="p">;</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">ExprAST</span><span class="o">*></span> <span class="n">Args</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">CallExprAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">callee</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">ExprAST</span><span class="o">*></span> <span class="o">&</span><span class="n">args</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">Callee</span><span class="p">(</span><span class="n">callee</span><span class="p">),</span> <span class="n">Args</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// PrototypeAST - This class represents the "prototype" for a function,</span>
+<span class="c1">/// which captures its name, and its argument names (thus implicitly the number</span>
+<span class="c1">/// of arguments the function takes).</span>
+<span class="k">class</span> <span class="nc">PrototypeAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">Name</span><span class="p">;</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="n">Args</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">PrototypeAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">name</span><span class="p">,</span> <span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="o">&</span><span class="n">args</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">Name</span><span class="p">(</span><span class="n">name</span><span class="p">),</span> <span class="n">Args</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="p">{}</span>
+  
+  <span class="n">Function</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// FunctionAST - This class represents a function definition itself.</span>
+<span class="k">class</span> <span class="nc">FunctionAST</span> <span class="p">{</span>
+  <span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">Proto</span><span class="p">;</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Body</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">FunctionAST</span><span class="p">(</span><span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">proto</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">body</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">Proto</span><span class="p">(</span><span class="n">proto</span><span class="p">),</span> <span class="n">Body</span><span class="p">(</span><span class="n">body</span><span class="p">)</span> <span class="p">{}</span>
+  
+  <span class="n">Function</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+<span class="p">}</span> <span class="c1">// end anonymous namespace</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Parser</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="c1">/// CurTok/getNextToken - Provide a simple token buffer.  CurTok is the current</span>
+<span class="c1">/// token the parser is looking at.  getNextToken reads another token from the</span>
+<span class="c1">/// lexer and updates CurTok with its results.</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="n">CurTok</span><span class="p">;</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">getNextToken</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="n">CurTok</span> <span class="o">=</span> <span class="n">gettok</span><span class="p">();</span>
+<span class="p">}</span>
+
+<span class="c1">/// BinopPrecedence - This holds the precedence for each binary operator that is</span>
+<span class="c1">/// defined.</span>
+<span class="k">static</span> <span class="n">std</span><span class="o">::</span><span class="n">map</span><span class="o"><</span><span class="kt">char</span><span class="p">,</span> <span class="kt">int</span><span class="o">></span> <span class="n">BinopPrecedence</span><span class="p">;</span>
+
+<span class="c1">/// GetTokPrecedence - Get the precedence of the pending binary operator token.</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">GetTokPrecedence</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">isascii</span><span class="p">(</span><span class="n">CurTok</span><span class="p">))</span>
+    <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
+  
+  <span class="c1">// Make sure it's a declared binop.</span>
+  <span class="kt">int</span> <span class="n">TokPrec</span> <span class="o">=</span> <span class="n">BinopPrecedence</span><span class="p">[</span><span class="n">CurTok</span><span class="p">];</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">TokPrec</span> <span class="o"><=</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
+  <span class="k">return</span> <span class="n">TokPrec</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// Error* - These are little helper functions for error handling.</span>
+<span class="n">ExprAST</span> <span class="o">*</span><span class="nf">Error</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Error: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">Str</span><span class="p">);</span><span class="k">return</span> <span class="mi">0</span><span class="p">;}</span>
+<span class="n">PrototypeAST</span> <span class="o">*</span><span class="nf">ErrorP</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">Error</span><span class="p">(</span><span class="n">Str</span><span class="p">);</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span>
+<span class="n">FunctionAST</span> <span class="o">*</span><span class="nf">ErrorF</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">Error</span><span class="p">(</span><span class="n">Str</span><span class="p">);</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span>
+
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseExpression</span><span class="p">();</span>
+
+<span class="c1">/// identifierexpr</span>
+<span class="c1">///   ::= identifier</span>
+<span class="c1">///   ::= identifier '(' expression* ')'</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseIdentifierExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">IdName</span> <span class="o">=</span> <span class="n">IdentifierStr</span><span class="p">;</span>
+  
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat identifier.</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">'('</span><span class="p">)</span> <span class="c1">// Simple variable ref.</span>
+    <span class="k">return</span> <span class="k">new</span> <span class="n">VariableExprAST</span><span class="p">(</span><span class="n">IdName</span><span class="p">);</span>
+  
+  <span class="c1">// Call.</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat (</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">ExprAST</span><span class="o">*></span> <span class="n">Args</span><span class="p">;</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">')'</span><span class="p">)</span> <span class="p">{</span>
+    <span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+      <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Arg</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+      <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">Arg</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+      <span class="n">Args</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="n">Arg</span><span class="p">);</span>
+
+      <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">==</span> <span class="sc">')'</span><span class="p">)</span> <span class="k">break</span><span class="p">;</span>
+
+      <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">','</span><span class="p">)</span>
+        <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"Expected ')' or ',' in argument list"</span><span class="p">);</span>
+      <span class="n">getNextToken</span><span class="p">();</span>
+    <span class="p">}</span>
+  <span class="p">}</span>
+
+  <span class="c1">// Eat the ')'.</span>
+  <span class="n">getNextToken</span><span class="p">();</span>
+  
+  <span class="k">return</span> <span class="k">new</span> <span class="n">CallExprAST</span><span class="p">(</span><span class="n">IdName</span><span class="p">,</span> <span class="n">Args</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="c1">/// numberexpr ::= number</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseNumberExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Result</span> <span class="o">=</span> <span class="k">new</span> <span class="n">NumberExprAST</span><span class="p">(</span><span class="n">NumVal</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span> <span class="c1">// consume the number</span>
+  <span class="k">return</span> <span class="n">Result</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// parenexpr ::= '(' expression ')'</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseParenExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat (.</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">V</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">V</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">')'</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected ')'"</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat ).</span>
+  <span class="k">return</span> <span class="n">V</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// primary</span>
+<span class="c1">///   ::= identifierexpr</span>
+<span class="c1">///   ::= numberexpr</span>
+<span class="c1">///   ::= parenexpr</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParsePrimary</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">switch</span> <span class="p">(</span><span class="n">CurTok</span><span class="p">)</span> <span class="p">{</span>
+  <span class="nl">default:</span> <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"unknown token when expecting an expression"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="n">tok_identifier</span>: <span class="k">return</span> <span class="n">ParseIdentifierExpr</span><span class="p">();</span>
+  <span class="k">case</span> <span class="n">tok_number</span>:     <span class="k">return</span> <span class="n">ParseNumberExpr</span><span class="p">();</span>
+  <span class="k">case</span> <span class="sc">'('</span>:            <span class="k">return</span> <span class="n">ParseParenExpr</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="c1">/// binoprhs</span>
+<span class="c1">///   ::= ('+' primary)*</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseBinOpRHS</span><span class="p">(</span><span class="kt">int</span> <span class="n">ExprPrec</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">LHS</span><span class="p">)</span> <span class="p">{</span>
+  <span class="c1">// If this is a binop, find its precedence.</span>
+  <span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+    <span class="kt">int</span> <span class="n">TokPrec</span> <span class="o">=</span> <span class="n">GetTokPrecedence</span><span class="p">();</span>
+    
+    <span class="c1">// If this is a binop that binds at least as tightly as the current binop,</span>
+    <span class="c1">// consume it, otherwise we are done.</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">TokPrec</span> <span class="o"><</span> <span class="n">ExprPrec</span><span class="p">)</span>
+      <span class="k">return</span> <span class="n">LHS</span><span class="p">;</span>
+    
+    <span class="c1">// Okay, we know this is a binop.</span>
+    <span class="kt">int</span> <span class="n">BinOp</span> <span class="o">=</span> <span class="n">CurTok</span><span class="p">;</span>
+    <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat binop</span>
+    
+    <span class="c1">// Parse the primary expression after the binary operator.</span>
+    <span class="n">ExprAST</span> <span class="o">*</span><span class="n">RHS</span> <span class="o">=</span> <span class="n">ParsePrimary</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">RHS</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+    
+    <span class="c1">// If BinOp binds less tightly with RHS than the operator after RHS, let</span>
+    <span class="c1">// the pending operator take RHS as its LHS.</span>
+    <span class="kt">int</span> <span class="n">NextPrec</span> <span class="o">=</span> <span class="n">GetTokPrecedence</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">TokPrec</span> <span class="o"><</span> <span class="n">NextPrec</span><span class="p">)</span> <span class="p">{</span>
+      <span class="n">RHS</span> <span class="o">=</span> <span class="n">ParseBinOpRHS</span><span class="p">(</span><span class="n">TokPrec</span><span class="o">+</span><span class="mi">1</span><span class="p">,</span> <span class="n">RHS</span><span class="p">);</span>
+      <span class="k">if</span> <span class="p">(</span><span class="n">RHS</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="p">}</span>
+    
+    <span class="c1">// Merge LHS/RHS.</span>
+    <span class="n">LHS</span> <span class="o">=</span> <span class="k">new</span> <span class="n">BinaryExprAST</span><span class="p">(</span><span class="n">BinOp</span><span class="p">,</span> <span class="n">LHS</span><span class="p">,</span> <span class="n">RHS</span><span class="p">);</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="c1">/// expression</span>
+<span class="c1">///   ::= primary binoprhs</span>
+<span class="c1">///</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseExpression</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">LHS</span> <span class="o">=</span> <span class="n">ParsePrimary</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">LHS</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="k">return</span> <span class="n">ParseBinOpRHS</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">LHS</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="c1">/// prototype</span>
+<span class="c1">///   ::= id '(' id* ')'</span>
+<span class="k">static</span> <span class="n">PrototypeAST</span> <span class="o">*</span><span class="nf">ParsePrototype</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="n">tok_identifier</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected function name in prototype"</span><span class="p">);</span>
+
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">FnName</span> <span class="o">=</span> <span class="n">IdentifierStr</span><span class="p">;</span>
+  <span class="n">getNextToken</span><span class="p">();</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">'('</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected '(' in prototype"</span><span class="p">);</span>
+  
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="n">ArgNames</span><span class="p">;</span>
+  <span class="k">while</span> <span class="p">(</span><span class="n">getNextToken</span><span class="p">()</span> <span class="o">==</span> <span class="n">tok_identifier</span><span class="p">)</span>
+    <span class="n">ArgNames</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="n">IdentifierStr</span><span class="p">);</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">')'</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected ')' in prototype"</span><span class="p">);</span>
+  
+  <span class="c1">// success.</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat ')'.</span>
+  
+  <span class="k">return</span> <span class="k">new</span> <span class="n">PrototypeAST</span><span class="p">(</span><span class="n">FnName</span><span class="p">,</span> <span class="n">ArgNames</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="c1">/// definition ::= 'def' prototype expression</span>
+<span class="k">static</span> <span class="n">FunctionAST</span> <span class="o">*</span><span class="nf">ParseDefinition</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat def.</span>
+  <span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">Proto</span> <span class="o">=</span> <span class="n">ParsePrototype</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Proto</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">ExprAST</span> <span class="o">*</span><span class="n">E</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">())</span>
+    <span class="k">return</span> <span class="k">new</span> <span class="n">FunctionAST</span><span class="p">(</span><span class="n">Proto</span><span class="p">,</span> <span class="n">E</span><span class="p">);</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// toplevelexpr ::= expression</span>
+<span class="k">static</span> <span class="n">FunctionAST</span> <span class="o">*</span><span class="nf">ParseTopLevelExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">ExprAST</span> <span class="o">*</span><span class="n">E</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">())</span> <span class="p">{</span>
+    <span class="c1">// Make an anonymous proto.</span>
+    <span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">Proto</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PrototypeAST</span><span class="p">(</span><span class="s">""</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span><span class="p">());</span>
+    <span class="k">return</span> <span class="k">new</span> <span class="n">FunctionAST</span><span class="p">(</span><span class="n">Proto</span><span class="p">,</span> <span class="n">E</span><span class="p">);</span>
+  <span class="p">}</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// external ::= 'extern' prototype</span>
+<span class="k">static</span> <span class="n">PrototypeAST</span> <span class="o">*</span><span class="nf">ParseExtern</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat extern.</span>
+  <span class="k">return</span> <span class="n">ParsePrototype</span><span class="p">();</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Code Generation</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="k">static</span> <span class="n">Module</span> <span class="o">*</span><span class="n">TheModule</span><span class="p">;</span>
+<span class="k">static</span> <span class="n">IRBuilder</span><span class="o"><></span> <span class="n">Builder</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">());</span>
+<span class="k">static</span> <span class="n">std</span><span class="o">::</span><span class="n">map</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="p">,</span> <span class="n">Value</span><span class="o">*></span> <span class="n">NamedValues</span><span class="p">;</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="nf">ErrorV</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">Error</span><span class="p">(</span><span class="n">Str</span><span class="p">);</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">NumberExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="n">ConstantFP</span><span class="o">::</span><span class="n">get</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="n">APFloat</span><span class="p">(</span><span class="n">Val</span><span class="p">));</span>
+<span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">VariableExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Look this variable up in the function.</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">V</span> <span class="o">=</span> <span class="n">NamedValues</span><span class="p">[</span><span class="n">Name</span><span class="p">];</span>
+  <span class="k">return</span> <span class="n">V</span> <span class="o">?</span> <span class="n">V</span> <span class="o">:</span> <span class="n">ErrorV</span><span class="p">(</span><span class="s">"Unknown variable name"</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">BinaryExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">L</span> <span class="o">=</span> <span class="n">LHS</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">R</span> <span class="o">=</span> <span class="n">RHS</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">L</span> <span class="o">==</span> <span class="mi">0</span> <span class="o">||</span> <span class="n">R</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="k">switch</span> <span class="p">(</span><span class="n">Op</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">case</span> <span class="sc">'+'</span>: <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFAdd</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"addtmp"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="sc">'-'</span>: <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFSub</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"subtmp"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="sc">'*'</span>: <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFMul</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"multmp"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="sc">'<'</span>:
+    <span class="n">L</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFCmpULT</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"cmptmp"</span><span class="p">);</span>
+    <span class="c1">// Convert bool 0/1 to double 0.0 or 1.0</span>
+    <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateUIToFP</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()),</span>
+                                <span class="s">"booltmp"</span><span class="p">);</span>
+  <span class="nl">default:</span> <span class="k">return</span> <span class="nf">ErrorV</span><span class="p">(</span><span class="s">"invalid binary operator"</span><span class="p">);</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">CallExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Look up the name in the global module table.</span>
+  <span class="n">Function</span> <span class="o">*</span><span class="n">CalleeF</span> <span class="o">=</span> <span class="n">TheModule</span><span class="o">-></span><span class="n">getFunction</span><span class="p">(</span><span class="n">Callee</span><span class="p">);</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CalleeF</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorV</span><span class="p">(</span><span class="s">"Unknown function referenced"</span><span class="p">);</span>
+  
+  <span class="c1">// If argument mismatch error.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CalleeF</span><span class="o">-></span><span class="n">arg_size</span><span class="p">()</span> <span class="o">!=</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">())</span>
+    <span class="k">return</span> <span class="n">ErrorV</span><span class="p">(</span><span class="s">"Incorrect # arguments passed"</span><span class="p">);</span>
+
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">Value</span><span class="o">*></span> <span class="n">ArgsV</span><span class="p">;</span>
+  <span class="k">for</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">e</span> <span class="o">=</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">();</span> <span class="n">i</span> <span class="o">!=</span> <span class="n">e</span><span class="p">;</span> <span class="o">++</span><span class="n">i</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">ArgsV</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="n">Args</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">-></span><span class="n">Codegen</span><span class="p">());</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">ArgsV</span><span class="p">.</span><span class="n">back</span><span class="p">()</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="p">}</span>
+  
+  <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateCall</span><span class="p">(</span><span class="n">CalleeF</span><span class="p">,</span> <span class="n">ArgsV</span><span class="p">,</span> <span class="s">"calltmp"</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="n">Function</span> <span class="o">*</span><span class="n">PrototypeAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Make the function type:  double(double,double) etc.</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">Type</span><span class="o">*></span> <span class="n">Doubles</span><span class="p">(</span><span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">(),</span>
+                             <span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()));</span>
+  <span class="n">FunctionType</span> <span class="o">*</span><span class="n">FT</span> <span class="o">=</span> <span class="n">FunctionType</span><span class="o">::</span><span class="n">get</span><span class="p">(</span><span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()),</span>
+                                       <span class="n">Doubles</span><span class="p">,</span> <span class="nb">false</span><span class="p">);</span>
+  
+  <span class="n">Function</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">Function</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">FT</span><span class="p">,</span> <span class="n">Function</span><span class="o">::</span><span class="n">ExternalLinkage</span><span class="p">,</span> <span class="n">Name</span><span class="p">,</span> <span class="n">TheModule</span><span class="p">);</span>
+  
+  <span class="c1">// If F conflicted, there was already something named 'Name'.  If it has a</span>
+  <span class="c1">// body, don't allow redefinition or reextern.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">F</span><span class="o">-></span><span class="n">getName</span><span class="p">()</span> <span class="o">!=</span> <span class="n">Name</span><span class="p">)</span> <span class="p">{</span>
+    <span class="c1">// Delete the one we just made and get the existing one.</span>
+    <span class="n">F</span><span class="o">-></span><span class="n">eraseFromParent</span><span class="p">();</span>
+    <span class="n">F</span> <span class="o">=</span> <span class="n">TheModule</span><span class="o">-></span><span class="n">getFunction</span><span class="p">(</span><span class="n">Name</span><span class="p">);</span>
+    
+    <span class="c1">// If F already has a body, reject this.</span>
+    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">F</span><span class="o">-></span><span class="n">empty</span><span class="p">())</span> <span class="p">{</span>
+      <span class="n">ErrorF</span><span class="p">(</span><span class="s">"redefinition of function"</span><span class="p">);</span>
+      <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="p">}</span>
+    
+    <span class="c1">// If F took a different number of args, reject.</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">F</span><span class="o">-></span><span class="n">arg_size</span><span class="p">()</span> <span class="o">!=</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">())</span> <span class="p">{</span>
+      <span class="n">ErrorF</span><span class="p">(</span><span class="s">"redefinition of function with different # args"</span><span class="p">);</span>
+      <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="p">}</span>
+  <span class="p">}</span>
+  
+  <span class="c1">// Set names for all arguments.</span>
+  <span class="kt">unsigned</span> <span class="n">Idx</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="k">for</span> <span class="p">(</span><span class="n">Function</span><span class="o">::</span><span class="n">arg_iterator</span> <span class="n">AI</span> <span class="o">=</span> <span class="n">F</span><span class="o">-></span><span class="n">arg_begin</span><span class="p">();</span> <span class="n">Idx</span> <span class="o">!=</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">();</span>
+       <span class="o">++</span><span class="n">AI</span><span class="p">,</span> <span class="o">++</span><span class="n">Idx</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">AI</span><span class="o">-></span><span class="n">setName</span><span class="p">(</span><span class="n">Args</span><span class="p">[</span><span class="n">Idx</span><span class="p">]);</span>
+    
+    <span class="c1">// Add arguments to variable symbol table.</span>
+    <span class="n">NamedValues</span><span class="p">[</span><span class="n">Args</span><span class="p">[</span><span class="n">Idx</span><span class="p">]]</span> <span class="o">=</span> <span class="n">AI</span><span class="p">;</span>
+  <span class="p">}</span>
+  
+  <span class="k">return</span> <span class="n">F</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="n">Function</span> <span class="o">*</span><span class="n">FunctionAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">NamedValues</span><span class="p">.</span><span class="n">clear</span><span class="p">();</span>
+  
+  <span class="n">Function</span> <span class="o">*</span><span class="n">TheFunction</span> <span class="o">=</span> <span class="n">Proto</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">TheFunction</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
+    <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="c1">// Create a new basic block to start insertion into.</span>
+  <span class="n">BasicBlock</span> <span class="o">*</span><span class="n">BB</span> <span class="o">=</span> <span class="n">BasicBlock</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="s">"entry"</span><span class="p">,</span> <span class="n">TheFunction</span><span class="p">);</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">SetInsertPoint</span><span class="p">(</span><span class="n">BB</span><span class="p">);</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">Value</span> <span class="o">*</span><span class="n">RetVal</span> <span class="o">=</span> <span class="n">Body</span><span class="o">-></span><span class="n">Codegen</span><span class="p">())</span> <span class="p">{</span>
+    <span class="c1">// Finish off the function.</span>
+    <span class="n">Builder</span><span class="p">.</span><span class="n">CreateRet</span><span class="p">(</span><span class="n">RetVal</span><span class="p">);</span>
+
+    <span class="c1">// Validate the generated code, checking for consistency.</span>
+    <span class="n">verifyFunction</span><span class="p">(</span><span class="o">*</span><span class="n">TheFunction</span><span class="p">);</span>
+
+    <span class="k">return</span> <span class="n">TheFunction</span><span class="p">;</span>
+  <span class="p">}</span>
+  
+  <span class="c1">// Error reading body, remove function.</span>
+  <span class="n">TheFunction</span><span class="o">-></span><span class="n">eraseFromParent</span><span class="p">();</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Top-Level parsing and JIT Driver</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="n">HandleDefinition</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">FunctionAST</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">ParseDefinition</span><span class="p">())</span> <span class="p">{</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">Function</span> <span class="o">*</span><span class="n">LF</span> <span class="o">=</span> <span class="n">F</span><span class="o">-></span><span class="n">Codegen</span><span class="p">())</span> <span class="p">{</span>
+      <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Read function definition:"</span><span class="p">);</span>
+      <span class="n">LF</span><span class="o">-></span><span class="n">dump</span><span class="p">();</span>
+    <span class="p">}</span>
+  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+    <span class="c1">// Skip token for error recovery.</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="n">HandleExtern</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">P</span> <span class="o">=</span> <span class="n">ParseExtern</span><span class="p">())</span> <span class="p">{</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">Function</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">P</span><span class="o">-></span><span class="n">Codegen</span><span class="p">())</span> <span class="p">{</span>
+      <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Read extern: "</span><span class="p">);</span>
+      <span class="n">F</span><span class="o">-></span><span class="n">dump</span><span class="p">();</span>
+    <span class="p">}</span>
+  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+    <span class="c1">// Skip token for error recovery.</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="n">HandleTopLevelExpression</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Evaluate a top-level expression into an anonymous function.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">FunctionAST</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">ParseTopLevelExpr</span><span class="p">())</span> <span class="p">{</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">Function</span> <span class="o">*</span><span class="n">LF</span> <span class="o">=</span> <span class="n">F</span><span class="o">-></span><span class="n">Codegen</span><span class="p">())</span> <span class="p">{</span>
+      <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Read top-level expression:"</span><span class="p">);</span>
+      <span class="n">LF</span><span class="o">-></span><span class="n">dump</span><span class="p">();</span>
+    <span class="p">}</span>
+  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+    <span class="c1">// Skip token for error recovery.</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="c1">/// top ::= definition | external | expression | ';'</span>
+<span class="k">static</span> <span class="kt">void</span> <span class="n">MainLoop</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"ready> "</span><span class="p">);</span>
+    <span class="k">switch</span> <span class="p">(</span><span class="n">CurTok</span><span class="p">)</span> <span class="p">{</span>
+    <span class="k">case</span> <span class="n">tok_eof</span>:    <span class="k">return</span><span class="p">;</span>
+    <span class="k">case</span> <span class="sc">';'</span>:        <span class="n">getNextToken</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>  <span class="c1">// ignore top-level semicolons.</span>
+    <span class="k">case</span> <span class="n">tok_def</span>:    <span class="n">HandleDefinition</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>
+    <span class="k">case</span> <span class="n">tok_extern</span>: <span class="n">HandleExtern</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>
+    <span class="nl">default:</span>         <span class="n">HandleTopLevelExpression</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>
+    <span class="p">}</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// "Library" functions that can be "extern'd" from user code.</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="c1">/// putchard - putchar that takes a double and returns 0.</span>
+<span class="k">extern</span> <span class="s">"C"</span> 
+<span class="kt">double</span> <span class="n">putchard</span><span class="p">(</span><span class="kt">double</span> <span class="n">X</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">putchar</span><span class="p">((</span><span class="kt">char</span><span class="p">)</span><span class="n">X</span><span class="p">);</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Main driver code.</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="kt">int</span> <span class="n">main</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">LLVMContext</span> <span class="o">&</span><span class="n">Context</span> <span class="o">=</span> <span class="n">getGlobalContext</span><span class="p">();</span>
+
+  <span class="c1">// Install standard binary operators.</span>
+  <span class="c1">// 1 is lowest precedence.</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'<'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">10</span><span class="p">;</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'+'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">20</span><span class="p">;</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'-'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">20</span><span class="p">;</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'*'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">40</span><span class="p">;</span>  <span class="c1">// highest.</span>
+
+  <span class="c1">// Prime the first token.</span>
+  <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"ready> "</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>
+
+  <span class="c1">// Make the module, which holds all the code.</span>
+  <span class="n">TheModule</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Module</span><span class="p">(</span><span class="s">"my cool jit"</span><span class="p">,</span> <span class="n">Context</span><span class="p">);</span>
+
+  <span class="c1">// Run the main "interpreter loop" now.</span>
+  <span class="n">MainLoop</span><span class="p">();</span>
+
+  <span class="c1">// Print out all of the generated code.</span>
+  <span class="n">TheModule</span><span class="o">-></span><span class="n">dump</span><span class="p">();</span>
+
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p><a class="reference external" href="LangImpl4.html">Next: Adding JIT and Optimizer Support</a></p>
+</div>
+</div>
+
+
+          </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="LangImpl4.html" title="4. Kaleidoscope: Adding JIT and Optimizer Support"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="LangImpl2.html" title="2. Kaleidoscope: Implementing a Parser and AST"
+             >previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="../index.html">Documentation</a>»</li>
+
+          <li><a href="index.html" >LLVM Tutorial: Table of Contents</a> »</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        © Copyright 2003-2013, LLVM Project.
+      Last updated on 2014-06-16.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.4.2/docs/tutorial/LangImpl4.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.4.2/docs/tutorial/LangImpl4.html?rev=211020&view=auto
==============================================================================
--- www-releases/trunk/3.4.2/docs/tutorial/LangImpl4.html (added)
+++ www-releases/trunk/3.4.2/docs/tutorial/LangImpl4.html Mon Jun 16 08:19:07 2014
@@ -0,0 +1,1104 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>4. Kaleidoscope: Adding JIT and Optimizer Support — LLVM 3.4 documentation</title>
+    
+    <link rel="stylesheet" href="../_static/llvm-theme.css" type="text/css" />
+    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../',
+        VERSION:     '3.4',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../_static/jquery.js"></script>
+    <script type="text/javascript" src="../_static/underscore.js"></script>
+    <script type="text/javascript" src="../_static/doctools.js"></script>
+    <link rel="top" title="LLVM 3.4 documentation" href="../index.html" />
+    <link rel="up" title="LLVM Tutorial: Table of Contents" href="index.html" />
+    <link rel="next" title="5. Kaleidoscope: Extending the Language: Control Flow" href="LangImpl5.html" />
+    <link rel="prev" title="3. Kaleidoscope: Code generation to LLVM IR" href="LangImpl3.html" />
+<style type="text/css">
+  table.right { float: right; margin-left: 20px; }
+  table.right td { border: 1px solid #ccc; }
+</style>
+
+  </head>
+  <body>
+<div class="logo">
+  <a href="../index.html">
+    <img src="../_static/logo.png"
+         alt="LLVM Logo" width="250" height="88"/></a>
+</div>
+
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="LangImpl5.html" title="5. Kaleidoscope: Extending the Language: Control Flow"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="LangImpl3.html" title="3. Kaleidoscope: Code generation to LLVM IR"
+             accesskey="P">previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="../index.html">Documentation</a>»</li>
+
+          <li><a href="index.html" accesskey="U">LLVM Tutorial: Table of Contents</a> »</li> 
+      </ul>
+    </div>
+
+
+    <div class="document">
+      <div class="documentwrapper">
+          <div class="body">
+            
+  <div class="section" id="kaleidoscope-adding-jit-and-optimizer-support">
+<h1>4. Kaleidoscope: Adding JIT and Optimizer Support<a class="headerlink" href="#kaleidoscope-adding-jit-and-optimizer-support" title="Permalink to this headline">¶</a></h1>
+<div class="contents local topic" id="contents">
+<ul class="simple">
+<li><a class="reference internal" href="#chapter-4-introduction" id="id1">Chapter 4 Introduction</a></li>
+<li><a class="reference internal" href="#trivial-constant-folding" id="id2">Trivial Constant Folding</a></li>
+<li><a class="reference internal" href="#llvm-optimization-passes" id="id3">LLVM Optimization Passes</a></li>
+<li><a class="reference internal" href="#adding-a-jit-compiler" id="id4">Adding a JIT Compiler</a></li>
+<li><a class="reference internal" href="#full-code-listing" id="id5">Full Code Listing</a></li>
+</ul>
+</div>
+<div class="section" id="chapter-4-introduction">
+<h2><a class="toc-backref" href="#id1">4.1. Chapter 4 Introduction</a><a class="headerlink" href="#chapter-4-introduction" title="Permalink to this headline">¶</a></h2>
+<p>Welcome to Chapter 4 of the “<a class="reference external" href="index.html">Implementing a language with
+LLVM</a>” tutorial. Chapters 1-3 described the implementation
+of a simple language and added support for generating LLVM IR. This
+chapter describes two new techniques: adding optimizer support to your
+language, and adding JIT compiler support. These additions will
+demonstrate how to get nice, efficient code for the Kaleidoscope
+language.</p>
+</div>
+<div class="section" id="trivial-constant-folding">
+<h2><a class="toc-backref" href="#id2">4.2. Trivial Constant Folding</a><a class="headerlink" href="#trivial-constant-folding" title="Permalink to this headline">¶</a></h2>
+<p>Our demonstration for Chapter 3 is elegant and easy to extend.
+Unfortunately, it does not produce wonderful code. The IRBuilder,
+however, does give us obvious optimizations when compiling simple code:</p>
+<div class="highlight-python"><pre>ready> def test(x) 1+2+x;
+Read function definition:
+define double @test(double %x) {
+entry:
+        %addtmp = fadd double 3.000000e+00, %x
+        ret double %addtmp
+}</pre>
+</div>
+<p>This code is not a literal transcription of the AST built by parsing the
+input. That would be:</p>
+<div class="highlight-python"><pre>ready> def test(x) 1+2+x;
+Read function definition:
+define double @test(double %x) {
+entry:
+        %addtmp = fadd double 2.000000e+00, 1.000000e+00
+        %addtmp1 = fadd double %addtmp, %x
+        ret double %addtmp1
+}</pre>
+</div>
+<p>Constant folding, as seen above, in particular, is a very common and
+very important optimization: so much so that many language implementors
+implement constant folding support in their AST representation.</p>
+<p>With LLVM, you don’t need this support in the AST. Since all calls to
+build LLVM IR go through the LLVM IR builder, the builder itself checked
+to see if there was a constant folding opportunity when you call it. If
+so, it just does the constant fold and return the constant instead of
+creating an instruction.</p>
+<p>Well, that was easy :). In practice, we recommend always using
+<tt class="docutils literal"><span class="pre">IRBuilder</span></tt> when generating code like this. It has no “syntactic
+overhead” for its use (you don’t have to uglify your compiler with
+constant checks everywhere) and it can dramatically reduce the amount of
+LLVM IR that is generated in some cases (particular for languages with a
+macro preprocessor or that use a lot of constants).</p>
+<p>On the other hand, the <tt class="docutils literal"><span class="pre">IRBuilder</span></tt> is limited by the fact that it does
+all of its analysis inline with the code as it is built. If you take a
+slightly more complex example:</p>
+<div class="highlight-python"><pre>ready> def test(x) (1+2+x)*(x+(1+2));
+ready> Read function definition:
+define double @test(double %x) {
+entry:
+        %addtmp = fadd double 3.000000e+00, %x
+        %addtmp1 = fadd double %x, 3.000000e+00
+        %multmp = fmul double %addtmp, %addtmp1
+        ret double %multmp
+}</pre>
+</div>
+<p>In this case, the LHS and RHS of the multiplication are the same value.
+We’d really like to see this generate “<tt class="docutils literal"><span class="pre">tmp</span> <span class="pre">=</span> <span class="pre">x+3;</span> <span class="pre">result</span> <span class="pre">=</span> <span class="pre">tmp*tmp;</span></tt>”
+instead of computing “<tt class="docutils literal"><span class="pre">x+3</span></tt>” twice.</p>
+<p>Unfortunately, no amount of local analysis will be able to detect and
+correct this. This requires two transformations: reassociation of
+expressions (to make the add’s lexically identical) and Common
+Subexpression Elimination (CSE) to delete the redundant add instruction.
+Fortunately, LLVM provides a broad range of optimizations that you can
+use, in the form of “passes”.</p>
+</div>
+<div class="section" id="llvm-optimization-passes">
+<h2><a class="toc-backref" href="#id3">4.3. LLVM Optimization Passes</a><a class="headerlink" href="#llvm-optimization-passes" title="Permalink to this headline">¶</a></h2>
+<p>LLVM provides many optimization passes, which do many different sorts of
+things and have different tradeoffs. Unlike other systems, LLVM doesn’t
+hold to the mistaken notion that one set of optimizations is right for
+all languages and for all situations. LLVM allows a compiler implementor
+to make complete decisions about what optimizations to use, in which
+order, and in what situation.</p>
+<p>As a concrete example, LLVM supports both “whole module” passes, which
+look across as large of body of code as they can (often a whole file,
+but if run at link time, this can be a substantial portion of the whole
+program). It also supports and includes “per-function” passes which just
+operate on a single function at a time, without looking at other
+functions. For more information on passes and how they are run, see the
+<a class="reference external" href="../WritingAnLLVMPass.html">How to Write a Pass</a> document and the
+<a class="reference external" href="../Passes.html">List of LLVM Passes</a>.</p>
+<p>For Kaleidoscope, we are currently generating functions on the fly, one
+at a time, as the user types them in. We aren’t shooting for the
+ultimate optimization experience in this setting, but we also want to
+catch the easy and quick stuff where possible. As such, we will choose
+to run a few per-function optimizations as the user types the function
+in. If we wanted to make a “static Kaleidoscope compiler”, we would use
+exactly the code we have now, except that we would defer running the
+optimizer until the entire file has been parsed.</p>
+<p>In order to get per-function optimizations going, we need to set up a
+<a class="reference external" href="../WritingAnLLVMPass.html#passmanager">FunctionPassManager</a> to hold
+and organize the LLVM optimizations that we want to run. Once we have
+that, we can add a set of optimizations to run. The code looks like
+this:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">FunctionPassManager</span> <span class="nf">OurFPM</span><span class="p">(</span><span class="n">TheModule</span><span class="p">);</span>
+
+<span class="c1">// Set up the optimizer pipeline.  Start with registering info about how the</span>
+<span class="c1">// target lays out data structures.</span>
+<span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="k">new</span> <span class="n">DataLayout</span><span class="p">(</span><span class="o">*</span><span class="n">TheExecutionEngine</span><span class="o">-></span><span class="n">getDataLayout</span><span class="p">()));</span>
+<span class="c1">// Provide basic AliasAnalysis support for GVN.</span>
+<span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createBasicAliasAnalysisPass</span><span class="p">());</span>
+<span class="c1">// Do simple "peephole" optimizations and bit-twiddling optzns.</span>
+<span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createInstructionCombiningPass</span><span class="p">());</span>
+<span class="c1">// Reassociate expressions.</span>
+<span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createReassociatePass</span><span class="p">());</span>
+<span class="c1">// Eliminate Common SubExpressions.</span>
+<span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createGVNPass</span><span class="p">());</span>
+<span class="c1">// Simplify the control flow graph (deleting unreachable blocks, etc).</span>
+<span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createCFGSimplificationPass</span><span class="p">());</span>
+
+<span class="n">OurFPM</span><span class="p">.</span><span class="n">doInitialization</span><span class="p">();</span>
+
+<span class="c1">// Set the global so the code gen can use this.</span>
+<span class="n">TheFPM</span> <span class="o">=</span> <span class="o">&</span><span class="n">OurFPM</span><span class="p">;</span>
+
+<span class="c1">// Run the main "interpreter loop" now.</span>
+<span class="n">MainLoop</span><span class="p">();</span>
+</pre></div>
+</div>
+<p>This code defines a <tt class="docutils literal"><span class="pre">FunctionPassManager</span></tt>, “<tt class="docutils literal"><span class="pre">OurFPM</span></tt>”. It requires a
+pointer to the <tt class="docutils literal"><span class="pre">Module</span></tt> to construct itself. Once it is set up, we use
+a series of “add” calls to add a bunch of LLVM passes. The first pass is
+basically boilerplate, it adds a pass so that later optimizations know
+how the data structures in the program are laid out. The
+“<tt class="docutils literal"><span class="pre">TheExecutionEngine</span></tt>” variable is related to the JIT, which we will
+get to in the next section.</p>
+<p>In this case, we choose to add 4 optimization passes. The passes we
+chose here are a pretty standard set of “cleanup” optimizations that are
+useful for a wide variety of code. I won’t delve into what they do but,
+believe me, they are a good starting place :).</p>
+<p>Once the PassManager is set up, we need to make use of it. We do this by
+running it after our newly created function is constructed (in
+<tt class="docutils literal"><span class="pre">FunctionAST::Codegen</span></tt>), but before it is returned to the client:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">if</span> <span class="p">(</span><span class="n">Value</span> <span class="o">*</span><span class="n">RetVal</span> <span class="o">=</span> <span class="n">Body</span><span class="o">-></span><span class="n">Codegen</span><span class="p">())</span> <span class="p">{</span>
+  <span class="c1">// Finish off the function.</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">CreateRet</span><span class="p">(</span><span class="n">RetVal</span><span class="p">);</span>
+
+  <span class="c1">// Validate the generated code, checking for consistency.</span>
+  <span class="n">verifyFunction</span><span class="p">(</span><span class="o">*</span><span class="n">TheFunction</span><span class="p">);</span>
+
+  <span class="c1">// Optimize the function.</span>
+  <span class="n">TheFPM</span><span class="o">-></span><span class="n">run</span><span class="p">(</span><span class="o">*</span><span class="n">TheFunction</span><span class="p">);</span>
+
+  <span class="k">return</span> <span class="n">TheFunction</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>As you can see, this is pretty straightforward. The
+<tt class="docutils literal"><span class="pre">FunctionPassManager</span></tt> optimizes and updates the LLVM Function* in
+place, improving (hopefully) its body. With this in place, we can try
+our test above again:</p>
+<div class="highlight-python"><pre>ready> def test(x) (1+2+x)*(x+(1+2));
+ready> Read function definition:
+define double @test(double %x) {
+entry:
+        %addtmp = fadd double %x, 3.000000e+00
+        %multmp = fmul double %addtmp, %addtmp
+        ret double %multmp
+}</pre>
+</div>
+<p>As expected, we now get our nicely optimized code, saving a floating
+point add instruction from every execution of this function.</p>
+<p>LLVM provides a wide variety of optimizations that can be used in
+certain circumstances. Some <a class="reference external" href="../Passes.html">documentation about the various
+passes</a> is available, but it isn’t very complete.
+Another good source of ideas can come from looking at the passes that
+<tt class="docutils literal"><span class="pre">Clang</span></tt> runs to get started. The “<tt class="docutils literal"><span class="pre">opt</span></tt>” tool allows you to
+experiment with passes from the command line, so you can see if they do
+anything.</p>
+<p>Now that we have reasonable code coming out of our front-end, lets talk
+about executing it!</p>
+</div>
+<div class="section" id="adding-a-jit-compiler">
+<h2><a class="toc-backref" href="#id4">4.4. Adding a JIT Compiler</a><a class="headerlink" href="#adding-a-jit-compiler" title="Permalink to this headline">¶</a></h2>
+<p>Code that is available in LLVM IR can have a wide variety of tools
+applied to it. For example, you can run optimizations on it (as we did
+above), you can dump it out in textual or binary forms, you can compile
+the code to an assembly file (.s) for some target, or you can JIT
+compile it. The nice thing about the LLVM IR representation is that it
+is the “common currency” between many different parts of the compiler.</p>
+<p>In this section, we’ll add JIT compiler support to our interpreter. The
+basic idea that we want for Kaleidoscope is to have the user enter
+function bodies as they do now, but immediately evaluate the top-level
+expressions they type in. For example, if they type in “1 + 2;”, we
+should evaluate and print out 3. If they define a function, they should
+be able to call it from the command line.</p>
+<p>In order to do this, we first declare and initialize the JIT. This is
+done by adding a global variable and a call in <tt class="docutils literal"><span class="pre">main</span></tt>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">static</span> <span class="n">ExecutionEngine</span> <span class="o">*</span><span class="n">TheExecutionEngine</span><span class="p">;</span>
+<span class="p">...</span>
+<span class="kt">int</span> <span class="n">main</span><span class="p">()</span> <span class="p">{</span>
+  <span class="p">..</span>
+  <span class="c1">// Create the JIT.  This takes ownership of the module.</span>
+  <span class="n">TheExecutionEngine</span> <span class="o">=</span> <span class="n">EngineBuilder</span><span class="p">(</span><span class="n">TheModule</span><span class="p">).</span><span class="n">create</span><span class="p">();</span>
+  <span class="p">..</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>This creates an abstract “Execution Engine” which can be either a JIT
+compiler or the LLVM interpreter. LLVM will automatically pick a JIT
+compiler for you if one is available for your platform, otherwise it
+will fall back to the interpreter.</p>
+<p>Once the <tt class="docutils literal"><span class="pre">ExecutionEngine</span></tt> is created, the JIT is ready to be used.
+There are a variety of APIs that are useful, but the simplest one is the
+“<tt class="docutils literal"><span class="pre">getPointerToFunction(F)</span></tt>” method. This method JIT compiles the
+specified LLVM Function and returns a function pointer to the generated
+machine code. In our case, this means that we can change the code that
+parses a top-level expression to look like this:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">static</span> <span class="kt">void</span> <span class="nf">HandleTopLevelExpression</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Evaluate a top-level expression into an anonymous function.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">FunctionAST</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">ParseTopLevelExpr</span><span class="p">())</span> <span class="p">{</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">Function</span> <span class="o">*</span><span class="n">LF</span> <span class="o">=</span> <span class="n">F</span><span class="o">-></span><span class="n">Codegen</span><span class="p">())</span> <span class="p">{</span>
+      <span class="n">LF</span><span class="o">-></span><span class="n">dump</span><span class="p">();</span>  <span class="c1">// Dump the function for exposition purposes.</span>
+
+      <span class="c1">// JIT the function, returning a function pointer.</span>
+      <span class="kt">void</span> <span class="o">*</span><span class="n">FPtr</span> <span class="o">=</span> <span class="n">TheExecutionEngine</span><span class="o">-></span><span class="n">getPointerToFunction</span><span class="p">(</span><span class="n">LF</span><span class="p">);</span>
+
+      <span class="c1">// Cast it to the right type (takes no arguments, returns a double) so we</span>
+      <span class="c1">// can call it as a native function.</span>
+      <span class="kt">double</span> <span class="p">(</span><span class="o">*</span><span class="n">FP</span><span class="p">)()</span> <span class="o">=</span> <span class="p">(</span><span class="kt">double</span> <span class="p">(</span><span class="o">*</span><span class="p">)())(</span><span class="kt">intptr_t</span><span class="p">)</span><span class="n">FPtr</span><span class="p">;</span>
+      <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Evaluated to %f</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">FP</span><span class="p">());</span>
+    <span class="p">}</span>
+</pre></div>
+</div>
+<p>Recall that we compile top-level expressions into a self-contained LLVM
+function that takes no arguments and returns the computed double.
+Because the LLVM JIT compiler matches the native platform ABI, this
+means that you can just cast the result pointer to a function pointer of
+that type and call it directly. This means, there is no difference
+between JIT compiled code and native machine code that is statically
+linked into your application.</p>
+<p>With just these two changes, lets see how Kaleidoscope works now!</p>
+<div class="highlight-python"><pre>ready> 4+5;
+Read top-level expression:
+define double @0() {
+entry:
+  ret double 9.000000e+00
+}
+
+Evaluated to 9.000000</pre>
+</div>
+<p>Well this looks like it is basically working. The dump of the function
+shows the “no argument function that always returns double” that we
+synthesize for each top-level expression that is typed in. This
+demonstrates very basic functionality, but can we do more?</p>
+<div class="highlight-python"><pre>ready> def testfunc(x y) x + y*2;
+Read function definition:
+define double @testfunc(double %x, double %y) {
+entry:
+  %multmp = fmul double %y, 2.000000e+00
+  %addtmp = fadd double %multmp, %x
+  ret double %addtmp
+}
+
+ready> testfunc(4, 10);
+Read top-level expression:
+define double @1() {
+entry:
+  %calltmp = call double @testfunc(double 4.000000e+00, double 1.000000e+01)
+  ret double %calltmp
+}
+
+Evaluated to 24.000000</pre>
+</div>
+<p>This illustrates that we can now call user code, but there is something
+a bit subtle going on here. Note that we only invoke the JIT on the
+anonymous functions that <em>call testfunc</em>, but we never invoked it on
+<em>testfunc</em> itself. What actually happened here is that the JIT scanned
+for all non-JIT’d functions transitively called from the anonymous
+function and compiled all of them before returning from
+<tt class="docutils literal"><span class="pre">getPointerToFunction()</span></tt>.</p>
+<p>The JIT provides a number of other more advanced interfaces for things
+like freeing allocated machine code, rejit’ing functions to update them,
+etc. However, even with this simple code, we get some surprisingly
+powerful capabilities - check this out (I removed the dump of the
+anonymous functions, you should get the idea by now :) :</p>
+<div class="highlight-python"><pre>ready> extern sin(x);
+Read extern:
+declare double @sin(double)
+
+ready> extern cos(x);
+Read extern:
+declare double @cos(double)
+
+ready> sin(1.0);
+Read top-level expression:
+define double @2() {
+entry:
+  ret double 0x3FEAED548F090CEE
+}
+
+Evaluated to 0.841471
+
+ready> def foo(x) sin(x)*sin(x) + cos(x)*cos(x);
+Read function definition:
+define double @foo(double %x) {
+entry:
+  %calltmp = call double @sin(double %x)
+  %multmp = fmul double %calltmp, %calltmp
+  %calltmp2 = call double @cos(double %x)
+  %multmp4 = fmul double %calltmp2, %calltmp2
+  %addtmp = fadd double %multmp, %multmp4
+  ret double %addtmp
+}
+
+ready> foo(4.0);
+Read top-level expression:
+define double @3() {
+entry:
+  %calltmp = call double @foo(double 4.000000e+00)
+  ret double %calltmp
+}
+
+Evaluated to 1.000000</pre>
+</div>
+<p>Whoa, how does the JIT know about sin and cos? The answer is
+surprisingly simple: in this example, the JIT started execution of a
+function and got to a function call. It realized that the function was
+not yet JIT compiled and invoked the standard set of routines to resolve
+the function. In this case, there is no body defined for the function,
+so the JIT ended up calling “<tt class="docutils literal"><span class="pre">dlsym("sin")</span></tt>” on the Kaleidoscope
+process itself. Since “<tt class="docutils literal"><span class="pre">sin</span></tt>” is defined within the JIT’s address
+space, it simply patches up calls in the module to call the libm version
+of <tt class="docutils literal"><span class="pre">sin</span></tt> directly.</p>
+<p>The LLVM JIT provides a number of interfaces (look in the
+<tt class="docutils literal"><span class="pre">ExecutionEngine.h</span></tt> file) for controlling how unknown functions get
+resolved. It allows you to establish explicit mappings between IR
+objects and addresses (useful for LLVM global variables that you want to
+map to static tables, for example), allows you to dynamically decide on
+the fly based on the function name, and even allows you to have the JIT
+compile functions lazily the first time they’re called.</p>
+<p>One interesting application of this is that we can now extend the
+language by writing arbitrary C++ code to implement operations. For
+example, if we add:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// putchard - putchar that takes a double and returns 0.</span>
+<span class="k">extern</span> <span class="s">"C"</span>
+<span class="kt">double</span> <span class="n">putchard</span><span class="p">(</span><span class="kt">double</span> <span class="n">X</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">putchar</span><span class="p">((</span><span class="kt">char</span><span class="p">)</span><span class="n">X</span><span class="p">);</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Now we can produce simple output to the console by using things like:
+“<tt class="docutils literal"><span class="pre">extern</span> <span class="pre">putchard(x);</span> <span class="pre">putchard(120);</span></tt>”, which prints a lowercase ‘x’
+on the console (120 is the ASCII code for ‘x’). Similar code could be
+used to implement file I/O, console input, and many other capabilities
+in Kaleidoscope.</p>
+<p>This completes the JIT and optimizer chapter of the Kaleidoscope
+tutorial. At this point, we can compile a non-Turing-complete
+programming language, optimize and JIT compile it in a user-driven way.
+Next up we’ll look into <a class="reference external" href="LangImpl5.html">extending the language with control flow
+constructs</a>, tackling some interesting LLVM IR issues
+along the way.</p>
+</div>
+<div class="section" id="full-code-listing">
+<h2><a class="toc-backref" href="#id5">4.5. Full Code Listing</a><a class="headerlink" href="#full-code-listing" title="Permalink to this headline">¶</a></h2>
+<p>Here is the complete code listing for our running example, enhanced with
+the LLVM JIT and optimizer. To build this example, use:</p>
+<div class="highlight-bash"><div class="highlight"><pre><span class="c"># Compile</span>
+clang++ -g toy.cpp <span class="sb">`</span>llvm-config --cppflags --ldflags --libs core jit native<span class="sb">`</span> -O3 -o toy
+<span class="c"># Run</span>
+./toy
+</pre></div>
+</div>
+<p>If you are compiling this on Linux, make sure to add the “-rdynamic”
+option as well. This makes sure that the external functions are resolved
+properly at runtime.</p>
+<p>Here is the code:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include "llvm/Analysis/Passes.h"</span>
+<span class="cp">#include "llvm/Analysis/Verifier.h"</span>
+<span class="cp">#include "llvm/ExecutionEngine/ExecutionEngine.h"</span>
+<span class="cp">#include "llvm/ExecutionEngine/JIT.h"</span>
+<span class="cp">#include "llvm/IR/DataLayout.h"</span>
+<span class="cp">#include "llvm/IR/DerivedTypes.h"</span>
+<span class="cp">#include "llvm/IR/IRBuilder.h"</span>
+<span class="cp">#include "llvm/IR/LLVMContext.h"</span>
+<span class="cp">#include "llvm/IR/Module.h"</span>
+<span class="cp">#include "llvm/PassManager.h"</span>
+<span class="cp">#include "llvm/Support/TargetSelect.h"</span>
+<span class="cp">#include "llvm/Transforms/Scalar.h"</span>
+<span class="cp">#include <cctype></span>
+<span class="cp">#include <cstdio></span>
+<span class="cp">#include <map></span>
+<span class="cp">#include <string></span>
+<span class="cp">#include <vector></span>
+<span class="k">using</span> <span class="k">namespace</span> <span class="n">llvm</span><span class="p">;</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Lexer</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="c1">// The lexer returns tokens [0-255] if it is an unknown character, otherwise one</span>
+<span class="c1">// of these for known things.</span>
+<span class="k">enum</span> <span class="n">Token</span> <span class="p">{</span>
+  <span class="n">tok_eof</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span>
+
+  <span class="c1">// commands</span>
+  <span class="n">tok_def</span> <span class="o">=</span> <span class="o">-</span><span class="mi">2</span><span class="p">,</span> <span class="n">tok_extern</span> <span class="o">=</span> <span class="o">-</span><span class="mi">3</span><span class="p">,</span>
+
+  <span class="c1">// primary</span>
+  <span class="n">tok_identifier</span> <span class="o">=</span> <span class="o">-</span><span class="mi">4</span><span class="p">,</span> <span class="n">tok_number</span> <span class="o">=</span> <span class="o">-</span><span class="mi">5</span>
+<span class="p">};</span>
+
+<span class="k">static</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">IdentifierStr</span><span class="p">;</span>  <span class="c1">// Filled in if tok_identifier</span>
+<span class="k">static</span> <span class="kt">double</span> <span class="n">NumVal</span><span class="p">;</span>              <span class="c1">// Filled in if tok_number</span>
+
+<span class="c1">/// gettok - Return the next token from standard input.</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">gettok</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">static</span> <span class="kt">int</span> <span class="n">LastChar</span> <span class="o">=</span> <span class="sc">' '</span><span class="p">;</span>
+
+  <span class="c1">// Skip any whitespace.</span>
+  <span class="k">while</span> <span class="p">(</span><span class="n">isspace</span><span class="p">(</span><span class="n">LastChar</span><span class="p">))</span>
+    <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">isalpha</span><span class="p">(</span><span class="n">LastChar</span><span class="p">))</span> <span class="p">{</span> <span class="c1">// identifier: [a-zA-Z][a-zA-Z0-9]*</span>
+    <span class="n">IdentifierStr</span> <span class="o">=</span> <span class="n">LastChar</span><span class="p">;</span>
+    <span class="k">while</span> <span class="p">(</span><span class="n">isalnum</span><span class="p">((</span><span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">())))</span>
+      <span class="n">IdentifierStr</span> <span class="o">+=</span> <span class="n">LastChar</span><span class="p">;</span>
+
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"def"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_def</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"extern"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_extern</span><span class="p">;</span>
+    <span class="k">return</span> <span class="n">tok_identifier</span><span class="p">;</span>
+  <span class="p">}</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">isdigit</span><span class="p">(</span><span class="n">LastChar</span><span class="p">)</span> <span class="o">||</span> <span class="n">LastChar</span> <span class="o">==</span> <span class="sc">'.'</span><span class="p">)</span> <span class="p">{</span>   <span class="c1">// Number: [0-9.]+</span>
+    <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">NumStr</span><span class="p">;</span>
+    <span class="k">do</span> <span class="p">{</span>
+      <span class="n">NumStr</span> <span class="o">+=</span> <span class="n">LastChar</span><span class="p">;</span>
+      <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+    <span class="p">}</span> <span class="k">while</span> <span class="p">(</span><span class="n">isdigit</span><span class="p">(</span><span class="n">LastChar</span><span class="p">)</span> <span class="o">||</span> <span class="n">LastChar</span> <span class="o">==</span> <span class="sc">'.'</span><span class="p">);</span>
+
+    <span class="n">NumVal</span> <span class="o">=</span> <span class="n">strtod</span><span class="p">(</span><span class="n">NumStr</span><span class="p">.</span><span class="n">c_str</span><span class="p">(),</span> <span class="mi">0</span><span class="p">);</span>
+    <span class="k">return</span> <span class="n">tok_number</span><span class="p">;</span>
+  <span class="p">}</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">==</span> <span class="sc">'#'</span><span class="p">)</span> <span class="p">{</span>
+    <span class="c1">// Comment until end of line.</span>
+    <span class="k">do</span> <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+    <span class="k">while</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">!=</span> <span class="n">EOF</span> <span class="o">&&</span> <span class="n">LastChar</span> <span class="o">!=</span> <span class="sc">'\n'</span> <span class="o">&&</span> <span class="n">LastChar</span> <span class="o">!=</span> <span class="sc">'\r'</span><span class="p">);</span>
+    
+    <span class="k">if</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">!=</span> <span class="n">EOF</span><span class="p">)</span>
+      <span class="k">return</span> <span class="n">gettok</span><span class="p">();</span>
+  <span class="p">}</span>
+  
+  <span class="c1">// Check for end of file.  Don't eat the EOF.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">==</span> <span class="n">EOF</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">tok_eof</span><span class="p">;</span>
+
+  <span class="c1">// Otherwise, just return the character as its ascii value.</span>
+  <span class="kt">int</span> <span class="n">ThisChar</span> <span class="o">=</span> <span class="n">LastChar</span><span class="p">;</span>
+  <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+  <span class="k">return</span> <span class="n">ThisChar</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Abstract Syntax Tree (aka Parse Tree)</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="k">namespace</span> <span class="p">{</span>
+<span class="c1">/// ExprAST - Base class for all expression nodes.</span>
+<span class="k">class</span> <span class="nc">ExprAST</span> <span class="p">{</span>
+<span class="nl">public:</span>
+  <span class="k">virtual</span> <span class="o">~</span><span class="n">ExprAST</span><span class="p">()</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">()</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">};</span>
+
+<span class="c1">/// NumberExprAST - Expression class for numeric literals like "1.0".</span>
+<span class="k">class</span> <span class="nc">NumberExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="kt">double</span> <span class="n">Val</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">NumberExprAST</span><span class="p">(</span><span class="kt">double</span> <span class="n">val</span><span class="p">)</span> <span class="o">:</span> <span class="n">Val</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// VariableExprAST - Expression class for referencing a variable, like "a".</span>
+<span class="k">class</span> <span class="nc">VariableExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">Name</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">VariableExprAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">name</span><span class="p">)</span> <span class="o">:</span> <span class="n">Name</span><span class="p">(</span><span class="n">name</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// BinaryExprAST - Expression class for a binary operator.</span>
+<span class="k">class</span> <span class="nc">BinaryExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="kt">char</span> <span class="n">Op</span><span class="p">;</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">LHS</span><span class="p">,</span> <span class="o">*</span><span class="n">RHS</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">BinaryExprAST</span><span class="p">(</span><span class="kt">char</span> <span class="n">op</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">lhs</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">rhs</span><span class="p">)</span> 
+    <span class="o">:</span> <span class="n">Op</span><span class="p">(</span><span class="n">op</span><span class="p">),</span> <span class="n">LHS</span><span class="p">(</span><span class="n">lhs</span><span class="p">),</span> <span class="n">RHS</span><span class="p">(</span><span class="n">rhs</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// CallExprAST - Expression class for function calls.</span>
+<span class="k">class</span> <span class="nc">CallExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">Callee</span><span class="p">;</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">ExprAST</span><span class="o">*></span> <span class="n">Args</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">CallExprAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">callee</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">ExprAST</span><span class="o">*></span> <span class="o">&</span><span class="n">args</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">Callee</span><span class="p">(</span><span class="n">callee</span><span class="p">),</span> <span class="n">Args</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// PrototypeAST - This class represents the "prototype" for a function,</span>
+<span class="c1">/// which captures its name, and its argument names (thus implicitly the number</span>
+<span class="c1">/// of arguments the function takes).</span>
+<span class="k">class</span> <span class="nc">PrototypeAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">Name</span><span class="p">;</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="n">Args</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">PrototypeAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">name</span><span class="p">,</span> <span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="o">&</span><span class="n">args</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">Name</span><span class="p">(</span><span class="n">name</span><span class="p">),</span> <span class="n">Args</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="p">{}</span>
+  
+  <span class="n">Function</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// FunctionAST - This class represents a function definition itself.</span>
+<span class="k">class</span> <span class="nc">FunctionAST</span> <span class="p">{</span>
+  <span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">Proto</span><span class="p">;</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Body</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">FunctionAST</span><span class="p">(</span><span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">proto</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">body</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">Proto</span><span class="p">(</span><span class="n">proto</span><span class="p">),</span> <span class="n">Body</span><span class="p">(</span><span class="n">body</span><span class="p">)</span> <span class="p">{}</span>
+  
+  <span class="n">Function</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+<span class="p">}</span> <span class="c1">// end anonymous namespace</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Parser</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="c1">/// CurTok/getNextToken - Provide a simple token buffer.  CurTok is the current</span>
+<span class="c1">/// token the parser is looking at.  getNextToken reads another token from the</span>
+<span class="c1">/// lexer and updates CurTok with its results.</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="n">CurTok</span><span class="p">;</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">getNextToken</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="n">CurTok</span> <span class="o">=</span> <span class="n">gettok</span><span class="p">();</span>
+<span class="p">}</span>
+
+<span class="c1">/// BinopPrecedence - This holds the precedence for each binary operator that is</span>
+<span class="c1">/// defined.</span>
+<span class="k">static</span> <span class="n">std</span><span class="o">::</span><span class="n">map</span><span class="o"><</span><span class="kt">char</span><span class="p">,</span> <span class="kt">int</span><span class="o">></span> <span class="n">BinopPrecedence</span><span class="p">;</span>
+
+<span class="c1">/// GetTokPrecedence - Get the precedence of the pending binary operator token.</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">GetTokPrecedence</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">isascii</span><span class="p">(</span><span class="n">CurTok</span><span class="p">))</span>
+    <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
+  
+  <span class="c1">// Make sure it's a declared binop.</span>
+  <span class="kt">int</span> <span class="n">TokPrec</span> <span class="o">=</span> <span class="n">BinopPrecedence</span><span class="p">[</span><span class="n">CurTok</span><span class="p">];</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">TokPrec</span> <span class="o"><=</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
+  <span class="k">return</span> <span class="n">TokPrec</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// Error* - These are little helper functions for error handling.</span>
+<span class="n">ExprAST</span> <span class="o">*</span><span class="nf">Error</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Error: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">Str</span><span class="p">);</span><span class="k">return</span> <span class="mi">0</span><span class="p">;}</span>
+<span class="n">PrototypeAST</span> <span class="o">*</span><span class="nf">ErrorP</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">Error</span><span class="p">(</span><span class="n">Str</span><span class="p">);</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span>
+<span class="n">FunctionAST</span> <span class="o">*</span><span class="nf">ErrorF</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">Error</span><span class="p">(</span><span class="n">Str</span><span class="p">);</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span>
+
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseExpression</span><span class="p">();</span>
+
+<span class="c1">/// identifierexpr</span>
+<span class="c1">///   ::= identifier</span>
+<span class="c1">///   ::= identifier '(' expression* ')'</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseIdentifierExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">IdName</span> <span class="o">=</span> <span class="n">IdentifierStr</span><span class="p">;</span>
+  
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat identifier.</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">'('</span><span class="p">)</span> <span class="c1">// Simple variable ref.</span>
+    <span class="k">return</span> <span class="k">new</span> <span class="n">VariableExprAST</span><span class="p">(</span><span class="n">IdName</span><span class="p">);</span>
+  
+  <span class="c1">// Call.</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat (</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">ExprAST</span><span class="o">*></span> <span class="n">Args</span><span class="p">;</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">')'</span><span class="p">)</span> <span class="p">{</span>
+    <span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+      <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Arg</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+      <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">Arg</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+      <span class="n">Args</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="n">Arg</span><span class="p">);</span>
+
+      <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">==</span> <span class="sc">')'</span><span class="p">)</span> <span class="k">break</span><span class="p">;</span>
+
+      <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">','</span><span class="p">)</span>
+        <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"Expected ')' or ',' in argument list"</span><span class="p">);</span>
+      <span class="n">getNextToken</span><span class="p">();</span>
+    <span class="p">}</span>
+  <span class="p">}</span>
+
+  <span class="c1">// Eat the ')'.</span>
+  <span class="n">getNextToken</span><span class="p">();</span>
+  
+  <span class="k">return</span> <span class="k">new</span> <span class="n">CallExprAST</span><span class="p">(</span><span class="n">IdName</span><span class="p">,</span> <span class="n">Args</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="c1">/// numberexpr ::= number</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseNumberExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Result</span> <span class="o">=</span> <span class="k">new</span> <span class="n">NumberExprAST</span><span class="p">(</span><span class="n">NumVal</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span> <span class="c1">// consume the number</span>
+  <span class="k">return</span> <span class="n">Result</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// parenexpr ::= '(' expression ')'</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseParenExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat (.</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">V</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">V</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">')'</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected ')'"</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat ).</span>
+  <span class="k">return</span> <span class="n">V</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// primary</span>
+<span class="c1">///   ::= identifierexpr</span>
+<span class="c1">///   ::= numberexpr</span>
+<span class="c1">///   ::= parenexpr</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParsePrimary</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">switch</span> <span class="p">(</span><span class="n">CurTok</span><span class="p">)</span> <span class="p">{</span>
+  <span class="nl">default:</span> <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"unknown token when expecting an expression"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="n">tok_identifier</span>: <span class="k">return</span> <span class="n">ParseIdentifierExpr</span><span class="p">();</span>
+  <span class="k">case</span> <span class="n">tok_number</span>:     <span class="k">return</span> <span class="n">ParseNumberExpr</span><span class="p">();</span>
+  <span class="k">case</span> <span class="sc">'('</span>:            <span class="k">return</span> <span class="n">ParseParenExpr</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="c1">/// binoprhs</span>
+<span class="c1">///   ::= ('+' primary)*</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseBinOpRHS</span><span class="p">(</span><span class="kt">int</span> <span class="n">ExprPrec</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">LHS</span><span class="p">)</span> <span class="p">{</span>
+  <span class="c1">// If this is a binop, find its precedence.</span>
+  <span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+    <span class="kt">int</span> <span class="n">TokPrec</span> <span class="o">=</span> <span class="n">GetTokPrecedence</span><span class="p">();</span>
+    
+    <span class="c1">// If this is a binop that binds at least as tightly as the current binop,</span>
+    <span class="c1">// consume it, otherwise we are done.</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">TokPrec</span> <span class="o"><</span> <span class="n">ExprPrec</span><span class="p">)</span>
+      <span class="k">return</span> <span class="n">LHS</span><span class="p">;</span>
+    
+    <span class="c1">// Okay, we know this is a binop.</span>
+    <span class="kt">int</span> <span class="n">BinOp</span> <span class="o">=</span> <span class="n">CurTok</span><span class="p">;</span>
+    <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat binop</span>
+    
+    <span class="c1">// Parse the primary expression after the binary operator.</span>
+    <span class="n">ExprAST</span> <span class="o">*</span><span class="n">RHS</span> <span class="o">=</span> <span class="n">ParsePrimary</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">RHS</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+    
+    <span class="c1">// If BinOp binds less tightly with RHS than the operator after RHS, let</span>
+    <span class="c1">// the pending operator take RHS as its LHS.</span>
+    <span class="kt">int</span> <span class="n">NextPrec</span> <span class="o">=</span> <span class="n">GetTokPrecedence</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">TokPrec</span> <span class="o"><</span> <span class="n">NextPrec</span><span class="p">)</span> <span class="p">{</span>
+      <span class="n">RHS</span> <span class="o">=</span> <span class="n">ParseBinOpRHS</span><span class="p">(</span><span class="n">TokPrec</span><span class="o">+</span><span class="mi">1</span><span class="p">,</span> <span class="n">RHS</span><span class="p">);</span>
+      <span class="k">if</span> <span class="p">(</span><span class="n">RHS</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="p">}</span>
+    
+    <span class="c1">// Merge LHS/RHS.</span>
+    <span class="n">LHS</span> <span class="o">=</span> <span class="k">new</span> <span class="n">BinaryExprAST</span><span class="p">(</span><span class="n">BinOp</span><span class="p">,</span> <span class="n">LHS</span><span class="p">,</span> <span class="n">RHS</span><span class="p">);</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="c1">/// expression</span>
+<span class="c1">///   ::= primary binoprhs</span>
+<span class="c1">///</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseExpression</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">LHS</span> <span class="o">=</span> <span class="n">ParsePrimary</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">LHS</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="k">return</span> <span class="n">ParseBinOpRHS</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">LHS</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="c1">/// prototype</span>
+<span class="c1">///   ::= id '(' id* ')'</span>
+<span class="k">static</span> <span class="n">PrototypeAST</span> <span class="o">*</span><span class="nf">ParsePrototype</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="n">tok_identifier</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected function name in prototype"</span><span class="p">);</span>
+
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">FnName</span> <span class="o">=</span> <span class="n">IdentifierStr</span><span class="p">;</span>
+  <span class="n">getNextToken</span><span class="p">();</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">'('</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected '(' in prototype"</span><span class="p">);</span>
+  
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="n">ArgNames</span><span class="p">;</span>
+  <span class="k">while</span> <span class="p">(</span><span class="n">getNextToken</span><span class="p">()</span> <span class="o">==</span> <span class="n">tok_identifier</span><span class="p">)</span>
+    <span class="n">ArgNames</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="n">IdentifierStr</span><span class="p">);</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">')'</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected ')' in prototype"</span><span class="p">);</span>
+  
+  <span class="c1">// success.</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat ')'.</span>
+  
+  <span class="k">return</span> <span class="k">new</span> <span class="n">PrototypeAST</span><span class="p">(</span><span class="n">FnName</span><span class="p">,</span> <span class="n">ArgNames</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="c1">/// definition ::= 'def' prototype expression</span>
+<span class="k">static</span> <span class="n">FunctionAST</span> <span class="o">*</span><span class="nf">ParseDefinition</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat def.</span>
+  <span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">Proto</span> <span class="o">=</span> <span class="n">ParsePrototype</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Proto</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">ExprAST</span> <span class="o">*</span><span class="n">E</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">())</span>
+    <span class="k">return</span> <span class="k">new</span> <span class="n">FunctionAST</span><span class="p">(</span><span class="n">Proto</span><span class="p">,</span> <span class="n">E</span><span class="p">);</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// toplevelexpr ::= expression</span>
+<span class="k">static</span> <span class="n">FunctionAST</span> <span class="o">*</span><span class="nf">ParseTopLevelExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">ExprAST</span> <span class="o">*</span><span class="n">E</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">())</span> <span class="p">{</span>
+    <span class="c1">// Make an anonymous proto.</span>
+    <span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">Proto</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PrototypeAST</span><span class="p">(</span><span class="s">""</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span><span class="p">());</span>
+    <span class="k">return</span> <span class="k">new</span> <span class="n">FunctionAST</span><span class="p">(</span><span class="n">Proto</span><span class="p">,</span> <span class="n">E</span><span class="p">);</span>
+  <span class="p">}</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// external ::= 'extern' prototype</span>
+<span class="k">static</span> <span class="n">PrototypeAST</span> <span class="o">*</span><span class="nf">ParseExtern</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat extern.</span>
+  <span class="k">return</span> <span class="n">ParsePrototype</span><span class="p">();</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Code Generation</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="k">static</span> <span class="n">Module</span> <span class="o">*</span><span class="n">TheModule</span><span class="p">;</span>
+<span class="k">static</span> <span class="n">IRBuilder</span><span class="o"><></span> <span class="n">Builder</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">());</span>
+<span class="k">static</span> <span class="n">std</span><span class="o">::</span><span class="n">map</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="p">,</span> <span class="n">Value</span><span class="o">*></span> <span class="n">NamedValues</span><span class="p">;</span>
+<span class="k">static</span> <span class="n">FunctionPassManager</span> <span class="o">*</span><span class="n">TheFPM</span><span class="p">;</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="nf">ErrorV</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">Error</span><span class="p">(</span><span class="n">Str</span><span class="p">);</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">NumberExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="n">ConstantFP</span><span class="o">::</span><span class="n">get</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="n">APFloat</span><span class="p">(</span><span class="n">Val</span><span class="p">));</span>
+<span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">VariableExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Look this variable up in the function.</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">V</span> <span class="o">=</span> <span class="n">NamedValues</span><span class="p">[</span><span class="n">Name</span><span class="p">];</span>
+  <span class="k">return</span> <span class="n">V</span> <span class="o">?</span> <span class="n">V</span> <span class="o">:</span> <span class="n">ErrorV</span><span class="p">(</span><span class="s">"Unknown variable name"</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">BinaryExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">L</span> <span class="o">=</span> <span class="n">LHS</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">R</span> <span class="o">=</span> <span class="n">RHS</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">L</span> <span class="o">==</span> <span class="mi">0</span> <span class="o">||</span> <span class="n">R</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="k">switch</span> <span class="p">(</span><span class="n">Op</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">case</span> <span class="sc">'+'</span>: <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFAdd</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"addtmp"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="sc">'-'</span>: <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFSub</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"subtmp"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="sc">'*'</span>: <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFMul</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"multmp"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="sc">'<'</span>:
+    <span class="n">L</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFCmpULT</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"cmptmp"</span><span class="p">);</span>
+    <span class="c1">// Convert bool 0/1 to double 0.0 or 1.0</span>
+    <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateUIToFP</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()),</span>
+                                <span class="s">"booltmp"</span><span class="p">);</span>
+  <span class="nl">default:</span> <span class="k">return</span> <span class="nf">ErrorV</span><span class="p">(</span><span class="s">"invalid binary operator"</span><span class="p">);</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">CallExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Look up the name in the global module table.</span>
+  <span class="n">Function</span> <span class="o">*</span><span class="n">CalleeF</span> <span class="o">=</span> <span class="n">TheModule</span><span class="o">-></span><span class="n">getFunction</span><span class="p">(</span><span class="n">Callee</span><span class="p">);</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CalleeF</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorV</span><span class="p">(</span><span class="s">"Unknown function referenced"</span><span class="p">);</span>
+  
+  <span class="c1">// If argument mismatch error.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CalleeF</span><span class="o">-></span><span class="n">arg_size</span><span class="p">()</span> <span class="o">!=</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">())</span>
+    <span class="k">return</span> <span class="n">ErrorV</span><span class="p">(</span><span class="s">"Incorrect # arguments passed"</span><span class="p">);</span>
+
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">Value</span><span class="o">*></span> <span class="n">ArgsV</span><span class="p">;</span>
+  <span class="k">for</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">e</span> <span class="o">=</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">();</span> <span class="n">i</span> <span class="o">!=</span> <span class="n">e</span><span class="p">;</span> <span class="o">++</span><span class="n">i</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">ArgsV</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="n">Args</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">-></span><span class="n">Codegen</span><span class="p">());</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">ArgsV</span><span class="p">.</span><span class="n">back</span><span class="p">()</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="p">}</span>
+  
+  <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateCall</span><span class="p">(</span><span class="n">CalleeF</span><span class="p">,</span> <span class="n">ArgsV</span><span class="p">,</span> <span class="s">"calltmp"</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="n">Function</span> <span class="o">*</span><span class="n">PrototypeAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Make the function type:  double(double,double) etc.</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">Type</span><span class="o">*></span> <span class="n">Doubles</span><span class="p">(</span><span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">(),</span>
+                             <span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()));</span>
+  <span class="n">FunctionType</span> <span class="o">*</span><span class="n">FT</span> <span class="o">=</span> <span class="n">FunctionType</span><span class="o">::</span><span class="n">get</span><span class="p">(</span><span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()),</span>
+                                       <span class="n">Doubles</span><span class="p">,</span> <span class="nb">false</span><span class="p">);</span>
+  
+  <span class="n">Function</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">Function</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">FT</span><span class="p">,</span> <span class="n">Function</span><span class="o">::</span><span class="n">ExternalLinkage</span><span class="p">,</span> <span class="n">Name</span><span class="p">,</span> <span class="n">TheModule</span><span class="p">);</span>
+  
+  <span class="c1">// If F conflicted, there was already something named 'Name'.  If it has a</span>
+  <span class="c1">// body, don't allow redefinition or reextern.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">F</span><span class="o">-></span><span class="n">getName</span><span class="p">()</span> <span class="o">!=</span> <span class="n">Name</span><span class="p">)</span> <span class="p">{</span>
+    <span class="c1">// Delete the one we just made and get the existing one.</span>
+    <span class="n">F</span><span class="o">-></span><span class="n">eraseFromParent</span><span class="p">();</span>
+    <span class="n">F</span> <span class="o">=</span> <span class="n">TheModule</span><span class="o">-></span><span class="n">getFunction</span><span class="p">(</span><span class="n">Name</span><span class="p">);</span>
+    
+    <span class="c1">// If F already has a body, reject this.</span>
+    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">F</span><span class="o">-></span><span class="n">empty</span><span class="p">())</span> <span class="p">{</span>
+      <span class="n">ErrorF</span><span class="p">(</span><span class="s">"redefinition of function"</span><span class="p">);</span>
+      <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="p">}</span>
+    
+    <span class="c1">// If F took a different number of args, reject.</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">F</span><span class="o">-></span><span class="n">arg_size</span><span class="p">()</span> <span class="o">!=</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">())</span> <span class="p">{</span>
+      <span class="n">ErrorF</span><span class="p">(</span><span class="s">"redefinition of function with different # args"</span><span class="p">);</span>
+      <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="p">}</span>
+  <span class="p">}</span>
+  
+  <span class="c1">// Set names for all arguments.</span>
+  <span class="kt">unsigned</span> <span class="n">Idx</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="k">for</span> <span class="p">(</span><span class="n">Function</span><span class="o">::</span><span class="n">arg_iterator</span> <span class="n">AI</span> <span class="o">=</span> <span class="n">F</span><span class="o">-></span><span class="n">arg_begin</span><span class="p">();</span> <span class="n">Idx</span> <span class="o">!=</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">();</span>
+       <span class="o">++</span><span class="n">AI</span><span class="p">,</span> <span class="o">++</span><span class="n">Idx</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">AI</span><span class="o">-></span><span class="n">setName</span><span class="p">(</span><span class="n">Args</span><span class="p">[</span><span class="n">Idx</span><span class="p">]);</span>
+    
+    <span class="c1">// Add arguments to variable symbol table.</span>
+    <span class="n">NamedValues</span><span class="p">[</span><span class="n">Args</span><span class="p">[</span><span class="n">Idx</span><span class="p">]]</span> <span class="o">=</span> <span class="n">AI</span><span class="p">;</span>
+  <span class="p">}</span>
+  
+  <span class="k">return</span> <span class="n">F</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="n">Function</span> <span class="o">*</span><span class="n">FunctionAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">NamedValues</span><span class="p">.</span><span class="n">clear</span><span class="p">();</span>
+  
+  <span class="n">Function</span> <span class="o">*</span><span class="n">TheFunction</span> <span class="o">=</span> <span class="n">Proto</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">TheFunction</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
+    <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="c1">// Create a new basic block to start insertion into.</span>
+  <span class="n">BasicBlock</span> <span class="o">*</span><span class="n">BB</span> <span class="o">=</span> <span class="n">BasicBlock</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="s">"entry"</span><span class="p">,</span> <span class="n">TheFunction</span><span class="p">);</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">SetInsertPoint</span><span class="p">(</span><span class="n">BB</span><span class="p">);</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">Value</span> <span class="o">*</span><span class="n">RetVal</span> <span class="o">=</span> <span class="n">Body</span><span class="o">-></span><span class="n">Codegen</span><span class="p">())</span> <span class="p">{</span>
+    <span class="c1">// Finish off the function.</span>
+    <span class="n">Builder</span><span class="p">.</span><span class="n">CreateRet</span><span class="p">(</span><span class="n">RetVal</span><span class="p">);</span>
+
+    <span class="c1">// Validate the generated code, checking for consistency.</span>
+    <span class="n">verifyFunction</span><span class="p">(</span><span class="o">*</span><span class="n">TheFunction</span><span class="p">);</span>
+
+    <span class="c1">// Optimize the function.</span>
+    <span class="n">TheFPM</span><span class="o">-></span><span class="n">run</span><span class="p">(</span><span class="o">*</span><span class="n">TheFunction</span><span class="p">);</span>
+    
+    <span class="k">return</span> <span class="n">TheFunction</span><span class="p">;</span>
+  <span class="p">}</span>
+  
+  <span class="c1">// Error reading body, remove function.</span>
+  <span class="n">TheFunction</span><span class="o">-></span><span class="n">eraseFromParent</span><span class="p">();</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Top-Level parsing and JIT Driver</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="k">static</span> <span class="n">ExecutionEngine</span> <span class="o">*</span><span class="n">TheExecutionEngine</span><span class="p">;</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">HandleDefinition</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">FunctionAST</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">ParseDefinition</span><span class="p">())</span> <span class="p">{</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">Function</span> <span class="o">*</span><span class="n">LF</span> <span class="o">=</span> <span class="n">F</span><span class="o">-></span><span class="n">Codegen</span><span class="p">())</span> <span class="p">{</span>
+      <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Read function definition:"</span><span class="p">);</span>
+      <span class="n">LF</span><span class="o">-></span><span class="n">dump</span><span class="p">();</span>
+    <span class="p">}</span>
+  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+    <span class="c1">// Skip token for error recovery.</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">HandleExtern</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">P</span> <span class="o">=</span> <span class="n">ParseExtern</span><span class="p">())</span> <span class="p">{</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">Function</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">P</span><span class="o">-></span><span class="n">Codegen</span><span class="p">())</span> <span class="p">{</span>
+      <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Read extern: "</span><span class="p">);</span>
+      <span class="n">F</span><span class="o">-></span><span class="n">dump</span><span class="p">();</span>
+    <span class="p">}</span>
+  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+    <span class="c1">// Skip token for error recovery.</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">HandleTopLevelExpression</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Evaluate a top-level expression into an anonymous function.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">FunctionAST</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">ParseTopLevelExpr</span><span class="p">())</span> <span class="p">{</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">Function</span> <span class="o">*</span><span class="n">LF</span> <span class="o">=</span> <span class="n">F</span><span class="o">-></span><span class="n">Codegen</span><span class="p">())</span> <span class="p">{</span>
+      <span class="c1">// JIT the function, returning a function pointer.</span>
+      <span class="kt">void</span> <span class="o">*</span><span class="n">FPtr</span> <span class="o">=</span> <span class="n">TheExecutionEngine</span><span class="o">-></span><span class="n">getPointerToFunction</span><span class="p">(</span><span class="n">LF</span><span class="p">);</span>
+      
+      <span class="c1">// Cast it to the right type (takes no arguments, returns a double) so we</span>
+      <span class="c1">// can call it as a native function.</span>
+      <span class="kt">double</span> <span class="p">(</span><span class="o">*</span><span class="n">FP</span><span class="p">)()</span> <span class="o">=</span> <span class="p">(</span><span class="kt">double</span> <span class="p">(</span><span class="o">*</span><span class="p">)())(</span><span class="kt">intptr_t</span><span class="p">)</span><span class="n">FPtr</span><span class="p">;</span>
+      <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Evaluated to %f</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">FP</span><span class="p">());</span>
+    <span class="p">}</span>
+  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+    <span class="c1">// Skip token for error recovery.</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="c1">/// top ::= definition | external | expression | ';'</span>
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">MainLoop</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"ready> "</span><span class="p">);</span>
+    <span class="k">switch</span> <span class="p">(</span><span class="n">CurTok</span><span class="p">)</span> <span class="p">{</span>
+    <span class="k">case</span> <span class="n">tok_eof</span>:    <span class="k">return</span><span class="p">;</span>
+    <span class="k">case</span> <span class="sc">';'</span>:        <span class="n">getNextToken</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>  <span class="c1">// ignore top-level semicolons.</span>
+    <span class="k">case</span> <span class="n">tok_def</span>:    <span class="n">HandleDefinition</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>
+    <span class="k">case</span> <span class="n">tok_extern</span>: <span class="n">HandleExtern</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>
+    <span class="nl">default:</span>         <span class="n">HandleTopLevelExpression</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>
+    <span class="p">}</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// "Library" functions that can be "extern'd" from user code.</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="c1">/// putchard - putchar that takes a double and returns 0.</span>
+<span class="k">extern</span> <span class="s">"C"</span> 
+<span class="kt">double</span> <span class="n">putchard</span><span class="p">(</span><span class="kt">double</span> <span class="n">X</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">putchar</span><span class="p">((</span><span class="kt">char</span><span class="p">)</span><span class="n">X</span><span class="p">);</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Main driver code.</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="kt">int</span> <span class="n">main</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">InitializeNativeTarget</span><span class="p">();</span>
+  <span class="n">LLVMContext</span> <span class="o">&</span><span class="n">Context</span> <span class="o">=</span> <span class="n">getGlobalContext</span><span class="p">();</span>
+
+  <span class="c1">// Install standard binary operators.</span>
+  <span class="c1">// 1 is lowest precedence.</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'<'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">10</span><span class="p">;</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'+'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">20</span><span class="p">;</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'-'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">20</span><span class="p">;</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'*'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">40</span><span class="p">;</span>  <span class="c1">// highest.</span>
+
+  <span class="c1">// Prime the first token.</span>
+  <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"ready> "</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>
+
+  <span class="c1">// Make the module, which holds all the code.</span>
+  <span class="n">TheModule</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Module</span><span class="p">(</span><span class="s">"my cool jit"</span><span class="p">,</span> <span class="n">Context</span><span class="p">);</span>
+
+  <span class="c1">// Create the JIT.  This takes ownership of the module.</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">ErrStr</span><span class="p">;</span>
+  <span class="n">TheExecutionEngine</span> <span class="o">=</span> <span class="n">EngineBuilder</span><span class="p">(</span><span class="n">TheModule</span><span class="p">).</span><span class="n">setErrorStr</span><span class="p">(</span><span class="o">&</span><span class="n">ErrStr</span><span class="p">).</span><span class="n">create</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">TheExecutionEngine</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Could not create ExecutionEngine: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">ErrStr</span><span class="p">.</span><span class="n">c_str</span><span class="p">());</span>
+    <span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>
+  <span class="p">}</span>
+
+  <span class="n">FunctionPassManager</span> <span class="n">OurFPM</span><span class="p">(</span><span class="n">TheModule</span><span class="p">);</span>
+
+  <span class="c1">// Set up the optimizer pipeline.  Start with registering info about how the</span>
+  <span class="c1">// target lays out data structures.</span>
+  <span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="k">new</span> <span class="n">DataLayout</span><span class="p">(</span><span class="o">*</span><span class="n">TheExecutionEngine</span><span class="o">-></span><span class="n">getDataLayout</span><span class="p">()));</span>
+  <span class="c1">// Provide basic AliasAnalysis support for GVN.</span>
+  <span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createBasicAliasAnalysisPass</span><span class="p">());</span>
+  <span class="c1">// Do simple "peephole" optimizations and bit-twiddling optzns.</span>
+  <span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createInstructionCombiningPass</span><span class="p">());</span>
+  <span class="c1">// Reassociate expressions.</span>
+  <span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createReassociatePass</span><span class="p">());</span>
+  <span class="c1">// Eliminate Common SubExpressions.</span>
+  <span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createGVNPass</span><span class="p">());</span>
+  <span class="c1">// Simplify the control flow graph (deleting unreachable blocks, etc).</span>
+  <span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createCFGSimplificationPass</span><span class="p">());</span>
+
+  <span class="n">OurFPM</span><span class="p">.</span><span class="n">doInitialization</span><span class="p">();</span>
+
+  <span class="c1">// Set the global so the code gen can use this.</span>
+  <span class="n">TheFPM</span> <span class="o">=</span> <span class="o">&</span><span class="n">OurFPM</span><span class="p">;</span>
+
+  <span class="c1">// Run the main "interpreter loop" now.</span>
+  <span class="n">MainLoop</span><span class="p">();</span>
+
+  <span class="n">TheFPM</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="c1">// Print out all of the generated code.</span>
+  <span class="n">TheModule</span><span class="o">-></span><span class="n">dump</span><span class="p">();</span>
+
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p><a class="reference external" href="LangImpl5.html">Next: Extending the language: control flow</a></p>
+</div>
+</div>
+
+
+          </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="LangImpl5.html" title="5. Kaleidoscope: Extending the Language: Control Flow"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="LangImpl3.html" title="3. Kaleidoscope: Code generation to LLVM IR"
+             >previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="../index.html">Documentation</a>»</li>
+
+          <li><a href="index.html" >LLVM Tutorial: Table of Contents</a> »</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        © Copyright 2003-2013, LLVM Project.
+      Last updated on 2014-06-16.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.4.2/docs/tutorial/LangImpl5.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.4.2/docs/tutorial/LangImpl5.html?rev=211020&view=auto
==============================================================================
--- www-releases/trunk/3.4.2/docs/tutorial/LangImpl5.html (added)
+++ www-releases/trunk/3.4.2/docs/tutorial/LangImpl5.html Mon Jun 16 08:19:07 2014
@@ -0,0 +1,1637 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>5. Kaleidoscope: Extending the Language: Control Flow — LLVM 3.4 documentation</title>
+    
+    <link rel="stylesheet" href="../_static/llvm-theme.css" type="text/css" />
+    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../',
+        VERSION:     '3.4',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../_static/jquery.js"></script>
+    <script type="text/javascript" src="../_static/underscore.js"></script>
+    <script type="text/javascript" src="../_static/doctools.js"></script>
+    <link rel="top" title="LLVM 3.4 documentation" href="../index.html" />
+    <link rel="up" title="LLVM Tutorial: Table of Contents" href="index.html" />
+    <link rel="next" title="6. Kaleidoscope: Extending the Language: User-defined Operators" href="LangImpl6.html" />
+    <link rel="prev" title="4. Kaleidoscope: Adding JIT and Optimizer Support" href="LangImpl4.html" />
+<style type="text/css">
+  table.right { float: right; margin-left: 20px; }
+  table.right td { border: 1px solid #ccc; }
+</style>
+
+  </head>
+  <body>
+<div class="logo">
+  <a href="../index.html">
+    <img src="../_static/logo.png"
+         alt="LLVM Logo" width="250" height="88"/></a>
+</div>
+
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="LangImpl6.html" title="6. Kaleidoscope: Extending the Language: User-defined Operators"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="LangImpl4.html" title="4. Kaleidoscope: Adding JIT and Optimizer Support"
+             accesskey="P">previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="../index.html">Documentation</a>»</li>
+
+          <li><a href="index.html" accesskey="U">LLVM Tutorial: Table of Contents</a> »</li> 
+      </ul>
+    </div>
+
+
+    <div class="document">
+      <div class="documentwrapper">
+          <div class="body">
+            
+  <div class="section" id="kaleidoscope-extending-the-language-control-flow">
+<h1>5. Kaleidoscope: Extending the Language: Control Flow<a class="headerlink" href="#kaleidoscope-extending-the-language-control-flow" title="Permalink to this headline">¶</a></h1>
+<div class="contents local topic" id="contents">
+<ul class="simple">
+<li><a class="reference internal" href="#chapter-5-introduction" id="id1">Chapter 5 Introduction</a></li>
+<li><a class="reference internal" href="#if-then-else" id="id2">If/Then/Else</a><ul>
+<li><a class="reference internal" href="#lexer-extensions-for-if-then-else" id="id3">Lexer Extensions for If/Then/Else</a></li>
+<li><a class="reference internal" href="#ast-extensions-for-if-then-else" id="id4">AST Extensions for If/Then/Else</a></li>
+<li><a class="reference internal" href="#parser-extensions-for-if-then-else" id="id5">Parser Extensions for If/Then/Else</a></li>
+<li><a class="reference internal" href="#llvm-ir-for-if-then-else" id="id6">LLVM IR for If/Then/Else</a></li>
+<li><a class="reference internal" href="#code-generation-for-if-then-else" id="id7">Code Generation for If/Then/Else</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#for-loop-expression" id="id8">‘for’ Loop Expression</a><ul>
+<li><a class="reference internal" href="#lexer-extensions-for-the-for-loop" id="id9">Lexer Extensions for the ‘for’ Loop</a></li>
+<li><a class="reference internal" href="#ast-extensions-for-the-for-loop" id="id10">AST Extensions for the ‘for’ Loop</a></li>
+<li><a class="reference internal" href="#parser-extensions-for-the-for-loop" id="id11">Parser Extensions for the ‘for’ Loop</a></li>
+<li><a class="reference internal" href="#llvm-ir-for-the-for-loop" id="id12">LLVM IR for the ‘for’ Loop</a></li>
+<li><a class="reference internal" href="#code-generation-for-the-for-loop" id="id13">Code Generation for the ‘for’ Loop</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#full-code-listing" id="id14">Full Code Listing</a></li>
+</ul>
+</div>
+<div class="section" id="chapter-5-introduction">
+<h2><a class="toc-backref" href="#id1">5.1. Chapter 5 Introduction</a><a class="headerlink" href="#chapter-5-introduction" title="Permalink to this headline">¶</a></h2>
+<p>Welcome to Chapter 5 of the “<a class="reference external" href="index.html">Implementing a language with
+LLVM</a>” tutorial. Parts 1-4 described the implementation of
+the simple Kaleidoscope language and included support for generating
+LLVM IR, followed by optimizations and a JIT compiler. Unfortunately, as
+presented, Kaleidoscope is mostly useless: it has no control flow other
+than call and return. This means that you can’t have conditional
+branches in the code, significantly limiting its power. In this episode
+of “build that compiler”, we’ll extend Kaleidoscope to have an
+if/then/else expression plus a simple ‘for’ loop.</p>
+</div>
+<div class="section" id="if-then-else">
+<h2><a class="toc-backref" href="#id2">5.2. If/Then/Else</a><a class="headerlink" href="#if-then-else" title="Permalink to this headline">¶</a></h2>
+<p>Extending Kaleidoscope to support if/then/else is quite straightforward.
+It basically requires adding support for this “new” concept to the
+lexer, parser, AST, and LLVM code emitter. This example is nice, because
+it shows how easy it is to “grow” a language over time, incrementally
+extending it as new ideas are discovered.</p>
+<p>Before we get going on “how” we add this extension, lets talk about
+“what” we want. The basic idea is that we want to be able to write this
+sort of thing:</p>
+<div class="highlight-python"><pre>def fib(x)
+  if x < 3 then
+    1
+  else
+    fib(x-1)+fib(x-2);</pre>
+</div>
+<p>In Kaleidoscope, every construct is an expression: there are no
+statements. As such, the if/then/else expression needs to return a value
+like any other. Since we’re using a mostly functional form, we’ll have
+it evaluate its conditional, then return the ‘then’ or ‘else’ value
+based on how the condition was resolved. This is very similar to the C
+”?:” expression.</p>
+<p>The semantics of the if/then/else expression is that it evaluates the
+condition to a boolean equality value: 0.0 is considered to be false and
+everything else is considered to be true. If the condition is true, the
+first subexpression is evaluated and returned, if the condition is
+false, the second subexpression is evaluated and returned. Since
+Kaleidoscope allows side-effects, this behavior is important to nail
+down.</p>
+<p>Now that we know what we “want”, lets break this down into its
+constituent pieces.</p>
+<div class="section" id="lexer-extensions-for-if-then-else">
+<h3><a class="toc-backref" href="#id3">5.2.1. Lexer Extensions for If/Then/Else</a><a class="headerlink" href="#lexer-extensions-for-if-then-else" title="Permalink to this headline">¶</a></h3>
+<p>The lexer extensions are straightforward. First we add new enum values
+for the relevant tokens:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// control</span>
+<span class="n">tok_if</span> <span class="o">=</span> <span class="o">-</span><span class="mi">6</span><span class="p">,</span> <span class="n">tok_then</span> <span class="o">=</span> <span class="o">-</span><span class="mi">7</span><span class="p">,</span> <span class="n">tok_else</span> <span class="o">=</span> <span class="o">-</span><span class="mi">8</span><span class="p">,</span>
+</pre></div>
+</div>
+<p>Once we have that, we recognize the new keywords in the lexer. This is
+pretty simple stuff:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="p">...</span>
+<span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"def"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_def</span><span class="p">;</span>
+<span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"extern"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_extern</span><span class="p">;</span>
+<span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"if"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_if</span><span class="p">;</span>
+<span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"then"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_then</span><span class="p">;</span>
+<span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"else"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_else</span><span class="p">;</span>
+<span class="k">return</span> <span class="n">tok_identifier</span><span class="p">;</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="ast-extensions-for-if-then-else">
+<h3><a class="toc-backref" href="#id4">5.2.2. AST Extensions for If/Then/Else</a><a class="headerlink" href="#ast-extensions-for-if-then-else" title="Permalink to this headline">¶</a></h3>
+<p>To represent the new expression we add a new AST node for it:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// IfExprAST - Expression class for if/then/else.</span>
+<span class="k">class</span> <span class="nc">IfExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Cond</span><span class="p">,</span> <span class="o">*</span><span class="n">Then</span><span class="p">,</span> <span class="o">*</span><span class="n">Else</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">IfExprAST</span><span class="p">(</span><span class="n">ExprAST</span> <span class="o">*</span><span class="n">cond</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">then</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">_else</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">Cond</span><span class="p">(</span><span class="n">cond</span><span class="p">),</span> <span class="n">Then</span><span class="p">(</span><span class="n">then</span><span class="p">),</span> <span class="n">Else</span><span class="p">(</span><span class="n">_else</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+</pre></div>
+</div>
+<p>The AST node just has pointers to the various subexpressions.</p>
+</div>
+<div class="section" id="parser-extensions-for-if-then-else">
+<h3><a class="toc-backref" href="#id5">5.2.3. Parser Extensions for If/Then/Else</a><a class="headerlink" href="#parser-extensions-for-if-then-else" title="Permalink to this headline">¶</a></h3>
+<p>Now that we have the relevant tokens coming from the lexer and we have
+the AST node to build, our parsing logic is relatively straightforward.
+First we define a new parsing function:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// ifexpr ::= 'if' expression 'then' expression 'else' expression</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseIfExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat the if.</span>
+
+  <span class="c1">// condition.</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Cond</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">Cond</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="n">tok_then</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected then"</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat the then</span>
+
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Then</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Then</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="n">tok_else</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected else"</span><span class="p">);</span>
+
+  <span class="n">getNextToken</span><span class="p">();</span>
+
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Else</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">Else</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="k">return</span> <span class="k">new</span> <span class="n">IfExprAST</span><span class="p">(</span><span class="n">Cond</span><span class="p">,</span> <span class="n">Then</span><span class="p">,</span> <span class="n">Else</span><span class="p">);</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Next we hook it up as a primary expression:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParsePrimary</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">switch</span> <span class="p">(</span><span class="n">CurTok</span><span class="p">)</span> <span class="p">{</span>
+  <span class="nl">default:</span> <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"unknown token when expecting an expression"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="n">tok_identifier</span>: <span class="k">return</span> <span class="n">ParseIdentifierExpr</span><span class="p">();</span>
+  <span class="k">case</span> <span class="n">tok_number</span>:     <span class="k">return</span> <span class="n">ParseNumberExpr</span><span class="p">();</span>
+  <span class="k">case</span> <span class="sc">'('</span>:            <span class="k">return</span> <span class="n">ParseParenExpr</span><span class="p">();</span>
+  <span class="k">case</span> <span class="n">tok_if</span>:         <span class="k">return</span> <span class="n">ParseIfExpr</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="llvm-ir-for-if-then-else">
+<h3><a class="toc-backref" href="#id6">5.2.4. LLVM IR for If/Then/Else</a><a class="headerlink" href="#llvm-ir-for-if-then-else" title="Permalink to this headline">¶</a></h3>
+<p>Now that we have it parsing and building the AST, the final piece is
+adding LLVM code generation support. This is the most interesting part
+of the if/then/else example, because this is where it starts to
+introduce new concepts. All of the code above has been thoroughly
+described in previous chapters.</p>
+<p>To motivate the code we want to produce, lets take a look at a simple
+example. Consider:</p>
+<div class="highlight-python"><pre>extern foo();
+extern bar();
+def baz(x) if x then foo() else bar();</pre>
+</div>
+<p>If you disable optimizations, the code you’ll (soon) get from
+Kaleidoscope looks like this:</p>
+<div class="highlight-llvm"><div class="highlight"><pre><span class="k">declare</span> <span class="kt">double</span> <span class="vg">@foo</span><span class="p">()</span>
+
+<span class="k">declare</span> <span class="kt">double</span> <span class="vg">@bar</span><span class="p">()</span>
+
+<span class="k">define</span> <span class="kt">double</span> <span class="vg">@baz</span><span class="p">(</span><span class="kt">double</span> <span class="nv">%x</span><span class="p">)</span> <span class="p">{</span>
+<span class="nl">entry:</span>
+  <span class="nv">%ifcond</span> <span class="p">=</span> <span class="k">fcmp</span> <span class="k">one</span> <span class="kt">double</span> <span class="nv">%x</span><span class="p">,</span> <span class="m">0.000000e+00</span>
+  <span class="k">br</span> <span class="k">i1</span> <span class="nv">%ifcond</span><span class="p">,</span> <span class="kt">label</span> <span class="nv">%then</span><span class="p">,</span> <span class="kt">label</span> <span class="nv">%else</span>
+
+<span class="nl">then:</span>       <span class="c">; preds = %entry</span>
+  <span class="nv">%calltmp</span> <span class="p">=</span> <span class="k">call</span> <span class="kt">double</span> <span class="vg">@foo</span><span class="p">()</span>
+  <span class="k">br</span> <span class="kt">label</span> <span class="nv">%ifcont</span>
+
+<span class="nl">else:</span>       <span class="c">; preds = %entry</span>
+  <span class="nv">%calltmp1</span> <span class="p">=</span> <span class="k">call</span> <span class="kt">double</span> <span class="vg">@bar</span><span class="p">()</span>
+  <span class="k">br</span> <span class="kt">label</span> <span class="nv">%ifcont</span>
+
+<span class="nl">ifcont:</span>     <span class="c">; preds = %else, %then</span>
+  <span class="nv">%iftmp</span> <span class="p">=</span> <span class="k">phi</span> <span class="kt">double</span> <span class="p">[</span> <span class="nv">%calltmp</span><span class="p">,</span> <span class="nv">%then</span> <span class="p">],</span> <span class="p">[</span> <span class="nv">%calltmp1</span><span class="p">,</span> <span class="nv">%else</span> <span class="p">]</span>
+  <span class="k">ret</span> <span class="kt">double</span> <span class="nv">%iftmp</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>To visualize the control flow graph, you can use a nifty feature of the
+LLVM ‘<a class="reference external" href="http://llvm.org/cmds/opt.html">opt</a>‘ tool. If you put this LLVM
+IR into “t.ll” and run “<tt class="docutils literal"><span class="pre">llvm-as</span> <span class="pre"><</span> <span class="pre">t.ll</span> <span class="pre">|</span> <span class="pre">opt</span> <span class="pre">-analyze</span> <span class="pre">-view-cfg</span></tt>”, <a class="reference external" href="../ProgrammersManual.html#ViewGraph">a
+window will pop up</a> and you’ll
+see this graph:</p>
+<div class="figure align-center">
+<img alt="Example CFG" src="../_images/LangImpl5-cfg.png" />
+<p class="caption">Example CFG</p>
+</div>
+<p>Another way to get this is to call “<tt class="docutils literal"><span class="pre">F->viewCFG()</span></tt>” or
+“<tt class="docutils literal"><span class="pre">F->viewCFGOnly()</span></tt>” (where F is a “<tt class="docutils literal"><span class="pre">Function*</span></tt>”) either by
+inserting actual calls into the code and recompiling or by calling these
+in the debugger. LLVM has many nice features for visualizing various
+graphs.</p>
+<p>Getting back to the generated code, it is fairly simple: the entry block
+evaluates the conditional expression (“x” in our case here) and compares
+the result to 0.0 with the “<tt class="docutils literal"><span class="pre">fcmp</span> <span class="pre">one</span></tt>” instruction (‘one’ is “Ordered
+and Not Equal”). Based on the result of this expression, the code jumps
+to either the “then” or “else” blocks, which contain the expressions for
+the true/false cases.</p>
+<p>Once the then/else blocks are finished executing, they both branch back
+to the ‘ifcont’ block to execute the code that happens after the
+if/then/else. In this case the only thing left to do is to return to the
+caller of the function. The question then becomes: how does the code
+know which expression to return?</p>
+<p>The answer to this question involves an important SSA operation: the
+<a class="reference external" href="http://en.wikipedia.org/wiki/Static_single_assignment_form">Phi
+operation</a>.
+If you’re not familiar with SSA, <a class="reference external" href="http://en.wikipedia.org/wiki/Static_single_assignment_form">the wikipedia
+article</a>
+is a good introduction and there are various other introductions to it
+available on your favorite search engine. The short version is that
+“execution” of the Phi operation requires “remembering” which block
+control came from. The Phi operation takes on the value corresponding to
+the input control block. In this case, if control comes in from the
+“then” block, it gets the value of “calltmp”. If control comes from the
+“else” block, it gets the value of “calltmp1”.</p>
+<p>At this point, you are probably starting to think “Oh no! This means my
+simple and elegant front-end will have to start generating SSA form in
+order to use LLVM!”. Fortunately, this is not the case, and we strongly
+advise <em>not</em> implementing an SSA construction algorithm in your
+front-end unless there is an amazingly good reason to do so. In
+practice, there are two sorts of values that float around in code
+written for your average imperative programming language that might need
+Phi nodes:</p>
+<ol class="arabic simple">
+<li>Code that involves user variables: <tt class="docutils literal"><span class="pre">x</span> <span class="pre">=</span> <span class="pre">1;</span> <span class="pre">x</span> <span class="pre">=</span> <span class="pre">x</span> <span class="pre">+</span> <span class="pre">1;</span></tt></li>
+<li>Values that are implicit in the structure of your AST, such as the
+Phi node in this case.</li>
+</ol>
+<p>In <a class="reference external" href="LangImpl7.html">Chapter 7</a> of this tutorial (“mutable variables”),
+we’ll talk about #1 in depth. For now, just believe me that you don’t
+need SSA construction to handle this case. For #2, you have the choice
+of using the techniques that we will describe for #1, or you can insert
+Phi nodes directly, if convenient. In this case, it is really really
+easy to generate the Phi node, so we choose to do it directly.</p>
+<p>Okay, enough of the motivation and overview, lets generate code!</p>
+</div>
+<div class="section" id="code-generation-for-if-then-else">
+<h3><a class="toc-backref" href="#id7">5.2.5. Code Generation for If/Then/Else</a><a class="headerlink" href="#code-generation-for-if-then-else" title="Permalink to this headline">¶</a></h3>
+<p>In order to generate code for this, we implement the <tt class="docutils literal"><span class="pre">Codegen</span></tt> method
+for <tt class="docutils literal"><span class="pre">IfExprAST</span></tt>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">Value</span> <span class="o">*</span><span class="n">IfExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">CondV</span> <span class="o">=</span> <span class="n">Cond</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CondV</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="c1">// Convert condition to a bool by comparing equal to 0.0.</span>
+  <span class="n">CondV</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFCmpONE</span><span class="p">(</span><span class="n">CondV</span><span class="p">,</span>
+                              <span class="n">ConstantFP</span><span class="o">::</span><span class="n">get</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="n">APFloat</span><span class="p">(</span><span class="mf">0.0</span><span class="p">)),</span>
+                                <span class="s">"ifcond"</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>This code is straightforward and similar to what we saw before. We emit
+the expression for the condition, then compare that value to zero to get
+a truth value as a 1-bit (bool) value.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">Function</span> <span class="o">*</span><span class="n">TheFunction</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">GetInsertBlock</span><span class="p">()</span><span class="o">-></span><span class="n">getParent</span><span class="p">();</span>
+
+<span class="c1">// Create blocks for the then and else cases.  Insert the 'then' block at the</span>
+<span class="c1">// end of the function.</span>
+<span class="n">BasicBlock</span> <span class="o">*</span><span class="n">ThenBB</span> <span class="o">=</span> <span class="n">BasicBlock</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="s">"then"</span><span class="p">,</span> <span class="n">TheFunction</span><span class="p">);</span>
+<span class="n">BasicBlock</span> <span class="o">*</span><span class="n">ElseBB</span> <span class="o">=</span> <span class="n">BasicBlock</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="s">"else"</span><span class="p">);</span>
+<span class="n">BasicBlock</span> <span class="o">*</span><span class="n">MergeBB</span> <span class="o">=</span> <span class="n">BasicBlock</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="s">"ifcont"</span><span class="p">);</span>
+
+<span class="n">Builder</span><span class="p">.</span><span class="n">CreateCondBr</span><span class="p">(</span><span class="n">CondV</span><span class="p">,</span> <span class="n">ThenBB</span><span class="p">,</span> <span class="n">ElseBB</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>This code creates the basic blocks that are related to the if/then/else
+statement, and correspond directly to the blocks in the example above.
+The first line gets the current Function object that is being built. It
+gets this by asking the builder for the current BasicBlock, and asking
+that block for its “parent” (the function it is currently embedded
+into).</p>
+<p>Once it has that, it creates three blocks. Note that it passes
+“TheFunction” into the constructor for the “then” block. This causes the
+constructor to automatically insert the new block into the end of the
+specified function. The other two blocks are created, but aren’t yet
+inserted into the function.</p>
+<p>Once the blocks are created, we can emit the conditional branch that
+chooses between them. Note that creating new blocks does not implicitly
+affect the IRBuilder, so it is still inserting into the block that the
+condition went into. Also note that it is creating a branch to the
+“then” block and the “else” block, even though the “else” block isn’t
+inserted into the function yet. This is all ok: it is the standard way
+that LLVM supports forward references.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// Emit then value.</span>
+<span class="n">Builder</span><span class="p">.</span><span class="n">SetInsertPoint</span><span class="p">(</span><span class="n">ThenBB</span><span class="p">);</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">ThenV</span> <span class="o">=</span> <span class="n">Then</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+<span class="k">if</span> <span class="p">(</span><span class="n">ThenV</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+<span class="n">Builder</span><span class="p">.</span><span class="n">CreateBr</span><span class="p">(</span><span class="n">MergeBB</span><span class="p">);</span>
+<span class="c1">// Codegen of 'Then' can change the current block, update ThenBB for the PHI.</span>
+<span class="n">ThenBB</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">GetInsertBlock</span><span class="p">();</span>
+</pre></div>
+</div>
+<p>After the conditional branch is inserted, we move the builder to start
+inserting into the “then” block. Strictly speaking, this call moves the
+insertion point to be at the end of the specified block. However, since
+the “then” block is empty, it also starts out by inserting at the
+beginning of the block. :)</p>
+<p>Once the insertion point is set, we recursively codegen the “then”
+expression from the AST. To finish off the “then” block, we create an
+unconditional branch to the merge block. One interesting (and very
+important) aspect of the LLVM IR is that it <a class="reference external" href="../LangRef.html#functionstructure">requires all basic blocks
+to be “terminated”</a> with a <a class="reference external" href="../LangRef.html#terminators">control
+flow instruction</a> such as return or
+branch. This means that all control flow, <em>including fall throughs</em> must
+be made explicit in the LLVM IR. If you violate this rule, the verifier
+will emit an error.</p>
+<p>The final line here is quite subtle, but is very important. The basic
+issue is that when we create the Phi node in the merge block, we need to
+set up the block/value pairs that indicate how the Phi will work.
+Importantly, the Phi node expects to have an entry for each predecessor
+of the block in the CFG. Why then, are we getting the current block when
+we just set it to ThenBB 5 lines above? The problem is that the “Then”
+expression may actually itself change the block that the Builder is
+emitting into if, for example, it contains a nested “if/then/else”
+expression. Because calling Codegen recursively could arbitrarily change
+the notion of the current block, we are required to get an up-to-date
+value for code that will set up the Phi node.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// Emit else block.</span>
+<span class="n">TheFunction</span><span class="o">-></span><span class="n">getBasicBlockList</span><span class="p">().</span><span class="n">push_back</span><span class="p">(</span><span class="n">ElseBB</span><span class="p">);</span>
+<span class="n">Builder</span><span class="p">.</span><span class="n">SetInsertPoint</span><span class="p">(</span><span class="n">ElseBB</span><span class="p">);</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">ElseV</span> <span class="o">=</span> <span class="n">Else</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+<span class="k">if</span> <span class="p">(</span><span class="n">ElseV</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+<span class="n">Builder</span><span class="p">.</span><span class="n">CreateBr</span><span class="p">(</span><span class="n">MergeBB</span><span class="p">);</span>
+<span class="c1">// Codegen of 'Else' can change the current block, update ElseBB for the PHI.</span>
+<span class="n">ElseBB</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">GetInsertBlock</span><span class="p">();</span>
+</pre></div>
+</div>
+<p>Code generation for the ‘else’ block is basically identical to codegen
+for the ‘then’ block. The only significant difference is the first line,
+which adds the ‘else’ block to the function. Recall previously that the
+‘else’ block was created, but not added to the function. Now that the
+‘then’ and ‘else’ blocks are emitted, we can finish up with the merge
+code:</p>
+<div class="highlight-c++"><div class="highlight"><pre>  <span class="c1">// Emit merge block.</span>
+  <span class="n">TheFunction</span><span class="o">-></span><span class="n">getBasicBlockList</span><span class="p">().</span><span class="n">push_back</span><span class="p">(</span><span class="n">MergeBB</span><span class="p">);</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">SetInsertPoint</span><span class="p">(</span><span class="n">MergeBB</span><span class="p">);</span>
+  <span class="n">PHINode</span> <span class="o">*</span><span class="n">PN</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreatePHI</span><span class="p">(</span><span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()),</span> <span class="mi">2</span><span class="p">,</span>
+                                  <span class="s">"iftmp"</span><span class="p">);</span>
+
+  <span class="n">PN</span><span class="o">-></span><span class="n">addIncoming</span><span class="p">(</span><span class="n">ThenV</span><span class="p">,</span> <span class="n">ThenBB</span><span class="p">);</span>
+  <span class="n">PN</span><span class="o">-></span><span class="n">addIncoming</span><span class="p">(</span><span class="n">ElseV</span><span class="p">,</span> <span class="n">ElseBB</span><span class="p">);</span>
+  <span class="k">return</span> <span class="n">PN</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>The first two lines here are now familiar: the first adds the “merge”
+block to the Function object (it was previously floating, like the else
+block above). The second block changes the insertion point so that newly
+created code will go into the “merge” block. Once that is done, we need
+to create the PHI node and set up the block/value pairs for the PHI.</p>
+<p>Finally, the CodeGen function returns the phi node as the value computed
+by the if/then/else expression. In our example above, this returned
+value will feed into the code for the top-level function, which will
+create the return instruction.</p>
+<p>Overall, we now have the ability to execute conditional code in
+Kaleidoscope. With this extension, Kaleidoscope is a fairly complete
+language that can calculate a wide variety of numeric functions. Next up
+we’ll add another useful expression that is familiar from non-functional
+languages...</p>
+</div>
+</div>
+<div class="section" id="for-loop-expression">
+<h2><a class="toc-backref" href="#id8">5.3. ‘for’ Loop Expression</a><a class="headerlink" href="#for-loop-expression" title="Permalink to this headline">¶</a></h2>
+<p>Now that we know how to add basic control flow constructs to the
+language, we have the tools to add more powerful things. Lets add
+something more aggressive, a ‘for’ expression:</p>
+<div class="highlight-python"><pre>extern putchard(char)
+def printstar(n)
+  for i = 1, i < n, 1.0 in
+    putchard(42);  # ascii 42 = '*'
+
+# print 100 '*' characters
+printstar(100);</pre>
+</div>
+<p>This expression defines a new variable (“i” in this case) which iterates
+from a starting value, while the condition (“i < n” in this case) is
+true, incrementing by an optional step value (“1.0” in this case). If
+the step value is omitted, it defaults to 1.0. While the loop is true,
+it executes its body expression. Because we don’t have anything better
+to return, we’ll just define the loop as always returning 0.0. In the
+future when we have mutable variables, it will get more useful.</p>
+<p>As before, lets talk about the changes that we need to Kaleidoscope to
+support this.</p>
+<div class="section" id="lexer-extensions-for-the-for-loop">
+<h3><a class="toc-backref" href="#id9">5.3.1. Lexer Extensions for the ‘for’ Loop</a><a class="headerlink" href="#lexer-extensions-for-the-for-loop" title="Permalink to this headline">¶</a></h3>
+<p>The lexer extensions are the same sort of thing as for if/then/else:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="p">...</span> <span class="n">in</span> <span class="k">enum</span> <span class="n">Token</span> <span class="p">...</span>
+<span class="c1">// control</span>
+<span class="n">tok_if</span> <span class="o">=</span> <span class="o">-</span><span class="mi">6</span><span class="p">,</span> <span class="n">tok_then</span> <span class="o">=</span> <span class="o">-</span><span class="mi">7</span><span class="p">,</span> <span class="n">tok_else</span> <span class="o">=</span> <span class="o">-</span><span class="mi">8</span><span class="p">,</span>
+<span class="n">tok_for</span> <span class="o">=</span> <span class="o">-</span><span class="mi">9</span><span class="p">,</span> <span class="n">tok_in</span> <span class="o">=</span> <span class="o">-</span><span class="mi">10</span>
+
+<span class="p">...</span> <span class="n">in</span> <span class="n">gettok</span> <span class="p">...</span>
+<span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"def"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_def</span><span class="p">;</span>
+<span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"extern"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_extern</span><span class="p">;</span>
+<span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"if"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_if</span><span class="p">;</span>
+<span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"then"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_then</span><span class="p">;</span>
+<span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"else"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_else</span><span class="p">;</span>
+<span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"for"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_for</span><span class="p">;</span>
+<span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"in"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_in</span><span class="p">;</span>
+<span class="k">return</span> <span class="n">tok_identifier</span><span class="p">;</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="ast-extensions-for-the-for-loop">
+<h3><a class="toc-backref" href="#id10">5.3.2. AST Extensions for the ‘for’ Loop</a><a class="headerlink" href="#ast-extensions-for-the-for-loop" title="Permalink to this headline">¶</a></h3>
+<p>The AST node is just as simple. It basically boils down to capturing the
+variable name and the constituent expressions in the node.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// ForExprAST - Expression class for for/in.</span>
+<span class="k">class</span> <span class="nc">ForExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">VarName</span><span class="p">;</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Start</span><span class="p">,</span> <span class="o">*</span><span class="n">End</span><span class="p">,</span> <span class="o">*</span><span class="n">Step</span><span class="p">,</span> <span class="o">*</span><span class="n">Body</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">ForExprAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">varname</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">start</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">end</span><span class="p">,</span>
+             <span class="n">ExprAST</span> <span class="o">*</span><span class="n">step</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">body</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">VarName</span><span class="p">(</span><span class="n">varname</span><span class="p">),</span> <span class="n">Start</span><span class="p">(</span><span class="n">start</span><span class="p">),</span> <span class="n">End</span><span class="p">(</span><span class="n">end</span><span class="p">),</span> <span class="n">Step</span><span class="p">(</span><span class="n">step</span><span class="p">),</span> <span class="n">Body</span><span class="p">(</span><span class="n">body</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="parser-extensions-for-the-for-loop">
+<h3><a class="toc-backref" href="#id11">5.3.3. Parser Extensions for the ‘for’ Loop</a><a class="headerlink" href="#parser-extensions-for-the-for-loop" title="Permalink to this headline">¶</a></h3>
+<p>The parser code is also fairly standard. The only interesting thing here
+is handling of the optional step value. The parser code handles it by
+checking to see if the second comma is present. If not, it sets the step
+value to null in the AST node:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// forexpr ::= 'for' identifier '=' expr ',' expr (',' expr)? 'in' expression</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseForExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat the for.</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="n">tok_identifier</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected identifier after for"</span><span class="p">);</span>
+
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">IdName</span> <span class="o">=</span> <span class="n">IdentifierStr</span><span class="p">;</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat identifier.</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">'='</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected '=' after for"</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat '='.</span>
+
+
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Start</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Start</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">','</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected ',' after for start value"</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>
+
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">End</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">End</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="c1">// The step value is optional.</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Step</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">==</span> <span class="sc">','</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+    <span class="n">Step</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">Step</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="p">}</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="n">tok_in</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected 'in' after for"</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat 'in'.</span>
+
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Body</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Body</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="k">return</span> <span class="k">new</span> <span class="n">ForExprAST</span><span class="p">(</span><span class="n">IdName</span><span class="p">,</span> <span class="n">Start</span><span class="p">,</span> <span class="n">End</span><span class="p">,</span> <span class="n">Step</span><span class="p">,</span> <span class="n">Body</span><span class="p">);</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="llvm-ir-for-the-for-loop">
+<h3><a class="toc-backref" href="#id12">5.3.4. LLVM IR for the ‘for’ Loop</a><a class="headerlink" href="#llvm-ir-for-the-for-loop" title="Permalink to this headline">¶</a></h3>
+<p>Now we get to the good part: the LLVM IR we want to generate for this
+thing. With the simple example above, we get this LLVM IR (note that
+this dump is generated with optimizations disabled for clarity):</p>
+<div class="highlight-llvm"><div class="highlight"><pre><span class="k">declare</span> <span class="kt">double</span> <span class="vg">@putchard</span><span class="p">(</span><span class="kt">double</span><span class="p">)</span>
+
+<span class="k">define</span> <span class="kt">double</span> <span class="vg">@printstar</span><span class="p">(</span><span class="kt">double</span> <span class="nv">%n</span><span class="p">)</span> <span class="p">{</span>
+<span class="nl">entry:</span>
+  <span class="c">; initial value = 1.0 (inlined into phi)</span>
+  <span class="k">br</span> <span class="kt">label</span> <span class="nv">%loop</span>
+
+<span class="nl">loop:</span>       <span class="c">; preds = %loop, %entry</span>
+  <span class="nv">%i</span> <span class="p">=</span> <span class="k">phi</span> <span class="kt">double</span> <span class="p">[</span> <span class="m">1.000000e+00</span><span class="p">,</span> <span class="nv">%entry</span> <span class="p">],</span> <span class="p">[</span> <span class="nv">%nextvar</span><span class="p">,</span> <span class="nv">%loop</span> <span class="p">]</span>
+  <span class="c">; body</span>
+  <span class="nv">%calltmp</span> <span class="p">=</span> <span class="k">call</span> <span class="kt">double</span> <span class="vg">@putchard</span><span class="p">(</span><span class="kt">double</span> <span class="m">4.200000e+01</span><span class="p">)</span>
+  <span class="c">; increment</span>
+  <span class="nv">%nextvar</span> <span class="p">=</span> <span class="k">fadd</span> <span class="kt">double</span> <span class="nv">%i</span><span class="p">,</span> <span class="m">1.000000e+00</span>
+
+  <span class="c">; termination test</span>
+  <span class="nv">%cmptmp</span> <span class="p">=</span> <span class="k">fcmp</span> <span class="k">ult</span> <span class="kt">double</span> <span class="nv">%i</span><span class="p">,</span> <span class="nv">%n</span>
+  <span class="nv">%booltmp</span> <span class="p">=</span> <span class="k">uitofp</span> <span class="k">i1</span> <span class="nv">%cmptmp</span> <span class="k">to</span> <span class="kt">double</span>
+  <span class="nv">%loopcond</span> <span class="p">=</span> <span class="k">fcmp</span> <span class="k">one</span> <span class="kt">double</span> <span class="nv">%booltmp</span><span class="p">,</span> <span class="m">0.000000e+00</span>
+  <span class="k">br</span> <span class="k">i1</span> <span class="nv">%loopcond</span><span class="p">,</span> <span class="kt">label</span> <span class="nv">%loop</span><span class="p">,</span> <span class="kt">label</span> <span class="nv">%afterloop</span>
+
+<span class="nl">afterloop:</span>      <span class="c">; preds = %loop</span>
+  <span class="c">; loop always returns 0.0</span>
+  <span class="k">ret</span> <span class="kt">double</span> <span class="m">0.000000e+00</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>This loop contains all the same constructs we saw before: a phi node,
+several expressions, and some basic blocks. Lets see how this fits
+together.</p>
+</div>
+<div class="section" id="code-generation-for-the-for-loop">
+<h3><a class="toc-backref" href="#id13">5.3.5. Code Generation for the ‘for’ Loop</a><a class="headerlink" href="#code-generation-for-the-for-loop" title="Permalink to this headline">¶</a></h3>
+<p>The first part of Codegen is very simple: we just output the start
+expression for the loop value:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">Value</span> <span class="o">*</span><span class="n">ForExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Emit the start code first, without 'variable' in scope.</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">StartVal</span> <span class="o">=</span> <span class="n">Start</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">StartVal</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+</pre></div>
+</div>
+<p>With this out of the way, the next step is to set up the LLVM basic
+block for the start of the loop body. In the case above, the whole loop
+body is one block, but remember that the body code itself could consist
+of multiple blocks (e.g. if it contains an if/then/else or a for/in
+expression).</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// Make the new basic block for the loop header, inserting after current</span>
+<span class="c1">// block.</span>
+<span class="n">Function</span> <span class="o">*</span><span class="n">TheFunction</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">GetInsertBlock</span><span class="p">()</span><span class="o">-></span><span class="n">getParent</span><span class="p">();</span>
+<span class="n">BasicBlock</span> <span class="o">*</span><span class="n">PreheaderBB</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">GetInsertBlock</span><span class="p">();</span>
+<span class="n">BasicBlock</span> <span class="o">*</span><span class="n">LoopBB</span> <span class="o">=</span> <span class="n">BasicBlock</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="s">"loop"</span><span class="p">,</span> <span class="n">TheFunction</span><span class="p">);</span>
+
+<span class="c1">// Insert an explicit fall through from the current block to the LoopBB.</span>
+<span class="n">Builder</span><span class="p">.</span><span class="n">CreateBr</span><span class="p">(</span><span class="n">LoopBB</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>This code is similar to what we saw for if/then/else. Because we will
+need it to create the Phi node, we remember the block that falls through
+into the loop. Once we have that, we create the actual block that starts
+the loop and create an unconditional branch for the fall-through between
+the two blocks.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// Start insertion in LoopBB.</span>
+<span class="n">Builder</span><span class="p">.</span><span class="n">SetInsertPoint</span><span class="p">(</span><span class="n">LoopBB</span><span class="p">);</span>
+
+<span class="c1">// Start the PHI node with an entry for Start.</span>
+<span class="n">PHINode</span> <span class="o">*</span><span class="n">Variable</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreatePHI</span><span class="p">(</span><span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()),</span> <span class="mi">2</span><span class="p">,</span> <span class="n">VarName</span><span class="p">.</span><span class="n">c_str</span><span class="p">());</span>
+<span class="n">Variable</span><span class="o">-></span><span class="n">addIncoming</span><span class="p">(</span><span class="n">StartVal</span><span class="p">,</span> <span class="n">PreheaderBB</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>Now that the “preheader” for the loop is set up, we switch to emitting
+code for the loop body. To begin with, we move the insertion point and
+create the PHI node for the loop induction variable. Since we already
+know the incoming value for the starting value, we add it to the Phi
+node. Note that the Phi will eventually get a second value for the
+backedge, but we can’t set it up yet (because it doesn’t exist!).</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// Within the loop, the variable is defined equal to the PHI node.  If it</span>
+<span class="c1">// shadows an existing variable, we have to restore it, so save it now.</span>
+<span class="n">Value</span> <span class="o">*</span><span class="n">OldVal</span> <span class="o">=</span> <span class="n">NamedValues</span><span class="p">[</span><span class="n">VarName</span><span class="p">];</span>
+<span class="n">NamedValues</span><span class="p">[</span><span class="n">VarName</span><span class="p">]</span> <span class="o">=</span> <span class="n">Variable</span><span class="p">;</span>
+
+<span class="c1">// Emit the body of the loop.  This, like any other expr, can change the</span>
+<span class="c1">// current BB.  Note that we ignore the value computed by the body, but don't</span>
+<span class="c1">// allow an error.</span>
+<span class="k">if</span> <span class="p">(</span><span class="n">Body</span><span class="o">-></span><span class="n">Codegen</span><span class="p">()</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+</pre></div>
+</div>
+<p>Now the code starts to get more interesting. Our ‘for’ loop introduces a
+new variable to the symbol table. This means that our symbol table can
+now contain either function arguments or loop variables. To handle this,
+before we codegen the body of the loop, we add the loop variable as the
+current value for its name. Note that it is possible that there is a
+variable of the same name in the outer scope. It would be easy to make
+this an error (emit an error and return null if there is already an
+entry for VarName) but we choose to allow shadowing of variables. In
+order to handle this correctly, we remember the Value that we are
+potentially shadowing in <tt class="docutils literal"><span class="pre">OldVal</span></tt> (which will be null if there is no
+shadowed variable).</p>
+<p>Once the loop variable is set into the symbol table, the code
+recursively codegen’s the body. This allows the body to use the loop
+variable: any references to it will naturally find it in the symbol
+table.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// Emit the step value.</span>
+<span class="n">Value</span> <span class="o">*</span><span class="n">StepVal</span><span class="p">;</span>
+<span class="k">if</span> <span class="p">(</span><span class="n">Step</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">StepVal</span> <span class="o">=</span> <span class="n">Step</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">StepVal</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+  <span class="c1">// If not specified, use 1.0.</span>
+  <span class="n">StepVal</span> <span class="o">=</span> <span class="n">ConstantFP</span><span class="o">::</span><span class="n">get</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="n">APFloat</span><span class="p">(</span><span class="mf">1.0</span><span class="p">));</span>
+<span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">NextVar</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFAdd</span><span class="p">(</span><span class="n">Variable</span><span class="p">,</span> <span class="n">StepVal</span><span class="p">,</span> <span class="s">"nextvar"</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>Now that the body is emitted, we compute the next value of the iteration
+variable by adding the step value, or 1.0 if it isn’t present.
+‘<tt class="docutils literal"><span class="pre">NextVar</span></tt>‘ will be the value of the loop variable on the next
+iteration of the loop.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// Compute the end condition.</span>
+<span class="n">Value</span> <span class="o">*</span><span class="n">EndCond</span> <span class="o">=</span> <span class="n">End</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+<span class="k">if</span> <span class="p">(</span><span class="n">EndCond</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="n">EndCond</span><span class="p">;</span>
+
+<span class="c1">// Convert condition to a bool by comparing equal to 0.0.</span>
+<span class="n">EndCond</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFCmpONE</span><span class="p">(</span><span class="n">EndCond</span><span class="p">,</span>
+                            <span class="n">ConstantFP</span><span class="o">::</span><span class="n">get</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="n">APFloat</span><span class="p">(</span><span class="mf">0.0</span><span class="p">)),</span>
+                                <span class="s">"loopcond"</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>Finally, we evaluate the exit value of the loop, to determine whether
+the loop should exit. This mirrors the condition evaluation for the
+if/then/else statement.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">// Create the "after loop" block and insert it.</span>
+<span class="n">BasicBlock</span> <span class="o">*</span><span class="n">LoopEndBB</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">GetInsertBlock</span><span class="p">();</span>
+<span class="n">BasicBlock</span> <span class="o">*</span><span class="n">AfterBB</span> <span class="o">=</span> <span class="n">BasicBlock</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="s">"afterloop"</span><span class="p">,</span> <span class="n">TheFunction</span><span class="p">);</span>
+
+<span class="c1">// Insert the conditional branch into the end of LoopEndBB.</span>
+<span class="n">Builder</span><span class="p">.</span><span class="n">CreateCondBr</span><span class="p">(</span><span class="n">EndCond</span><span class="p">,</span> <span class="n">LoopBB</span><span class="p">,</span> <span class="n">AfterBB</span><span class="p">);</span>
+
+<span class="c1">// Any new code will be inserted in AfterBB.</span>
+<span class="n">Builder</span><span class="p">.</span><span class="n">SetInsertPoint</span><span class="p">(</span><span class="n">AfterBB</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>With the code for the body of the loop complete, we just need to finish
+up the control flow for it. This code remembers the end block (for the
+phi node), then creates the block for the loop exit (“afterloop”). Based
+on the value of the exit condition, it creates a conditional branch that
+chooses between executing the loop again and exiting the loop. Any
+future code is emitted in the “afterloop” block, so it sets the
+insertion position to it.</p>
+<div class="highlight-c++"><div class="highlight"><pre>  <span class="c1">// Add a new entry to the PHI node for the backedge.</span>
+  <span class="n">Variable</span><span class="o">-></span><span class="n">addIncoming</span><span class="p">(</span><span class="n">NextVar</span><span class="p">,</span> <span class="n">LoopEndBB</span><span class="p">);</span>
+
+  <span class="c1">// Restore the unshadowed variable.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">OldVal</span><span class="p">)</span>
+    <span class="n">NamedValues</span><span class="p">[</span><span class="n">VarName</span><span class="p">]</span> <span class="o">=</span> <span class="n">OldVal</span><span class="p">;</span>
+  <span class="k">else</span>
+    <span class="n">NamedValues</span><span class="p">.</span><span class="n">erase</span><span class="p">(</span><span class="n">VarName</span><span class="p">);</span>
+
+  <span class="c1">// for expr always returns 0.0.</span>
+  <span class="k">return</span> <span class="n">Constant</span><span class="o">::</span><span class="n">getNullValue</span><span class="p">(</span><span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()));</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>The final code handles various cleanups: now that we have the “NextVar”
+value, we can add the incoming value to the loop PHI node. After that,
+we remove the loop variable from the symbol table, so that it isn’t in
+scope after the for loop. Finally, code generation of the for loop
+always returns 0.0, so that is what we return from
+<tt class="docutils literal"><span class="pre">ForExprAST::Codegen</span></tt>.</p>
+<p>With this, we conclude the “adding control flow to Kaleidoscope” chapter
+of the tutorial. In this chapter we added two control flow constructs,
+and used them to motivate a couple of aspects of the LLVM IR that are
+important for front-end implementors to know. In the next chapter of our
+saga, we will get a bit crazier and add <a class="reference external" href="LangImpl6.html">user-defined
+operators</a> to our poor innocent language.</p>
+</div>
+</div>
+<div class="section" id="full-code-listing">
+<h2><a class="toc-backref" href="#id14">5.4. Full Code Listing</a><a class="headerlink" href="#full-code-listing" title="Permalink to this headline">¶</a></h2>
+<p>Here is the complete code listing for our running example, enhanced with
+the if/then/else and for expressions.. To build this example, use:</p>
+<div class="highlight-bash"><div class="highlight"><pre><span class="c"># Compile</span>
+clang++ -g toy.cpp <span class="sb">`</span>llvm-config --cppflags --ldflags --libs core jit native<span class="sb">`</span> -O3 -o toy
+<span class="c"># Run</span>
+./toy
+</pre></div>
+</div>
+<p>Here is the code:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include "llvm/Analysis/Passes.h"</span>
+<span class="cp">#include "llvm/Analysis/Verifier.h"</span>
+<span class="cp">#include "llvm/ExecutionEngine/ExecutionEngine.h"</span>
+<span class="cp">#include "llvm/ExecutionEngine/JIT.h"</span>
+<span class="cp">#include "llvm/IR/DataLayout.h"</span>
+<span class="cp">#include "llvm/IR/DerivedTypes.h"</span>
+<span class="cp">#include "llvm/IR/IRBuilder.h"</span>
+<span class="cp">#include "llvm/IR/LLVMContext.h"</span>
+<span class="cp">#include "llvm/IR/Module.h"</span>
+<span class="cp">#include "llvm/PassManager.h"</span>
+<span class="cp">#include "llvm/Support/TargetSelect.h"</span>
+<span class="cp">#include "llvm/Transforms/Scalar.h"</span>
+<span class="cp">#include <cctype></span>
+<span class="cp">#include <cstdio></span>
+<span class="cp">#include <map></span>
+<span class="cp">#include <string></span>
+<span class="cp">#include <vector></span>
+<span class="k">using</span> <span class="k">namespace</span> <span class="n">llvm</span><span class="p">;</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Lexer</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="c1">// The lexer returns tokens [0-255] if it is an unknown character, otherwise one</span>
+<span class="c1">// of these for known things.</span>
+<span class="k">enum</span> <span class="n">Token</span> <span class="p">{</span>
+  <span class="n">tok_eof</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span>
+
+  <span class="c1">// commands</span>
+  <span class="n">tok_def</span> <span class="o">=</span> <span class="o">-</span><span class="mi">2</span><span class="p">,</span> <span class="n">tok_extern</span> <span class="o">=</span> <span class="o">-</span><span class="mi">3</span><span class="p">,</span>
+
+  <span class="c1">// primary</span>
+  <span class="n">tok_identifier</span> <span class="o">=</span> <span class="o">-</span><span class="mi">4</span><span class="p">,</span> <span class="n">tok_number</span> <span class="o">=</span> <span class="o">-</span><span class="mi">5</span><span class="p">,</span>
+  
+  <span class="c1">// control</span>
+  <span class="n">tok_if</span> <span class="o">=</span> <span class="o">-</span><span class="mi">6</span><span class="p">,</span> <span class="n">tok_then</span> <span class="o">=</span> <span class="o">-</span><span class="mi">7</span><span class="p">,</span> <span class="n">tok_else</span> <span class="o">=</span> <span class="o">-</span><span class="mi">8</span><span class="p">,</span>
+  <span class="n">tok_for</span> <span class="o">=</span> <span class="o">-</span><span class="mi">9</span><span class="p">,</span> <span class="n">tok_in</span> <span class="o">=</span> <span class="o">-</span><span class="mi">10</span>
+<span class="p">};</span>
+
+<span class="k">static</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">IdentifierStr</span><span class="p">;</span>  <span class="c1">// Filled in if tok_identifier</span>
+<span class="k">static</span> <span class="kt">double</span> <span class="n">NumVal</span><span class="p">;</span>              <span class="c1">// Filled in if tok_number</span>
+
+<span class="c1">/// gettok - Return the next token from standard input.</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">gettok</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">static</span> <span class="kt">int</span> <span class="n">LastChar</span> <span class="o">=</span> <span class="sc">' '</span><span class="p">;</span>
+
+  <span class="c1">// Skip any whitespace.</span>
+  <span class="k">while</span> <span class="p">(</span><span class="n">isspace</span><span class="p">(</span><span class="n">LastChar</span><span class="p">))</span>
+    <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">isalpha</span><span class="p">(</span><span class="n">LastChar</span><span class="p">))</span> <span class="p">{</span> <span class="c1">// identifier: [a-zA-Z][a-zA-Z0-9]*</span>
+    <span class="n">IdentifierStr</span> <span class="o">=</span> <span class="n">LastChar</span><span class="p">;</span>
+    <span class="k">while</span> <span class="p">(</span><span class="n">isalnum</span><span class="p">((</span><span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">())))</span>
+      <span class="n">IdentifierStr</span> <span class="o">+=</span> <span class="n">LastChar</span><span class="p">;</span>
+
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"def"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_def</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"extern"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_extern</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"if"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_if</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"then"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_then</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"else"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_else</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"for"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_for</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"in"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_in</span><span class="p">;</span>
+    <span class="k">return</span> <span class="n">tok_identifier</span><span class="p">;</span>
+  <span class="p">}</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">isdigit</span><span class="p">(</span><span class="n">LastChar</span><span class="p">)</span> <span class="o">||</span> <span class="n">LastChar</span> <span class="o">==</span> <span class="sc">'.'</span><span class="p">)</span> <span class="p">{</span>   <span class="c1">// Number: [0-9.]+</span>
+    <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">NumStr</span><span class="p">;</span>
+    <span class="k">do</span> <span class="p">{</span>
+      <span class="n">NumStr</span> <span class="o">+=</span> <span class="n">LastChar</span><span class="p">;</span>
+      <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+    <span class="p">}</span> <span class="k">while</span> <span class="p">(</span><span class="n">isdigit</span><span class="p">(</span><span class="n">LastChar</span><span class="p">)</span> <span class="o">||</span> <span class="n">LastChar</span> <span class="o">==</span> <span class="sc">'.'</span><span class="p">);</span>
+
+    <span class="n">NumVal</span> <span class="o">=</span> <span class="n">strtod</span><span class="p">(</span><span class="n">NumStr</span><span class="p">.</span><span class="n">c_str</span><span class="p">(),</span> <span class="mi">0</span><span class="p">);</span>
+    <span class="k">return</span> <span class="n">tok_number</span><span class="p">;</span>
+  <span class="p">}</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">==</span> <span class="sc">'#'</span><span class="p">)</span> <span class="p">{</span>
+    <span class="c1">// Comment until end of line.</span>
+    <span class="k">do</span> <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+    <span class="k">while</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">!=</span> <span class="n">EOF</span> <span class="o">&&</span> <span class="n">LastChar</span> <span class="o">!=</span> <span class="sc">'\n'</span> <span class="o">&&</span> <span class="n">LastChar</span> <span class="o">!=</span> <span class="sc">'\r'</span><span class="p">);</span>
+    
+    <span class="k">if</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">!=</span> <span class="n">EOF</span><span class="p">)</span>
+      <span class="k">return</span> <span class="n">gettok</span><span class="p">();</span>
+  <span class="p">}</span>
+  
+  <span class="c1">// Check for end of file.  Don't eat the EOF.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">==</span> <span class="n">EOF</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">tok_eof</span><span class="p">;</span>
+
+  <span class="c1">// Otherwise, just return the character as its ascii value.</span>
+  <span class="kt">int</span> <span class="n">ThisChar</span> <span class="o">=</span> <span class="n">LastChar</span><span class="p">;</span>
+  <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+  <span class="k">return</span> <span class="n">ThisChar</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Abstract Syntax Tree (aka Parse Tree)</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="k">namespace</span> <span class="p">{</span>
+<span class="c1">/// ExprAST - Base class for all expression nodes.</span>
+<span class="k">class</span> <span class="nc">ExprAST</span> <span class="p">{</span>
+<span class="nl">public:</span>
+  <span class="k">virtual</span> <span class="o">~</span><span class="n">ExprAST</span><span class="p">()</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">()</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">};</span>
+
+<span class="c1">/// NumberExprAST - Expression class for numeric literals like "1.0".</span>
+<span class="k">class</span> <span class="nc">NumberExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="kt">double</span> <span class="n">Val</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">NumberExprAST</span><span class="p">(</span><span class="kt">double</span> <span class="n">val</span><span class="p">)</span> <span class="o">:</span> <span class="n">Val</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// VariableExprAST - Expression class for referencing a variable, like "a".</span>
+<span class="k">class</span> <span class="nc">VariableExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">Name</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">VariableExprAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">name</span><span class="p">)</span> <span class="o">:</span> <span class="n">Name</span><span class="p">(</span><span class="n">name</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// BinaryExprAST - Expression class for a binary operator.</span>
+<span class="k">class</span> <span class="nc">BinaryExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="kt">char</span> <span class="n">Op</span><span class="p">;</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">LHS</span><span class="p">,</span> <span class="o">*</span><span class="n">RHS</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">BinaryExprAST</span><span class="p">(</span><span class="kt">char</span> <span class="n">op</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">lhs</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">rhs</span><span class="p">)</span> 
+    <span class="o">:</span> <span class="n">Op</span><span class="p">(</span><span class="n">op</span><span class="p">),</span> <span class="n">LHS</span><span class="p">(</span><span class="n">lhs</span><span class="p">),</span> <span class="n">RHS</span><span class="p">(</span><span class="n">rhs</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// CallExprAST - Expression class for function calls.</span>
+<span class="k">class</span> <span class="nc">CallExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">Callee</span><span class="p">;</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">ExprAST</span><span class="o">*></span> <span class="n">Args</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">CallExprAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">callee</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">ExprAST</span><span class="o">*></span> <span class="o">&</span><span class="n">args</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">Callee</span><span class="p">(</span><span class="n">callee</span><span class="p">),</span> <span class="n">Args</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// IfExprAST - Expression class for if/then/else.</span>
+<span class="k">class</span> <span class="nc">IfExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Cond</span><span class="p">,</span> <span class="o">*</span><span class="n">Then</span><span class="p">,</span> <span class="o">*</span><span class="n">Else</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">IfExprAST</span><span class="p">(</span><span class="n">ExprAST</span> <span class="o">*</span><span class="n">cond</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">then</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">_else</span><span class="p">)</span>
+  <span class="o">:</span> <span class="n">Cond</span><span class="p">(</span><span class="n">cond</span><span class="p">),</span> <span class="n">Then</span><span class="p">(</span><span class="n">then</span><span class="p">),</span> <span class="n">Else</span><span class="p">(</span><span class="n">_else</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// ForExprAST - Expression class for for/in.</span>
+<span class="k">class</span> <span class="nc">ForExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">VarName</span><span class="p">;</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Start</span><span class="p">,</span> <span class="o">*</span><span class="n">End</span><span class="p">,</span> <span class="o">*</span><span class="n">Step</span><span class="p">,</span> <span class="o">*</span><span class="n">Body</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">ForExprAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">varname</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">start</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">end</span><span class="p">,</span>
+             <span class="n">ExprAST</span> <span class="o">*</span><span class="n">step</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">body</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">VarName</span><span class="p">(</span><span class="n">varname</span><span class="p">),</span> <span class="n">Start</span><span class="p">(</span><span class="n">start</span><span class="p">),</span> <span class="n">End</span><span class="p">(</span><span class="n">end</span><span class="p">),</span> <span class="n">Step</span><span class="p">(</span><span class="n">step</span><span class="p">),</span> <span class="n">Body</span><span class="p">(</span><span class="n">body</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// PrototypeAST - This class represents the "prototype" for a function,</span>
+<span class="c1">/// which captures its name, and its argument names (thus implicitly the number</span>
+<span class="c1">/// of arguments the function takes).</span>
+<span class="k">class</span> <span class="nc">PrototypeAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">Name</span><span class="p">;</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="n">Args</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">PrototypeAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">name</span><span class="p">,</span> <span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="o">&</span><span class="n">args</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">Name</span><span class="p">(</span><span class="n">name</span><span class="p">),</span> <span class="n">Args</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="p">{}</span>
+  
+  <span class="n">Function</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// FunctionAST - This class represents a function definition itself.</span>
+<span class="k">class</span> <span class="nc">FunctionAST</span> <span class="p">{</span>
+  <span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">Proto</span><span class="p">;</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Body</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">FunctionAST</span><span class="p">(</span><span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">proto</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">body</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">Proto</span><span class="p">(</span><span class="n">proto</span><span class="p">),</span> <span class="n">Body</span><span class="p">(</span><span class="n">body</span><span class="p">)</span> <span class="p">{}</span>
+  
+  <span class="n">Function</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+<span class="p">}</span> <span class="c1">// end anonymous namespace</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Parser</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="c1">/// CurTok/getNextToken - Provide a simple token buffer.  CurTok is the current</span>
+<span class="c1">/// token the parser is looking at.  getNextToken reads another token from the</span>
+<span class="c1">/// lexer and updates CurTok with its results.</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="n">CurTok</span><span class="p">;</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">getNextToken</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="n">CurTok</span> <span class="o">=</span> <span class="n">gettok</span><span class="p">();</span>
+<span class="p">}</span>
+
+<span class="c1">/// BinopPrecedence - This holds the precedence for each binary operator that is</span>
+<span class="c1">/// defined.</span>
+<span class="k">static</span> <span class="n">std</span><span class="o">::</span><span class="n">map</span><span class="o"><</span><span class="kt">char</span><span class="p">,</span> <span class="kt">int</span><span class="o">></span> <span class="n">BinopPrecedence</span><span class="p">;</span>
+
+<span class="c1">/// GetTokPrecedence - Get the precedence of the pending binary operator token.</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">GetTokPrecedence</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">isascii</span><span class="p">(</span><span class="n">CurTok</span><span class="p">))</span>
+    <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
+  
+  <span class="c1">// Make sure it's a declared binop.</span>
+  <span class="kt">int</span> <span class="n">TokPrec</span> <span class="o">=</span> <span class="n">BinopPrecedence</span><span class="p">[</span><span class="n">CurTok</span><span class="p">];</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">TokPrec</span> <span class="o"><=</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
+  <span class="k">return</span> <span class="n">TokPrec</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// Error* - These are little helper functions for error handling.</span>
+<span class="n">ExprAST</span> <span class="o">*</span><span class="nf">Error</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Error: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">Str</span><span class="p">);</span><span class="k">return</span> <span class="mi">0</span><span class="p">;}</span>
+<span class="n">PrototypeAST</span> <span class="o">*</span><span class="nf">ErrorP</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">Error</span><span class="p">(</span><span class="n">Str</span><span class="p">);</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span>
+<span class="n">FunctionAST</span> <span class="o">*</span><span class="nf">ErrorF</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">Error</span><span class="p">(</span><span class="n">Str</span><span class="p">);</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span>
+
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseExpression</span><span class="p">();</span>
+
+<span class="c1">/// identifierexpr</span>
+<span class="c1">///   ::= identifier</span>
+<span class="c1">///   ::= identifier '(' expression* ')'</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseIdentifierExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">IdName</span> <span class="o">=</span> <span class="n">IdentifierStr</span><span class="p">;</span>
+  
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat identifier.</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">'('</span><span class="p">)</span> <span class="c1">// Simple variable ref.</span>
+    <span class="k">return</span> <span class="k">new</span> <span class="n">VariableExprAST</span><span class="p">(</span><span class="n">IdName</span><span class="p">);</span>
+  
+  <span class="c1">// Call.</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat (</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">ExprAST</span><span class="o">*></span> <span class="n">Args</span><span class="p">;</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">')'</span><span class="p">)</span> <span class="p">{</span>
+    <span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+      <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Arg</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+      <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">Arg</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+      <span class="n">Args</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="n">Arg</span><span class="p">);</span>
+
+      <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">==</span> <span class="sc">')'</span><span class="p">)</span> <span class="k">break</span><span class="p">;</span>
+
+      <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">','</span><span class="p">)</span>
+        <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"Expected ')' or ',' in argument list"</span><span class="p">);</span>
+      <span class="n">getNextToken</span><span class="p">();</span>
+    <span class="p">}</span>
+  <span class="p">}</span>
+
+  <span class="c1">// Eat the ')'.</span>
+  <span class="n">getNextToken</span><span class="p">();</span>
+  
+  <span class="k">return</span> <span class="k">new</span> <span class="n">CallExprAST</span><span class="p">(</span><span class="n">IdName</span><span class="p">,</span> <span class="n">Args</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="c1">/// numberexpr ::= number</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseNumberExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Result</span> <span class="o">=</span> <span class="k">new</span> <span class="n">NumberExprAST</span><span class="p">(</span><span class="n">NumVal</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span> <span class="c1">// consume the number</span>
+  <span class="k">return</span> <span class="n">Result</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// parenexpr ::= '(' expression ')'</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseParenExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat (.</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">V</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">V</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">')'</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected ')'"</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat ).</span>
+  <span class="k">return</span> <span class="n">V</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// ifexpr ::= 'if' expression 'then' expression 'else' expression</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseIfExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat the if.</span>
+  
+  <span class="c1">// condition.</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Cond</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">Cond</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="n">tok_then</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected then"</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat the then</span>
+  
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Then</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Then</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="n">tok_else</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected else"</span><span class="p">);</span>
+  
+  <span class="n">getNextToken</span><span class="p">();</span>
+  
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Else</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">Else</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="k">return</span> <span class="k">new</span> <span class="n">IfExprAST</span><span class="p">(</span><span class="n">Cond</span><span class="p">,</span> <span class="n">Then</span><span class="p">,</span> <span class="n">Else</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="c1">/// forexpr ::= 'for' identifier '=' expr ',' expr (',' expr)? 'in' expression</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseForExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat the for.</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="n">tok_identifier</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected identifier after for"</span><span class="p">);</span>
+  
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">IdName</span> <span class="o">=</span> <span class="n">IdentifierStr</span><span class="p">;</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat identifier.</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">'='</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected '=' after for"</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat '='.</span>
+  
+  
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Start</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Start</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">','</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected ',' after for start value"</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>
+  
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">End</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">End</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="c1">// The step value is optional.</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Step</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">==</span> <span class="sc">','</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+    <span class="n">Step</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">Step</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="p">}</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="n">tok_in</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected 'in' after for"</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat 'in'.</span>
+  
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Body</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Body</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="k">return</span> <span class="k">new</span> <span class="n">ForExprAST</span><span class="p">(</span><span class="n">IdName</span><span class="p">,</span> <span class="n">Start</span><span class="p">,</span> <span class="n">End</span><span class="p">,</span> <span class="n">Step</span><span class="p">,</span> <span class="n">Body</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="c1">/// primary</span>
+<span class="c1">///   ::= identifierexpr</span>
+<span class="c1">///   ::= numberexpr</span>
+<span class="c1">///   ::= parenexpr</span>
+<span class="c1">///   ::= ifexpr</span>
+<span class="c1">///   ::= forexpr</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParsePrimary</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">switch</span> <span class="p">(</span><span class="n">CurTok</span><span class="p">)</span> <span class="p">{</span>
+  <span class="nl">default:</span> <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"unknown token when expecting an expression"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="n">tok_identifier</span>: <span class="k">return</span> <span class="n">ParseIdentifierExpr</span><span class="p">();</span>
+  <span class="k">case</span> <span class="n">tok_number</span>:     <span class="k">return</span> <span class="n">ParseNumberExpr</span><span class="p">();</span>
+  <span class="k">case</span> <span class="sc">'('</span>:            <span class="k">return</span> <span class="n">ParseParenExpr</span><span class="p">();</span>
+  <span class="k">case</span> <span class="n">tok_if</span>:         <span class="k">return</span> <span class="n">ParseIfExpr</span><span class="p">();</span>
+  <span class="k">case</span> <span class="n">tok_for</span>:        <span class="k">return</span> <span class="n">ParseForExpr</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="c1">/// binoprhs</span>
+<span class="c1">///   ::= ('+' primary)*</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseBinOpRHS</span><span class="p">(</span><span class="kt">int</span> <span class="n">ExprPrec</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">LHS</span><span class="p">)</span> <span class="p">{</span>
+  <span class="c1">// If this is a binop, find its precedence.</span>
+  <span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+    <span class="kt">int</span> <span class="n">TokPrec</span> <span class="o">=</span> <span class="n">GetTokPrecedence</span><span class="p">();</span>
+    
+    <span class="c1">// If this is a binop that binds at least as tightly as the current binop,</span>
+    <span class="c1">// consume it, otherwise we are done.</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">TokPrec</span> <span class="o"><</span> <span class="n">ExprPrec</span><span class="p">)</span>
+      <span class="k">return</span> <span class="n">LHS</span><span class="p">;</span>
+    
+    <span class="c1">// Okay, we know this is a binop.</span>
+    <span class="kt">int</span> <span class="n">BinOp</span> <span class="o">=</span> <span class="n">CurTok</span><span class="p">;</span>
+    <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat binop</span>
+    
+    <span class="c1">// Parse the primary expression after the binary operator.</span>
+    <span class="n">ExprAST</span> <span class="o">*</span><span class="n">RHS</span> <span class="o">=</span> <span class="n">ParsePrimary</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">RHS</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+    
+    <span class="c1">// If BinOp binds less tightly with RHS than the operator after RHS, let</span>
+    <span class="c1">// the pending operator take RHS as its LHS.</span>
+    <span class="kt">int</span> <span class="n">NextPrec</span> <span class="o">=</span> <span class="n">GetTokPrecedence</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">TokPrec</span> <span class="o"><</span> <span class="n">NextPrec</span><span class="p">)</span> <span class="p">{</span>
+      <span class="n">RHS</span> <span class="o">=</span> <span class="n">ParseBinOpRHS</span><span class="p">(</span><span class="n">TokPrec</span><span class="o">+</span><span class="mi">1</span><span class="p">,</span> <span class="n">RHS</span><span class="p">);</span>
+      <span class="k">if</span> <span class="p">(</span><span class="n">RHS</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="p">}</span>
+    
+    <span class="c1">// Merge LHS/RHS.</span>
+    <span class="n">LHS</span> <span class="o">=</span> <span class="k">new</span> <span class="n">BinaryExprAST</span><span class="p">(</span><span class="n">BinOp</span><span class="p">,</span> <span class="n">LHS</span><span class="p">,</span> <span class="n">RHS</span><span class="p">);</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="c1">/// expression</span>
+<span class="c1">///   ::= primary binoprhs</span>
+<span class="c1">///</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseExpression</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">LHS</span> <span class="o">=</span> <span class="n">ParsePrimary</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">LHS</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="k">return</span> <span class="n">ParseBinOpRHS</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">LHS</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="c1">/// prototype</span>
+<span class="c1">///   ::= id '(' id* ')'</span>
+<span class="k">static</span> <span class="n">PrototypeAST</span> <span class="o">*</span><span class="nf">ParsePrototype</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="n">tok_identifier</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected function name in prototype"</span><span class="p">);</span>
+
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">FnName</span> <span class="o">=</span> <span class="n">IdentifierStr</span><span class="p">;</span>
+  <span class="n">getNextToken</span><span class="p">();</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">'('</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected '(' in prototype"</span><span class="p">);</span>
+  
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="n">ArgNames</span><span class="p">;</span>
+  <span class="k">while</span> <span class="p">(</span><span class="n">getNextToken</span><span class="p">()</span> <span class="o">==</span> <span class="n">tok_identifier</span><span class="p">)</span>
+    <span class="n">ArgNames</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="n">IdentifierStr</span><span class="p">);</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">')'</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected ')' in prototype"</span><span class="p">);</span>
+  
+  <span class="c1">// success.</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat ')'.</span>
+  
+  <span class="k">return</span> <span class="k">new</span> <span class="n">PrototypeAST</span><span class="p">(</span><span class="n">FnName</span><span class="p">,</span> <span class="n">ArgNames</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="c1">/// definition ::= 'def' prototype expression</span>
+<span class="k">static</span> <span class="n">FunctionAST</span> <span class="o">*</span><span class="nf">ParseDefinition</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat def.</span>
+  <span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">Proto</span> <span class="o">=</span> <span class="n">ParsePrototype</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Proto</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">ExprAST</span> <span class="o">*</span><span class="n">E</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">())</span>
+    <span class="k">return</span> <span class="k">new</span> <span class="n">FunctionAST</span><span class="p">(</span><span class="n">Proto</span><span class="p">,</span> <span class="n">E</span><span class="p">);</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// toplevelexpr ::= expression</span>
+<span class="k">static</span> <span class="n">FunctionAST</span> <span class="o">*</span><span class="nf">ParseTopLevelExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">ExprAST</span> <span class="o">*</span><span class="n">E</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">())</span> <span class="p">{</span>
+    <span class="c1">// Make an anonymous proto.</span>
+    <span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">Proto</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PrototypeAST</span><span class="p">(</span><span class="s">""</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span><span class="p">());</span>
+    <span class="k">return</span> <span class="k">new</span> <span class="n">FunctionAST</span><span class="p">(</span><span class="n">Proto</span><span class="p">,</span> <span class="n">E</span><span class="p">);</span>
+  <span class="p">}</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// external ::= 'extern' prototype</span>
+<span class="k">static</span> <span class="n">PrototypeAST</span> <span class="o">*</span><span class="nf">ParseExtern</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat extern.</span>
+  <span class="k">return</span> <span class="n">ParsePrototype</span><span class="p">();</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Code Generation</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="k">static</span> <span class="n">Module</span> <span class="o">*</span><span class="n">TheModule</span><span class="p">;</span>
+<span class="k">static</span> <span class="n">IRBuilder</span><span class="o"><></span> <span class="n">Builder</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">());</span>
+<span class="k">static</span> <span class="n">std</span><span class="o">::</span><span class="n">map</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="p">,</span> <span class="n">Value</span><span class="o">*></span> <span class="n">NamedValues</span><span class="p">;</span>
+<span class="k">static</span> <span class="n">FunctionPassManager</span> <span class="o">*</span><span class="n">TheFPM</span><span class="p">;</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="nf">ErrorV</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">Error</span><span class="p">(</span><span class="n">Str</span><span class="p">);</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">NumberExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="n">ConstantFP</span><span class="o">::</span><span class="n">get</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="n">APFloat</span><span class="p">(</span><span class="n">Val</span><span class="p">));</span>
+<span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">VariableExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Look this variable up in the function.</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">V</span> <span class="o">=</span> <span class="n">NamedValues</span><span class="p">[</span><span class="n">Name</span><span class="p">];</span>
+  <span class="k">return</span> <span class="n">V</span> <span class="o">?</span> <span class="n">V</span> <span class="o">:</span> <span class="n">ErrorV</span><span class="p">(</span><span class="s">"Unknown variable name"</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">BinaryExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">L</span> <span class="o">=</span> <span class="n">LHS</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">R</span> <span class="o">=</span> <span class="n">RHS</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">L</span> <span class="o">==</span> <span class="mi">0</span> <span class="o">||</span> <span class="n">R</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="k">switch</span> <span class="p">(</span><span class="n">Op</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">case</span> <span class="sc">'+'</span>: <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFAdd</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"addtmp"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="sc">'-'</span>: <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFSub</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"subtmp"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="sc">'*'</span>: <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFMul</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"multmp"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="sc">'<'</span>:
+    <span class="n">L</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFCmpULT</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"cmptmp"</span><span class="p">);</span>
+    <span class="c1">// Convert bool 0/1 to double 0.0 or 1.0</span>
+    <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateUIToFP</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()),</span>
+                                <span class="s">"booltmp"</span><span class="p">);</span>
+  <span class="nl">default:</span> <span class="k">return</span> <span class="nf">ErrorV</span><span class="p">(</span><span class="s">"invalid binary operator"</span><span class="p">);</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">CallExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Look up the name in the global module table.</span>
+  <span class="n">Function</span> <span class="o">*</span><span class="n">CalleeF</span> <span class="o">=</span> <span class="n">TheModule</span><span class="o">-></span><span class="n">getFunction</span><span class="p">(</span><span class="n">Callee</span><span class="p">);</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CalleeF</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorV</span><span class="p">(</span><span class="s">"Unknown function referenced"</span><span class="p">);</span>
+  
+  <span class="c1">// If argument mismatch error.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CalleeF</span><span class="o">-></span><span class="n">arg_size</span><span class="p">()</span> <span class="o">!=</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">())</span>
+    <span class="k">return</span> <span class="n">ErrorV</span><span class="p">(</span><span class="s">"Incorrect # arguments passed"</span><span class="p">);</span>
+
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">Value</span><span class="o">*></span> <span class="n">ArgsV</span><span class="p">;</span>
+  <span class="k">for</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">e</span> <span class="o">=</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">();</span> <span class="n">i</span> <span class="o">!=</span> <span class="n">e</span><span class="p">;</span> <span class="o">++</span><span class="n">i</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">ArgsV</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="n">Args</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">-></span><span class="n">Codegen</span><span class="p">());</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">ArgsV</span><span class="p">.</span><span class="n">back</span><span class="p">()</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="p">}</span>
+  
+  <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateCall</span><span class="p">(</span><span class="n">CalleeF</span><span class="p">,</span> <span class="n">ArgsV</span><span class="p">,</span> <span class="s">"calltmp"</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">IfExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">CondV</span> <span class="o">=</span> <span class="n">Cond</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CondV</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="c1">// Convert condition to a bool by comparing equal to 0.0.</span>
+  <span class="n">CondV</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFCmpONE</span><span class="p">(</span><span class="n">CondV</span><span class="p">,</span> 
+                              <span class="n">ConstantFP</span><span class="o">::</span><span class="n">get</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="n">APFloat</span><span class="p">(</span><span class="mf">0.0</span><span class="p">)),</span>
+                                <span class="s">"ifcond"</span><span class="p">);</span>
+  
+  <span class="n">Function</span> <span class="o">*</span><span class="n">TheFunction</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">GetInsertBlock</span><span class="p">()</span><span class="o">-></span><span class="n">getParent</span><span class="p">();</span>
+  
+  <span class="c1">// Create blocks for the then and else cases.  Insert the 'then' block at the</span>
+  <span class="c1">// end of the function.</span>
+  <span class="n">BasicBlock</span> <span class="o">*</span><span class="n">ThenBB</span> <span class="o">=</span> <span class="n">BasicBlock</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="s">"then"</span><span class="p">,</span> <span class="n">TheFunction</span><span class="p">);</span>
+  <span class="n">BasicBlock</span> <span class="o">*</span><span class="n">ElseBB</span> <span class="o">=</span> <span class="n">BasicBlock</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="s">"else"</span><span class="p">);</span>
+  <span class="n">BasicBlock</span> <span class="o">*</span><span class="n">MergeBB</span> <span class="o">=</span> <span class="n">BasicBlock</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="s">"ifcont"</span><span class="p">);</span>
+  
+  <span class="n">Builder</span><span class="p">.</span><span class="n">CreateCondBr</span><span class="p">(</span><span class="n">CondV</span><span class="p">,</span> <span class="n">ThenBB</span><span class="p">,</span> <span class="n">ElseBB</span><span class="p">);</span>
+  
+  <span class="c1">// Emit then value.</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">SetInsertPoint</span><span class="p">(</span><span class="n">ThenBB</span><span class="p">);</span>
+  
+  <span class="n">Value</span> <span class="o">*</span><span class="n">ThenV</span> <span class="o">=</span> <span class="n">Then</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">ThenV</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="n">Builder</span><span class="p">.</span><span class="n">CreateBr</span><span class="p">(</span><span class="n">MergeBB</span><span class="p">);</span>
+  <span class="c1">// Codegen of 'Then' can change the current block, update ThenBB for the PHI.</span>
+  <span class="n">ThenBB</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">GetInsertBlock</span><span class="p">();</span>
+  
+  <span class="c1">// Emit else block.</span>
+  <span class="n">TheFunction</span><span class="o">-></span><span class="n">getBasicBlockList</span><span class="p">().</span><span class="n">push_back</span><span class="p">(</span><span class="n">ElseBB</span><span class="p">);</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">SetInsertPoint</span><span class="p">(</span><span class="n">ElseBB</span><span class="p">);</span>
+  
+  <span class="n">Value</span> <span class="o">*</span><span class="n">ElseV</span> <span class="o">=</span> <span class="n">Else</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">ElseV</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="n">Builder</span><span class="p">.</span><span class="n">CreateBr</span><span class="p">(</span><span class="n">MergeBB</span><span class="p">);</span>
+  <span class="c1">// Codegen of 'Else' can change the current block, update ElseBB for the PHI.</span>
+  <span class="n">ElseBB</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">GetInsertBlock</span><span class="p">();</span>
+  
+  <span class="c1">// Emit merge block.</span>
+  <span class="n">TheFunction</span><span class="o">-></span><span class="n">getBasicBlockList</span><span class="p">().</span><span class="n">push_back</span><span class="p">(</span><span class="n">MergeBB</span><span class="p">);</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">SetInsertPoint</span><span class="p">(</span><span class="n">MergeBB</span><span class="p">);</span>
+  <span class="n">PHINode</span> <span class="o">*</span><span class="n">PN</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreatePHI</span><span class="p">(</span><span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()),</span> <span class="mi">2</span><span class="p">,</span>
+                                  <span class="s">"iftmp"</span><span class="p">);</span>
+  
+  <span class="n">PN</span><span class="o">-></span><span class="n">addIncoming</span><span class="p">(</span><span class="n">ThenV</span><span class="p">,</span> <span class="n">ThenBB</span><span class="p">);</span>
+  <span class="n">PN</span><span class="o">-></span><span class="n">addIncoming</span><span class="p">(</span><span class="n">ElseV</span><span class="p">,</span> <span class="n">ElseBB</span><span class="p">);</span>
+  <span class="k">return</span> <span class="n">PN</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">ForExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Output this as:</span>
+  <span class="c1">//   ...</span>
+  <span class="c1">//   start = startexpr</span>
+  <span class="c1">//   goto loop</span>
+  <span class="c1">// loop: </span>
+  <span class="c1">//   variable = phi [start, loopheader], [nextvariable, loopend]</span>
+  <span class="c1">//   ...</span>
+  <span class="c1">//   bodyexpr</span>
+  <span class="c1">//   ...</span>
+  <span class="c1">// loopend:</span>
+  <span class="c1">//   step = stepexpr</span>
+  <span class="c1">//   nextvariable = variable + step</span>
+  <span class="c1">//   endcond = endexpr</span>
+  <span class="c1">//   br endcond, loop, endloop</span>
+  <span class="c1">// outloop:</span>
+  
+  <span class="c1">// Emit the start code first, without 'variable' in scope.</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">StartVal</span> <span class="o">=</span> <span class="n">Start</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">StartVal</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="c1">// Make the new basic block for the loop header, inserting after current</span>
+  <span class="c1">// block.</span>
+  <span class="n">Function</span> <span class="o">*</span><span class="n">TheFunction</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">GetInsertBlock</span><span class="p">()</span><span class="o">-></span><span class="n">getParent</span><span class="p">();</span>
+  <span class="n">BasicBlock</span> <span class="o">*</span><span class="n">PreheaderBB</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">GetInsertBlock</span><span class="p">();</span>
+  <span class="n">BasicBlock</span> <span class="o">*</span><span class="n">LoopBB</span> <span class="o">=</span> <span class="n">BasicBlock</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="s">"loop"</span><span class="p">,</span> <span class="n">TheFunction</span><span class="p">);</span>
+  
+  <span class="c1">// Insert an explicit fall through from the current block to the LoopBB.</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">CreateBr</span><span class="p">(</span><span class="n">LoopBB</span><span class="p">);</span>
+
+  <span class="c1">// Start insertion in LoopBB.</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">SetInsertPoint</span><span class="p">(</span><span class="n">LoopBB</span><span class="p">);</span>
+  
+  <span class="c1">// Start the PHI node with an entry for Start.</span>
+  <span class="n">PHINode</span> <span class="o">*</span><span class="n">Variable</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreatePHI</span><span class="p">(</span><span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()),</span> <span class="mi">2</span><span class="p">,</span> <span class="n">VarName</span><span class="p">.</span><span class="n">c_str</span><span class="p">());</span>
+  <span class="n">Variable</span><span class="o">-></span><span class="n">addIncoming</span><span class="p">(</span><span class="n">StartVal</span><span class="p">,</span> <span class="n">PreheaderBB</span><span class="p">);</span>
+  
+  <span class="c1">// Within the loop, the variable is defined equal to the PHI node.  If it</span>
+  <span class="c1">// shadows an existing variable, we have to restore it, so save it now.</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">OldVal</span> <span class="o">=</span> <span class="n">NamedValues</span><span class="p">[</span><span class="n">VarName</span><span class="p">];</span>
+  <span class="n">NamedValues</span><span class="p">[</span><span class="n">VarName</span><span class="p">]</span> <span class="o">=</span> <span class="n">Variable</span><span class="p">;</span>
+  
+  <span class="c1">// Emit the body of the loop.  This, like any other expr, can change the</span>
+  <span class="c1">// current BB.  Note that we ignore the value computed by the body, but don't</span>
+  <span class="c1">// allow an error.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Body</span><span class="o">-></span><span class="n">Codegen</span><span class="p">()</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
+    <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="c1">// Emit the step value.</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">StepVal</span><span class="p">;</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Step</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">StepVal</span> <span class="o">=</span> <span class="n">Step</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">StepVal</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+    <span class="c1">// If not specified, use 1.0.</span>
+    <span class="n">StepVal</span> <span class="o">=</span> <span class="n">ConstantFP</span><span class="o">::</span><span class="n">get</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="n">APFloat</span><span class="p">(</span><span class="mf">1.0</span><span class="p">));</span>
+  <span class="p">}</span>
+  
+  <span class="n">Value</span> <span class="o">*</span><span class="n">NextVar</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFAdd</span><span class="p">(</span><span class="n">Variable</span><span class="p">,</span> <span class="n">StepVal</span><span class="p">,</span> <span class="s">"nextvar"</span><span class="p">);</span>
+
+  <span class="c1">// Compute the end condition.</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">EndCond</span> <span class="o">=</span> <span class="n">End</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">EndCond</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="n">EndCond</span><span class="p">;</span>
+  
+  <span class="c1">// Convert condition to a bool by comparing equal to 0.0.</span>
+  <span class="n">EndCond</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFCmpONE</span><span class="p">(</span><span class="n">EndCond</span><span class="p">,</span> 
+                              <span class="n">ConstantFP</span><span class="o">::</span><span class="n">get</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="n">APFloat</span><span class="p">(</span><span class="mf">0.0</span><span class="p">)),</span>
+                                  <span class="s">"loopcond"</span><span class="p">);</span>
+  
+  <span class="c1">// Create the "after loop" block and insert it.</span>
+  <span class="n">BasicBlock</span> <span class="o">*</span><span class="n">LoopEndBB</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">GetInsertBlock</span><span class="p">();</span>
+  <span class="n">BasicBlock</span> <span class="o">*</span><span class="n">AfterBB</span> <span class="o">=</span> <span class="n">BasicBlock</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="s">"afterloop"</span><span class="p">,</span> <span class="n">TheFunction</span><span class="p">);</span>
+  
+  <span class="c1">// Insert the conditional branch into the end of LoopEndBB.</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">CreateCondBr</span><span class="p">(</span><span class="n">EndCond</span><span class="p">,</span> <span class="n">LoopBB</span><span class="p">,</span> <span class="n">AfterBB</span><span class="p">);</span>
+  
+  <span class="c1">// Any new code will be inserted in AfterBB.</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">SetInsertPoint</span><span class="p">(</span><span class="n">AfterBB</span><span class="p">);</span>
+  
+  <span class="c1">// Add a new entry to the PHI node for the backedge.</span>
+  <span class="n">Variable</span><span class="o">-></span><span class="n">addIncoming</span><span class="p">(</span><span class="n">NextVar</span><span class="p">,</span> <span class="n">LoopEndBB</span><span class="p">);</span>
+  
+  <span class="c1">// Restore the unshadowed variable.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">OldVal</span><span class="p">)</span>
+    <span class="n">NamedValues</span><span class="p">[</span><span class="n">VarName</span><span class="p">]</span> <span class="o">=</span> <span class="n">OldVal</span><span class="p">;</span>
+  <span class="k">else</span>
+    <span class="n">NamedValues</span><span class="p">.</span><span class="n">erase</span><span class="p">(</span><span class="n">VarName</span><span class="p">);</span>
+
+  
+  <span class="c1">// for expr always returns 0.0.</span>
+  <span class="k">return</span> <span class="n">Constant</span><span class="o">::</span><span class="n">getNullValue</span><span class="p">(</span><span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()));</span>
+<span class="p">}</span>
+
+<span class="n">Function</span> <span class="o">*</span><span class="n">PrototypeAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Make the function type:  double(double,double) etc.</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">Type</span><span class="o">*></span> <span class="n">Doubles</span><span class="p">(</span><span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">(),</span>
+                             <span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()));</span>
+  <span class="n">FunctionType</span> <span class="o">*</span><span class="n">FT</span> <span class="o">=</span> <span class="n">FunctionType</span><span class="o">::</span><span class="n">get</span><span class="p">(</span><span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()),</span>
+                                       <span class="n">Doubles</span><span class="p">,</span> <span class="nb">false</span><span class="p">);</span>
+  
+  <span class="n">Function</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">Function</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">FT</span><span class="p">,</span> <span class="n">Function</span><span class="o">::</span><span class="n">ExternalLinkage</span><span class="p">,</span> <span class="n">Name</span><span class="p">,</span> <span class="n">TheModule</span><span class="p">);</span>
+  
+  <span class="c1">// If F conflicted, there was already something named 'Name'.  If it has a</span>
+  <span class="c1">// body, don't allow redefinition or reextern.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">F</span><span class="o">-></span><span class="n">getName</span><span class="p">()</span> <span class="o">!=</span> <span class="n">Name</span><span class="p">)</span> <span class="p">{</span>
+    <span class="c1">// Delete the one we just made and get the existing one.</span>
+    <span class="n">F</span><span class="o">-></span><span class="n">eraseFromParent</span><span class="p">();</span>
+    <span class="n">F</span> <span class="o">=</span> <span class="n">TheModule</span><span class="o">-></span><span class="n">getFunction</span><span class="p">(</span><span class="n">Name</span><span class="p">);</span>
+    
+    <span class="c1">// If F already has a body, reject this.</span>
+    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">F</span><span class="o">-></span><span class="n">empty</span><span class="p">())</span> <span class="p">{</span>
+      <span class="n">ErrorF</span><span class="p">(</span><span class="s">"redefinition of function"</span><span class="p">);</span>
+      <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="p">}</span>
+    
+    <span class="c1">// If F took a different number of args, reject.</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">F</span><span class="o">-></span><span class="n">arg_size</span><span class="p">()</span> <span class="o">!=</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">())</span> <span class="p">{</span>
+      <span class="n">ErrorF</span><span class="p">(</span><span class="s">"redefinition of function with different # args"</span><span class="p">);</span>
+      <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="p">}</span>
+  <span class="p">}</span>
+  
+  <span class="c1">// Set names for all arguments.</span>
+  <span class="kt">unsigned</span> <span class="n">Idx</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="k">for</span> <span class="p">(</span><span class="n">Function</span><span class="o">::</span><span class="n">arg_iterator</span> <span class="n">AI</span> <span class="o">=</span> <span class="n">F</span><span class="o">-></span><span class="n">arg_begin</span><span class="p">();</span> <span class="n">Idx</span> <span class="o">!=</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">();</span>
+       <span class="o">++</span><span class="n">AI</span><span class="p">,</span> <span class="o">++</span><span class="n">Idx</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">AI</span><span class="o">-></span><span class="n">setName</span><span class="p">(</span><span class="n">Args</span><span class="p">[</span><span class="n">Idx</span><span class="p">]);</span>
+    
+    <span class="c1">// Add arguments to variable symbol table.</span>
+    <span class="n">NamedValues</span><span class="p">[</span><span class="n">Args</span><span class="p">[</span><span class="n">Idx</span><span class="p">]]</span> <span class="o">=</span> <span class="n">AI</span><span class="p">;</span>
+  <span class="p">}</span>
+  
+  <span class="k">return</span> <span class="n">F</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="n">Function</span> <span class="o">*</span><span class="n">FunctionAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">NamedValues</span><span class="p">.</span><span class="n">clear</span><span class="p">();</span>
+  
+  <span class="n">Function</span> <span class="o">*</span><span class="n">TheFunction</span> <span class="o">=</span> <span class="n">Proto</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">TheFunction</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
+    <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="c1">// Create a new basic block to start insertion into.</span>
+  <span class="n">BasicBlock</span> <span class="o">*</span><span class="n">BB</span> <span class="o">=</span> <span class="n">BasicBlock</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="s">"entry"</span><span class="p">,</span> <span class="n">TheFunction</span><span class="p">);</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">SetInsertPoint</span><span class="p">(</span><span class="n">BB</span><span class="p">);</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">Value</span> <span class="o">*</span><span class="n">RetVal</span> <span class="o">=</span> <span class="n">Body</span><span class="o">-></span><span class="n">Codegen</span><span class="p">())</span> <span class="p">{</span>
+    <span class="c1">// Finish off the function.</span>
+    <span class="n">Builder</span><span class="p">.</span><span class="n">CreateRet</span><span class="p">(</span><span class="n">RetVal</span><span class="p">);</span>
+
+    <span class="c1">// Validate the generated code, checking for consistency.</span>
+    <span class="n">verifyFunction</span><span class="p">(</span><span class="o">*</span><span class="n">TheFunction</span><span class="p">);</span>
+
+    <span class="c1">// Optimize the function.</span>
+    <span class="n">TheFPM</span><span class="o">-></span><span class="n">run</span><span class="p">(</span><span class="o">*</span><span class="n">TheFunction</span><span class="p">);</span>
+    
+    <span class="k">return</span> <span class="n">TheFunction</span><span class="p">;</span>
+  <span class="p">}</span>
+  
+  <span class="c1">// Error reading body, remove function.</span>
+  <span class="n">TheFunction</span><span class="o">-></span><span class="n">eraseFromParent</span><span class="p">();</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Top-Level parsing and JIT Driver</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="k">static</span> <span class="n">ExecutionEngine</span> <span class="o">*</span><span class="n">TheExecutionEngine</span><span class="p">;</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">HandleDefinition</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">FunctionAST</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">ParseDefinition</span><span class="p">())</span> <span class="p">{</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">Function</span> <span class="o">*</span><span class="n">LF</span> <span class="o">=</span> <span class="n">F</span><span class="o">-></span><span class="n">Codegen</span><span class="p">())</span> <span class="p">{</span>
+      <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Read function definition:"</span><span class="p">);</span>
+      <span class="n">LF</span><span class="o">-></span><span class="n">dump</span><span class="p">();</span>
+    <span class="p">}</span>
+  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+    <span class="c1">// Skip token for error recovery.</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">HandleExtern</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">P</span> <span class="o">=</span> <span class="n">ParseExtern</span><span class="p">())</span> <span class="p">{</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">Function</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">P</span><span class="o">-></span><span class="n">Codegen</span><span class="p">())</span> <span class="p">{</span>
+      <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Read extern: "</span><span class="p">);</span>
+      <span class="n">F</span><span class="o">-></span><span class="n">dump</span><span class="p">();</span>
+    <span class="p">}</span>
+  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+    <span class="c1">// Skip token for error recovery.</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">HandleTopLevelExpression</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Evaluate a top-level expression into an anonymous function.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">FunctionAST</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">ParseTopLevelExpr</span><span class="p">())</span> <span class="p">{</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">Function</span> <span class="o">*</span><span class="n">LF</span> <span class="o">=</span> <span class="n">F</span><span class="o">-></span><span class="n">Codegen</span><span class="p">())</span> <span class="p">{</span>
+      <span class="c1">// JIT the function, returning a function pointer.</span>
+      <span class="kt">void</span> <span class="o">*</span><span class="n">FPtr</span> <span class="o">=</span> <span class="n">TheExecutionEngine</span><span class="o">-></span><span class="n">getPointerToFunction</span><span class="p">(</span><span class="n">LF</span><span class="p">);</span>
+      
+      <span class="c1">// Cast it to the right type (takes no arguments, returns a double) so we</span>
+      <span class="c1">// can call it as a native function.</span>
+      <span class="kt">double</span> <span class="p">(</span><span class="o">*</span><span class="n">FP</span><span class="p">)()</span> <span class="o">=</span> <span class="p">(</span><span class="kt">double</span> <span class="p">(</span><span class="o">*</span><span class="p">)())(</span><span class="kt">intptr_t</span><span class="p">)</span><span class="n">FPtr</span><span class="p">;</span>
+      <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Evaluated to %f</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">FP</span><span class="p">());</span>
+    <span class="p">}</span>
+  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+    <span class="c1">// Skip token for error recovery.</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="c1">/// top ::= definition | external | expression | ';'</span>
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">MainLoop</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"ready> "</span><span class="p">);</span>
+    <span class="k">switch</span> <span class="p">(</span><span class="n">CurTok</span><span class="p">)</span> <span class="p">{</span>
+    <span class="k">case</span> <span class="n">tok_eof</span>:    <span class="k">return</span><span class="p">;</span>
+    <span class="k">case</span> <span class="sc">';'</span>:        <span class="n">getNextToken</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>  <span class="c1">// ignore top-level semicolons.</span>
+    <span class="k">case</span> <span class="n">tok_def</span>:    <span class="n">HandleDefinition</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>
+    <span class="k">case</span> <span class="n">tok_extern</span>: <span class="n">HandleExtern</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>
+    <span class="nl">default:</span>         <span class="n">HandleTopLevelExpression</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>
+    <span class="p">}</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// "Library" functions that can be "extern'd" from user code.</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="c1">/// putchard - putchar that takes a double and returns 0.</span>
+<span class="k">extern</span> <span class="s">"C"</span> 
+<span class="kt">double</span> <span class="n">putchard</span><span class="p">(</span><span class="kt">double</span> <span class="n">X</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">putchar</span><span class="p">((</span><span class="kt">char</span><span class="p">)</span><span class="n">X</span><span class="p">);</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Main driver code.</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="kt">int</span> <span class="n">main</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">InitializeNativeTarget</span><span class="p">();</span>
+  <span class="n">LLVMContext</span> <span class="o">&</span><span class="n">Context</span> <span class="o">=</span> <span class="n">getGlobalContext</span><span class="p">();</span>
+
+  <span class="c1">// Install standard binary operators.</span>
+  <span class="c1">// 1 is lowest precedence.</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'<'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">10</span><span class="p">;</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'+'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">20</span><span class="p">;</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'-'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">20</span><span class="p">;</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'*'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">40</span><span class="p">;</span>  <span class="c1">// highest.</span>
+
+  <span class="c1">// Prime the first token.</span>
+  <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"ready> "</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>
+
+  <span class="c1">// Make the module, which holds all the code.</span>
+  <span class="n">TheModule</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Module</span><span class="p">(</span><span class="s">"my cool jit"</span><span class="p">,</span> <span class="n">Context</span><span class="p">);</span>
+
+  <span class="c1">// Create the JIT.  This takes ownership of the module.</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">ErrStr</span><span class="p">;</span>
+  <span class="n">TheExecutionEngine</span> <span class="o">=</span> <span class="n">EngineBuilder</span><span class="p">(</span><span class="n">TheModule</span><span class="p">).</span><span class="n">setErrorStr</span><span class="p">(</span><span class="o">&</span><span class="n">ErrStr</span><span class="p">).</span><span class="n">create</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">TheExecutionEngine</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Could not create ExecutionEngine: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">ErrStr</span><span class="p">.</span><span class="n">c_str</span><span class="p">());</span>
+    <span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>
+  <span class="p">}</span>
+
+  <span class="n">FunctionPassManager</span> <span class="n">OurFPM</span><span class="p">(</span><span class="n">TheModule</span><span class="p">);</span>
+
+  <span class="c1">// Set up the optimizer pipeline.  Start with registering info about how the</span>
+  <span class="c1">// target lays out data structures.</span>
+  <span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="k">new</span> <span class="n">DataLayout</span><span class="p">(</span><span class="o">*</span><span class="n">TheExecutionEngine</span><span class="o">-></span><span class="n">getDataLayout</span><span class="p">()));</span>
+  <span class="c1">// Provide basic AliasAnalysis support for GVN.</span>
+  <span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createBasicAliasAnalysisPass</span><span class="p">());</span>
+  <span class="c1">// Do simple "peephole" optimizations and bit-twiddling optzns.</span>
+  <span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createInstructionCombiningPass</span><span class="p">());</span>
+  <span class="c1">// Reassociate expressions.</span>
+  <span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createReassociatePass</span><span class="p">());</span>
+  <span class="c1">// Eliminate Common SubExpressions.</span>
+  <span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createGVNPass</span><span class="p">());</span>
+  <span class="c1">// Simplify the control flow graph (deleting unreachable blocks, etc).</span>
+  <span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createCFGSimplificationPass</span><span class="p">());</span>
+
+  <span class="n">OurFPM</span><span class="p">.</span><span class="n">doInitialization</span><span class="p">();</span>
+
+  <span class="c1">// Set the global so the code gen can use this.</span>
+  <span class="n">TheFPM</span> <span class="o">=</span> <span class="o">&</span><span class="n">OurFPM</span><span class="p">;</span>
+
+  <span class="c1">// Run the main "interpreter loop" now.</span>
+  <span class="n">MainLoop</span><span class="p">();</span>
+
+  <span class="n">TheFPM</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="c1">// Print out all of the generated code.</span>
+  <span class="n">TheModule</span><span class="o">-></span><span class="n">dump</span><span class="p">();</span>
+
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p><a class="reference external" href="LangImpl6.html">Next: Extending the language: user-defined operators</a></p>
+</div>
+</div>
+
+
+          </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="LangImpl6.html" title="6. Kaleidoscope: Extending the Language: User-defined Operators"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="LangImpl4.html" title="4. Kaleidoscope: Adding JIT and Optimizer Support"
+             >previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="../index.html">Documentation</a>»</li>
+
+          <li><a href="index.html" >LLVM Tutorial: Table of Contents</a> »</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        © Copyright 2003-2013, LLVM Project.
+      Last updated on 2014-06-16.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/3.4.2/docs/tutorial/LangImpl6.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/3.4.2/docs/tutorial/LangImpl6.html?rev=211020&view=auto
==============================================================================
--- www-releases/trunk/3.4.2/docs/tutorial/LangImpl6.html (added)
+++ www-releases/trunk/3.4.2/docs/tutorial/LangImpl6.html Mon Jun 16 08:19:07 2014
@@ -0,0 +1,1769 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>6. Kaleidoscope: Extending the Language: User-defined Operators — LLVM 3.4 documentation</title>
+    
+    <link rel="stylesheet" href="../_static/llvm-theme.css" type="text/css" />
+    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../',
+        VERSION:     '3.4',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../_static/jquery.js"></script>
+    <script type="text/javascript" src="../_static/underscore.js"></script>
+    <script type="text/javascript" src="../_static/doctools.js"></script>
+    <link rel="top" title="LLVM 3.4 documentation" href="../index.html" />
+    <link rel="up" title="LLVM Tutorial: Table of Contents" href="index.html" />
+    <link rel="next" title="7. Kaleidoscope: Extending the Language: Mutable Variables" href="LangImpl7.html" />
+    <link rel="prev" title="5. Kaleidoscope: Extending the Language: Control Flow" href="LangImpl5.html" />
+<style type="text/css">
+  table.right { float: right; margin-left: 20px; }
+  table.right td { border: 1px solid #ccc; }
+</style>
+
+  </head>
+  <body>
+<div class="logo">
+  <a href="../index.html">
+    <img src="../_static/logo.png"
+         alt="LLVM Logo" width="250" height="88"/></a>
+</div>
+
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="LangImpl7.html" title="7. Kaleidoscope: Extending the Language: Mutable Variables"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="LangImpl5.html" title="5. Kaleidoscope: Extending the Language: Control Flow"
+             accesskey="P">previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="../index.html">Documentation</a>»</li>
+
+          <li><a href="index.html" accesskey="U">LLVM Tutorial: Table of Contents</a> »</li> 
+      </ul>
+    </div>
+
+
+    <div class="document">
+      <div class="documentwrapper">
+          <div class="body">
+            
+  <div class="section" id="kaleidoscope-extending-the-language-user-defined-operators">
+<h1>6. Kaleidoscope: Extending the Language: User-defined Operators<a class="headerlink" href="#kaleidoscope-extending-the-language-user-defined-operators" title="Permalink to this headline">¶</a></h1>
+<div class="contents local topic" id="contents">
+<ul class="simple">
+<li><a class="reference internal" href="#chapter-6-introduction" id="id1">Chapter 6 Introduction</a></li>
+<li><a class="reference internal" href="#user-defined-operators-the-idea" id="id2">User-defined Operators: the Idea</a></li>
+<li><a class="reference internal" href="#user-defined-binary-operators" id="id3">User-defined Binary Operators</a></li>
+<li><a class="reference internal" href="#user-defined-unary-operators" id="id4">User-defined Unary Operators</a></li>
+<li><a class="reference internal" href="#kicking-the-tires" id="id5">Kicking the Tires</a></li>
+<li><a class="reference internal" href="#full-code-listing" id="id6">Full Code Listing</a></li>
+</ul>
+</div>
+<div class="section" id="chapter-6-introduction">
+<h2><a class="toc-backref" href="#id1">6.1. Chapter 6 Introduction</a><a class="headerlink" href="#chapter-6-introduction" title="Permalink to this headline">¶</a></h2>
+<p>Welcome to Chapter 6 of the “<a class="reference external" href="index.html">Implementing a language with
+LLVM</a>” tutorial. At this point in our tutorial, we now
+have a fully functional language that is fairly minimal, but also
+useful. There is still one big problem with it, however. Our language
+doesn’t have many useful operators (like division, logical negation, or
+even any comparisons besides less-than).</p>
+<p>This chapter of the tutorial takes a wild digression into adding
+user-defined operators to the simple and beautiful Kaleidoscope
+language. This digression now gives us a simple and ugly language in
+some ways, but also a powerful one at the same time. One of the great
+things about creating your own language is that you get to decide what
+is good or bad. In this tutorial we’ll assume that it is okay to use
+this as a way to show some interesting parsing techniques.</p>
+<p>At the end of this tutorial, we’ll run through an example Kaleidoscope
+application that <a class="reference external" href="#example">renders the Mandelbrot set</a>. This gives an
+example of what you can build with Kaleidoscope and its feature set.</p>
+</div>
+<div class="section" id="user-defined-operators-the-idea">
+<h2><a class="toc-backref" href="#id2">6.2. User-defined Operators: the Idea</a><a class="headerlink" href="#user-defined-operators-the-idea" title="Permalink to this headline">¶</a></h2>
+<p>The “operator overloading” that we will add to Kaleidoscope is more
+general than languages like C++. In C++, you are only allowed to
+redefine existing operators: you can’t programatically change the
+grammar, introduce new operators, change precedence levels, etc. In this
+chapter, we will add this capability to Kaleidoscope, which will let the
+user round out the set of operators that are supported.</p>
+<p>The point of going into user-defined operators in a tutorial like this
+is to show the power and flexibility of using a hand-written parser.
+Thus far, the parser we have been implementing uses recursive descent
+for most parts of the grammar and operator precedence parsing for the
+expressions. See <a class="reference external" href="LangImpl2.html">Chapter 2</a> for details. Without
+using operator precedence parsing, it would be very difficult to allow
+the programmer to introduce new operators into the grammar: the grammar
+is dynamically extensible as the JIT runs.</p>
+<p>The two specific features we’ll add are programmable unary operators
+(right now, Kaleidoscope has no unary operators at all) as well as
+binary operators. An example of this is:</p>
+<div class="highlight-python"><pre># Logical unary not.
+def unary!(v)
+  if v then
+    0
+  else
+    1;
+
+# Define > with the same precedence as <.
+def binary> 10 (LHS RHS)
+  RHS < LHS;
+
+# Binary "logical or", (note that it does not "short circuit")
+def binary| 5 (LHS RHS)
+  if LHS then
+    1
+  else if RHS then
+    1
+  else
+    0;
+
+# Define = with slightly lower precedence than relationals.
+def binary= 9 (LHS RHS)
+  !(LHS < RHS | LHS > RHS);</pre>
+</div>
+<p>Many languages aspire to being able to implement their standard runtime
+library in the language itself. In Kaleidoscope, we can implement
+significant parts of the language in the library!</p>
+<p>We will break down implementation of these features into two parts:
+implementing support for user-defined binary operators and adding unary
+operators.</p>
+</div>
+<div class="section" id="user-defined-binary-operators">
+<h2><a class="toc-backref" href="#id3">6.3. User-defined Binary Operators</a><a class="headerlink" href="#user-defined-binary-operators" title="Permalink to this headline">¶</a></h2>
+<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>
+<div class="highlight-c++"><div class="highlight"><pre><span class="k">enum</span> <span class="n">Token</span> <span class="p">{</span>
+  <span class="p">...</span>
+  <span class="c1">// operators</span>
+  <span class="n">tok_binary</span> <span class="o">=</span> <span class="o">-</span><span class="mi">11</span><span class="p">,</span> <span class="n">tok_unary</span> <span class="o">=</span> <span class="o">-</span><span class="mi">12</span>
+<span class="p">};</span>
+<span class="p">...</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="n">gettok</span><span class="p">()</span> <span class="p">{</span>
+<span class="p">...</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"for"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_for</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"in"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_in</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"binary"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_binary</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"unary"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_unary</span><span class="p">;</span>
+    <span class="k">return</span> <span class="n">tok_identifier</span><span class="p">;</span>
+</pre></div>
+</div>
+<p>This just adds lexer support for the unary and binary keywords, like we
+did in <a class="reference external" href="LangImpl5.html#iflexer">previous chapters</a>. One nice thing
+about our current AST, is that we represent binary operators with full
+generalisation by using their ASCII code as the opcode. For our extended
+operators, we’ll use this same representation, so we don’t need any new
+AST or parser support.</p>
+<p>On the other hand, we have to be able to represent the definitions of
+these new operators, in the “def binary| 5” part of the function
+definition. In our grammar so far, the “name” for the function
+definition is parsed as the “prototype” production and into the
+<tt class="docutils literal"><span class="pre">PrototypeAST</span></tt> AST node. To represent our new user-defined operators
+as prototypes, we have to extend the <tt class="docutils literal"><span class="pre">PrototypeAST</span></tt> AST node like
+this:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// PrototypeAST - This class represents the "prototype" for a function,</span>
+<span class="c1">/// which captures its argument names as well as if it is an operator.</span>
+<span class="k">class</span> <span class="nc">PrototypeAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">Name</span><span class="p">;</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="n">Args</span><span class="p">;</span>
+  <span class="kt">bool</span> <span class="n">isOperator</span><span class="p">;</span>
+  <span class="kt">unsigned</span> <span class="n">Precedence</span><span class="p">;</span>  <span class="c1">// Precedence if a binary op.</span>
+<span class="nl">public:</span>
+  <span class="n">PrototypeAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">name</span><span class="p">,</span> <span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="o">&</span><span class="n">args</span><span class="p">,</span>
+               <span class="kt">bool</span> <span class="n">isoperator</span> <span class="o">=</span> <span class="nb">false</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="n">prec</span> <span class="o">=</span> <span class="mi">0</span><span class="p">)</span>
+  <span class="o">:</span> <span class="n">Name</span><span class="p">(</span><span class="n">name</span><span class="p">),</span> <span class="n">Args</span><span class="p">(</span><span class="n">args</span><span class="p">),</span> <span class="n">isOperator</span><span class="p">(</span><span class="n">isoperator</span><span class="p">),</span> <span class="n">Precedence</span><span class="p">(</span><span class="n">prec</span><span class="p">)</span> <span class="p">{}</span>
+
+  <span class="kt">bool</span> <span class="n">isUnaryOp</span><span class="p">()</span> <span class="k">const</span> <span class="p">{</span> <span class="k">return</span> <span class="n">isOperator</span> <span class="o">&&</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">()</span> <span class="o">==</span> <span class="mi">1</span><span class="p">;</span> <span class="p">}</span>
+  <span class="kt">bool</span> <span class="n">isBinaryOp</span><span class="p">()</span> <span class="k">const</span> <span class="p">{</span> <span class="k">return</span> <span class="n">isOperator</span> <span class="o">&&</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">()</span> <span class="o">==</span> <span class="mi">2</span><span class="p">;</span> <span class="p">}</span>
+
+  <span class="kt">char</span> <span class="n">getOperatorName</span><span class="p">()</span> <span class="k">const</span> <span class="p">{</span>
+    <span class="n">assert</span><span class="p">(</span><span class="n">isUnaryOp</span><span class="p">()</span> <span class="o">||</span> <span class="n">isBinaryOp</span><span class="p">());</span>
+    <span class="k">return</span> <span class="n">Name</span><span class="p">[</span><span class="n">Name</span><span class="p">.</span><span class="n">size</span><span class="p">()</span><span class="o">-</span><span class="mi">1</span><span class="p">];</span>
+  <span class="p">}</span>
+
+  <span class="kt">unsigned</span> <span class="n">getBinaryPrecedence</span><span class="p">()</span> <span class="k">const</span> <span class="p">{</span> <span class="k">return</span> <span class="n">Precedence</span><span class="p">;</span> <span class="p">}</span>
+
+  <span class="n">Function</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+</pre></div>
+</div>
+<p>Basically, in addition to knowing a name for the prototype, we now keep
+track of whether it was an operator, and if it was, what precedence
+level the operator is at. The precedence is only used for binary
+operators (as you’ll see below, it just doesn’t apply for unary
+operators). Now that we have a way to represent the prototype for a
+user-defined operator, we need to parse it:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// prototype</span>
+<span class="c1">///   ::= id '(' id* ')'</span>
+<span class="c1">///   ::= binary LETTER number? (id, id)</span>
+<span class="k">static</span> <span class="n">PrototypeAST</span> <span class="o">*</span><span class="nf">ParsePrototype</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">FnName</span><span class="p">;</span>
+
+  <span class="kt">unsigned</span> <span class="n">Kind</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>  <span class="c1">// 0 = identifier, 1 = unary, 2 = binary.</span>
+  <span class="kt">unsigned</span> <span class="n">BinaryPrecedence</span> <span class="o">=</span> <span class="mi">30</span><span class="p">;</span>
+
+  <span class="k">switch</span> <span class="p">(</span><span class="n">CurTok</span><span class="p">)</span> <span class="p">{</span>
+  <span class="nl">default:</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected function name in prototype"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="n">tok_identifier</span>:
+    <span class="n">FnName</span> <span class="o">=</span> <span class="n">IdentifierStr</span><span class="p">;</span>
+    <span class="n">Kind</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+    <span class="k">break</span><span class="p">;</span>
+  <span class="k">case</span> <span class="n">tok_binary</span>:
+    <span class="n">getNextToken</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">isascii</span><span class="p">(</span><span class="n">CurTok</span><span class="p">))</span>
+      <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected binary operator"</span><span class="p">);</span>
+    <span class="n">FnName</span> <span class="o">=</span> <span class="s">"binary"</span><span class="p">;</span>
+    <span class="n">FnName</span> <span class="o">+=</span> <span class="p">(</span><span class="kt">char</span><span class="p">)</span><span class="n">CurTok</span><span class="p">;</span>
+    <span class="n">Kind</span> <span class="o">=</span> <span class="mi">2</span><span class="p">;</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+
+    <span class="c1">// Read the precedence if present.</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">==</span> <span class="n">tok_number</span><span class="p">)</span> <span class="p">{</span>
+      <span class="k">if</span> <span class="p">(</span><span class="n">NumVal</span> <span class="o"><</span> <span class="mi">1</span> <span class="o">||</span> <span class="n">NumVal</span> <span class="o">></span> <span class="mi">100</span><span class="p">)</span>
+        <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Invalid precedecnce: must be 1..100"</span><span class="p">);</span>
+      <span class="n">BinaryPrecedence</span> <span class="o">=</span> <span class="p">(</span><span class="kt">unsigned</span><span class="p">)</span><span class="n">NumVal</span><span class="p">;</span>
+      <span class="n">getNextToken</span><span class="p">();</span>
+    <span class="p">}</span>
+    <span class="k">break</span><span class="p">;</span>
+  <span class="p">}</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">'('</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected '(' in prototype"</span><span class="p">);</span>
+
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="n">ArgNames</span><span class="p">;</span>
+  <span class="k">while</span> <span class="p">(</span><span class="n">getNextToken</span><span class="p">()</span> <span class="o">==</span> <span class="n">tok_identifier</span><span class="p">)</span>
+    <span class="n">ArgNames</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="n">IdentifierStr</span><span class="p">);</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">')'</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected ')' in prototype"</span><span class="p">);</span>
+
+  <span class="c1">// success.</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat ')'.</span>
+
+  <span class="c1">// Verify right number of names for operator.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Kind</span> <span class="o">&&</span> <span class="n">ArgNames</span><span class="p">.</span><span class="n">size</span><span class="p">()</span> <span class="o">!=</span> <span class="n">Kind</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Invalid number of operands for operator"</span><span class="p">);</span>
+
+  <span class="k">return</span> <span class="k">new</span> <span class="n">PrototypeAST</span><span class="p">(</span><span class="n">FnName</span><span class="p">,</span> <span class="n">ArgNames</span><span class="p">,</span> <span class="n">Kind</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">BinaryPrecedence</span><span class="p">);</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>This is all fairly straightforward parsing code, and we have already
+seen a lot of similar code in the past. One interesting part about the
+code above is the couple lines that set up <tt class="docutils literal"><span class="pre">FnName</span></tt> for binary
+operators. This builds names like “binary@” for a newly defined “@”
+operator. This then takes advantage of the fact that symbol names in the
+LLVM symbol table are allowed to have any character in them, including
+embedded nul characters.</p>
+<p>The next interesting thing to add, is codegen support for these binary
+operators. Given our current structure, this is a simple addition of a
+default case for our existing binary operator node:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">Value</span> <span class="o">*</span><span class="n">BinaryExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">L</span> <span class="o">=</span> <span class="n">LHS</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">R</span> <span class="o">=</span> <span class="n">RHS</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">L</span> <span class="o">==</span> <span class="mi">0</span> <span class="o">||</span> <span class="n">R</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="k">switch</span> <span class="p">(</span><span class="n">Op</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">case</span> <span class="sc">'+'</span>: <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFAdd</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"addtmp"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="sc">'-'</span>: <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFSub</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"subtmp"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="sc">'*'</span>: <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFMul</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"multmp"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="sc">'<'</span>:
+    <span class="n">L</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFCmpULT</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"cmptmp"</span><span class="p">);</span>
+    <span class="c1">// Convert bool 0/1 to double 0.0 or 1.0</span>
+    <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateUIToFP</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()),</span>
+                                <span class="s">"booltmp"</span><span class="p">);</span>
+  <span class="nl">default:</span> <span class="k">break</span><span class="p">;</span>
+  <span class="p">}</span>
+
+  <span class="c1">// If it wasn't a builtin binary operator, it must be a user defined one. Emit</span>
+  <span class="c1">// a call to it.</span>
+  <span class="n">Function</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">TheModule</span><span class="o">-></span><span class="n">getFunction</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="p">(</span><span class="s">"binary"</span><span class="p">)</span><span class="o">+</span><span class="n">Op</span><span class="p">);</span>
+  <span class="n">assert</span><span class="p">(</span><span class="n">F</span> <span class="o">&&</span> <span class="s">"binary operator not found!"</span><span class="p">);</span>
+
+  <span class="n">Value</span> <span class="o">*</span><span class="n">Ops</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span> <span class="n">L</span><span class="p">,</span> <span class="n">R</span> <span class="p">};</span>
+  <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateCall</span><span class="p">(</span><span class="n">F</span><span class="p">,</span> <span class="n">Ops</span><span class="p">,</span> <span class="s">"binop"</span><span class="p">);</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>As you can see above, the new code is actually really simple. It just
+does a lookup for the appropriate operator in the symbol table and
+generates a function call to it. Since user-defined operators are just
+built as normal functions (because the “prototype” boils down to a
+function with the right name) everything falls into place.</p>
+<p>The final piece of code we are missing, is a bit of top-level magic:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">Function</span> <span class="o">*</span><span class="n">FunctionAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">NamedValues</span><span class="p">.</span><span class="n">clear</span><span class="p">();</span>
+
+  <span class="n">Function</span> <span class="o">*</span><span class="n">TheFunction</span> <span class="o">=</span> <span class="n">Proto</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">TheFunction</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
+    <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="c1">// If this is an operator, install it.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Proto</span><span class="o">-></span><span class="n">isBinaryOp</span><span class="p">())</span>
+    <span class="n">BinopPrecedence</span><span class="p">[</span><span class="n">Proto</span><span class="o">-></span><span class="n">getOperatorName</span><span class="p">()]</span> <span class="o">=</span> <span class="n">Proto</span><span class="o">-></span><span class="n">getBinaryPrecedence</span><span class="p">();</span>
+
+  <span class="c1">// Create a new basic block to start insertion into.</span>
+  <span class="n">BasicBlock</span> <span class="o">*</span><span class="n">BB</span> <span class="o">=</span> <span class="n">BasicBlock</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="s">"entry"</span><span class="p">,</span> <span class="n">TheFunction</span><span class="p">);</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">SetInsertPoint</span><span class="p">(</span><span class="n">BB</span><span class="p">);</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">Value</span> <span class="o">*</span><span class="n">RetVal</span> <span class="o">=</span> <span class="n">Body</span><span class="o">-></span><span class="n">Codegen</span><span class="p">())</span> <span class="p">{</span>
+    <span class="p">...</span>
+</pre></div>
+</div>
+<p>Basically, before codegening a function, if it is a user-defined
+operator, we register it in the precedence table. This allows the binary
+operator parsing logic we already have in place to handle it. Since we
+are working on a fully-general operator precedence parser, this is all
+we need to do to “extend the grammar”.</p>
+<p>Now we have useful user-defined binary operators. This builds a lot on
+the previous framework we built for other operators. Adding unary
+operators is a bit more challenging, because we don’t have any framework
+for it yet - lets see what it takes.</p>
+</div>
+<div class="section" id="user-defined-unary-operators">
+<h2><a class="toc-backref" href="#id4">6.4. User-defined Unary Operators</a><a class="headerlink" href="#user-defined-unary-operators" title="Permalink to this headline">¶</a></h2>
+<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 support for the ‘unary’ keyword to the lexer. In addition to
+that, we need an AST node:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// UnaryExprAST - Expression class for a unary operator.</span>
+<span class="k">class</span> <span class="nc">UnaryExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="kt">char</span> <span class="n">Opcode</span><span class="p">;</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Operand</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">UnaryExprAST</span><span class="p">(</span><span class="kt">char</span> <span class="n">opcode</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">operand</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">Opcode</span><span class="p">(</span><span class="n">opcode</span><span class="p">),</span> <span class="n">Operand</span><span class="p">(</span><span class="n">operand</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+</pre></div>
+</div>
+<p>This AST node is very simple and obvious by now. It directly mirrors the
+binary operator AST node, except that it only has one child. With this,
+we need to add the parsing logic. Parsing a unary operator is pretty
+simple: we’ll add a new function to do it:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// unary</span>
+<span class="c1">///   ::= primary</span>
+<span class="c1">///   ::= '!' unary</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseUnary</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// If the current token is not an operator, it must be a primary expr.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">isascii</span><span class="p">(</span><span class="n">CurTok</span><span class="p">)</span> <span class="o">||</span> <span class="n">CurTok</span> <span class="o">==</span> <span class="sc">'('</span> <span class="o">||</span> <span class="n">CurTok</span> <span class="o">==</span> <span class="sc">','</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ParsePrimary</span><span class="p">();</span>
+
+  <span class="c1">// If this is a unary operator, read it.</span>
+  <span class="kt">int</span> <span class="n">Opc</span> <span class="o">=</span> <span class="n">CurTok</span><span class="p">;</span>
+  <span class="n">getNextToken</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">ExprAST</span> <span class="o">*</span><span class="n">Operand</span> <span class="o">=</span> <span class="n">ParseUnary</span><span class="p">())</span>
+    <span class="k">return</span> <span class="k">new</span> <span class="n">UnaryExprAST</span><span class="p">(</span><span class="n">Opc</span><span class="p">,</span> <span class="n">Operand</span><span class="p">);</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>The grammar we add is pretty straightforward here. If we see a unary
+operator when parsing a primary operator, we eat the operator as a
+prefix and parse the remaining piece as another unary operator. This
+allows us to handle multiple unary operators (e.g. ”!!x”). Note that
+unary operators can’t have ambiguous parses like binary operators can,
+so there is no need for precedence information.</p>
+<p>The problem with this function, is that we need to call ParseUnary from
+somewhere. To do this, we change previous callers of ParsePrimary to
+call ParseUnary instead:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// binoprhs</span>
+<span class="c1">///   ::= ('+' unary)*</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseBinOpRHS</span><span class="p">(</span><span class="kt">int</span> <span class="n">ExprPrec</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">LHS</span><span class="p">)</span> <span class="p">{</span>
+  <span class="p">...</span>
+    <span class="c1">// Parse the unary expression after the binary operator.</span>
+    <span class="n">ExprAST</span> <span class="o">*</span><span class="n">RHS</span> <span class="o">=</span> <span class="n">ParseUnary</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">RHS</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="p">...</span>
+<span class="p">}</span>
+<span class="c1">/// expression</span>
+<span class="c1">///   ::= unary binoprhs</span>
+<span class="c1">///</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseExpression</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">LHS</span> <span class="o">=</span> <span class="n">ParseUnary</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">LHS</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="k">return</span> <span class="n">ParseBinOpRHS</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">LHS</span><span class="p">);</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>With these two simple changes, we are now able to parse unary operators
+and build the AST for them. Next up, we need to add parser support for
+prototypes, to parse the unary operator prototype. We extend the binary
+operator code above with:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="c1">/// prototype</span>
+<span class="c1">///   ::= id '(' id* ')'</span>
+<span class="c1">///   ::= binary LETTER number? (id, id)</span>
+<span class="c1">///   ::= unary LETTER (id)</span>
+<span class="k">static</span> <span class="n">PrototypeAST</span> <span class="o">*</span><span class="nf">ParsePrototype</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">FnName</span><span class="p">;</span>
+
+  <span class="kt">unsigned</span> <span class="n">Kind</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>  <span class="c1">// 0 = identifier, 1 = unary, 2 = binary.</span>
+  <span class="kt">unsigned</span> <span class="n">BinaryPrecedence</span> <span class="o">=</span> <span class="mi">30</span><span class="p">;</span>
+
+  <span class="k">switch</span> <span class="p">(</span><span class="n">CurTok</span><span class="p">)</span> <span class="p">{</span>
+  <span class="nl">default:</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected function name in prototype"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="n">tok_identifier</span>:
+    <span class="n">FnName</span> <span class="o">=</span> <span class="n">IdentifierStr</span><span class="p">;</span>
+    <span class="n">Kind</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+    <span class="k">break</span><span class="p">;</span>
+  <span class="k">case</span> <span class="n">tok_unary</span>:
+    <span class="n">getNextToken</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">isascii</span><span class="p">(</span><span class="n">CurTok</span><span class="p">))</span>
+      <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected unary operator"</span><span class="p">);</span>
+    <span class="n">FnName</span> <span class="o">=</span> <span class="s">"unary"</span><span class="p">;</span>
+    <span class="n">FnName</span> <span class="o">+=</span> <span class="p">(</span><span class="kt">char</span><span class="p">)</span><span class="n">CurTok</span><span class="p">;</span>
+    <span class="n">Kind</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+    <span class="k">break</span><span class="p">;</span>
+  <span class="k">case</span> <span class="n">tok_binary</span>:
+    <span class="p">...</span>
+</pre></div>
+</div>
+<p>As with binary operators, we name unary operators with a name that
+includes the operator character. This assists us at code generation
+time. Speaking of, the final piece we need to add is codegen support for
+unary operators. It looks like this:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="n">Value</span> <span class="o">*</span><span class="n">UnaryExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">OperandV</span> <span class="o">=</span> <span class="n">Operand</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">OperandV</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="n">Function</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">TheModule</span><span class="o">-></span><span class="n">getFunction</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="p">(</span><span class="s">"unary"</span><span class="p">)</span><span class="o">+</span><span class="n">Opcode</span><span class="p">);</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">F</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorV</span><span class="p">(</span><span class="s">"Unknown unary operator"</span><span class="p">);</span>
+
+  <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateCall</span><span class="p">(</span><span class="n">F</span><span class="p">,</span> <span class="n">OperandV</span><span class="p">,</span> <span class="s">"unop"</span><span class="p">);</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>This code is similar to, but simpler than, the code for binary
+operators. It is simpler primarily because it doesn’t need to handle any
+predefined operators.</p>
+</div>
+<div class="section" id="kicking-the-tires">
+<h2><a class="toc-backref" href="#id5">6.5. Kicking the Tires</a><a class="headerlink" href="#kicking-the-tires" title="Permalink to this headline">¶</a></h2>
+<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 can do a lot of interesting things, including I/O, math, and a
+bunch of other things. For example, we can now add a nice sequencing
+operator (printd is defined to print out the specified value and a
+newline):</p>
+<div class="highlight-python"><pre>ready> extern printd(x);
+Read extern:
+declare double @printd(double)
+
+ready> def binary : 1 (x y) 0;  # Low-precedence operator that ignores operands.
+..
+ready> printd(123) : printd(456) : printd(789);
+123.000000
+456.000000
+789.000000
+Evaluated to 0.000000</pre>
+</div>
+<p>We can also define a bunch of other “primitive” operations, such as:</p>
+<div class="highlight-python"><pre># Logical unary not.
+def unary!(v)
+  if v then
+    0
+  else
+    1;
+
+# Unary negate.
+def unary-(v)
+  0-v;
+
+# Define > with the same precedence as <.
+def binary> 10 (LHS RHS)
+  RHS < LHS;
+
+# Binary logical or, which does not short circuit.
+def binary| 5 (LHS RHS)
+  if LHS then
+    1
+  else if RHS then
+    1
+  else
+    0;
+
+# Binary logical and, which does not short circuit.
+def binary& 6 (LHS RHS)
+  if !LHS then
+    0
+  else
+    !!RHS;
+
+# Define = with slightly lower precedence than relationals.
+def binary = 9 (LHS RHS)
+  !(LHS < RHS | LHS > RHS);
+
+# Define ':' for sequencing: as a low-precedence operator that ignores operands
+# and just returns the RHS.
+def binary : 1 (x y) y;</pre>
+</div>
+<p>Given the previous if/then/else support, we can also define interesting
+functions for I/O. For example, the following prints out a character
+whose “density” reflects the value passed in: the lower the value, the
+denser the character:</p>
+<div class="highlight-python"><pre>ready>
+
+extern putchard(char)
+def printdensity(d)
+  if d > 8 then
+    putchard(32)  # ' '
+  else if d > 4 then
+    putchard(46)  # '.'
+  else if d > 2 then
+    putchard(43)  # '+'
+  else
+    putchard(42); # '*'
+...
+ready> printdensity(1): printdensity(2): printdensity(3):
+       printdensity(4): printdensity(5): printdensity(9):
+       putchard(10);
+**++.
+Evaluated to 0.000000</pre>
+</div>
+<p>Based on these simple primitive operations, we can start to define more
+interesting things. For example, here’s a little function that solves
+for the number of iterations it takes a function in the complex plane to
+converge:</p>
+<div class="highlight-python"><pre># Determine whether the specific location diverges.
+# Solve for z = z^2 + c in the complex plane.
+def mandleconverger(real imag iters creal cimag)
+  if iters > 255 | (real*real + imag*imag > 4) then
+    iters
+  else
+    mandleconverger(real*real - imag*imag + creal,
+                    2*real*imag + cimag,
+                    iters+1, creal, cimag);
+
+# Return the number of iterations required for the iteration to escape
+def mandleconverge(real imag)
+  mandleconverger(real, imag, 0, real, imag);</pre>
+</div>
+<p>This “<tt class="docutils literal"><span class="pre">z</span> <span class="pre">=</span> <span class="pre">z2</span> <span class="pre">+</span> <span class="pre">c</span></tt>” function is a beautiful little creature that is
+the basis for computation of the <a class="reference external" href="http://en.wikipedia.org/wiki/Mandelbrot_set">Mandelbrot
+Set</a>. Our
+<tt class="docutils literal"><span class="pre">mandelconverge</span></tt> function returns the number of iterations that it
+takes for a complex orbit to escape, saturating to 255. This is not a
+very useful function by itself, but if you plot its value over a
+two-dimensional plane, you can see the Mandelbrot set. Given that we are
+limited to using putchard here, our amazing graphical output is limited,
+but we can whip together something using the density plotter above:</p>
+<div class="highlight-python"><pre># Compute and plot the mandlebrot set with the specified 2 dimensional range
+# info.
+def mandelhelp(xmin xmax xstep   ymin ymax ystep)
+  for y = ymin, y < ymax, ystep in (
+    (for x = xmin, x < xmax, xstep in
+       printdensity(mandleconverge(x,y)))
+    : putchard(10)
+  )
+
+# mandel - This is a convenient helper function for plotting the mandelbrot set
+# from the specified position with the specified Magnification.
+def mandel(realstart imagstart realmag imagmag)
+  mandelhelp(realstart, realstart+realmag*78, realmag,
+             imagstart, imagstart+imagmag*40, imagmag);</pre>
+</div>
+<p>Given this, we can try plotting out the mandlebrot set! Lets try it out:</p>
+<div class="highlight-python"><pre>ready> mandel(-2.3, -1.3, 0.05, 0.07);
+*******************************+++++++++++*************************************
+*************************+++++++++++++++++++++++*******************************
+**********************+++++++++++++++++++++++++++++****************************
+*******************+++++++++++++++++++++.. ...++++++++*************************
+*****************++++++++++++++++++++++.... ...+++++++++***********************
+***************+++++++++++++++++++++++.....   ...+++++++++*********************
+**************+++++++++++++++++++++++....     ....+++++++++********************
+*************++++++++++++++++++++++......      .....++++++++*******************
+************+++++++++++++++++++++.......       .......+++++++******************
+***********+++++++++++++++++++....                ... .+++++++*****************
+**********+++++++++++++++++.......                     .+++++++****************
+*********++++++++++++++...........                    ...+++++++***************
+********++++++++++++............                      ...++++++++**************
+********++++++++++... ..........                        .++++++++**************
+*******+++++++++.....                                   .+++++++++*************
+*******++++++++......                                  ..+++++++++*************
+*******++++++.......                                   ..+++++++++*************
+*******+++++......                                     ..+++++++++*************
+*******.... ....                                      ...+++++++++*************
+*******.... .                                         ...+++++++++*************
+*******+++++......                                    ...+++++++++*************
+*******++++++.......                                   ..+++++++++*************
+*******++++++++......                                   .+++++++++*************
+*******+++++++++.....                                  ..+++++++++*************
+********++++++++++... ..........                        .++++++++**************
+********++++++++++++............                      ...++++++++**************
+*********++++++++++++++..........                     ...+++++++***************
+**********++++++++++++++++........                     .+++++++****************
+**********++++++++++++++++++++....                ... ..+++++++****************
+***********++++++++++++++++++++++.......       .......++++++++*****************
+************+++++++++++++++++++++++......      ......++++++++******************
+**************+++++++++++++++++++++++....      ....++++++++********************
+***************+++++++++++++++++++++++.....   ...+++++++++*********************
+*****************++++++++++++++++++++++....  ...++++++++***********************
+*******************+++++++++++++++++++++......++++++++*************************
+*********************++++++++++++++++++++++.++++++++***************************
+*************************+++++++++++++++++++++++*******************************
+******************************+++++++++++++************************************
+*******************************************************************************
+*******************************************************************************
+*******************************************************************************
+Evaluated to 0.000000
+ready> mandel(-2, -1, 0.02, 0.04);
+**************************+++++++++++++++++++++++++++++++++++++++++++++++++++++
+***********************++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+*********************+++++++++++++++++++++++++++++++++++++++++++++++++++++++++.
+*******************+++++++++++++++++++++++++++++++++++++++++++++++++++++++++...
+*****************+++++++++++++++++++++++++++++++++++++++++++++++++++++++++.....
+***************++++++++++++++++++++++++++++++++++++++++++++++++++++++++........
+**************++++++++++++++++++++++++++++++++++++++++++++++++++++++...........
+************+++++++++++++++++++++++++++++++++++++++++++++++++++++..............
+***********++++++++++++++++++++++++++++++++++++++++++++++++++........        .
+**********++++++++++++++++++++++++++++++++++++++++++++++.............
+********+++++++++++++++++++++++++++++++++++++++++++..................
+*******+++++++++++++++++++++++++++++++++++++++.......................
+******+++++++++++++++++++++++++++++++++++...........................
+*****++++++++++++++++++++++++++++++++............................
+*****++++++++++++++++++++++++++++...............................
+****++++++++++++++++++++++++++......   .........................
+***++++++++++++++++++++++++.........     ......    ...........
+***++++++++++++++++++++++............
+**+++++++++++++++++++++..............
+**+++++++++++++++++++................
+*++++++++++++++++++.................
+*++++++++++++++++............ ...
+*++++++++++++++..............
+*+++....++++................
+*..........  ...........
+*
+*..........  ...........
+*+++....++++................
+*++++++++++++++..............
+*++++++++++++++++............ ...
+*++++++++++++++++++.................
+**+++++++++++++++++++................
+**+++++++++++++++++++++..............
+***++++++++++++++++++++++............
+***++++++++++++++++++++++++.........     ......    ...........
+****++++++++++++++++++++++++++......   .........................
+*****++++++++++++++++++++++++++++...............................
+*****++++++++++++++++++++++++++++++++............................
+******+++++++++++++++++++++++++++++++++++...........................
+*******+++++++++++++++++++++++++++++++++++++++.......................
+********+++++++++++++++++++++++++++++++++++++++++++..................
+Evaluated to 0.000000
+ready> mandel(-0.9, -1.4, 0.02, 0.03);
+*******************************************************************************
+*******************************************************************************
+*******************************************************************************
+**********+++++++++++++++++++++************************************************
+*+++++++++++++++++++++++++++++++++++++++***************************************
++++++++++++++++++++++++++++++++++++++++++++++**********************************
+++++++++++++++++++++++++++++++++++++++++++++++++++*****************************
+++++++++++++++++++++++++++++++++++++++++++++++++++++++*************************
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++**********************
++++++++++++++++++++++++++++++++++.........++++++++++++++++++*******************
++++++++++++++++++++++++++++++++....   ......+++++++++++++++++++****************
++++++++++++++++++++++++++++++.......  ........+++++++++++++++++++**************
+++++++++++++++++++++++++++++........   ........++++++++++++++++++++************
++++++++++++++++++++++++++++.........     ..  ...+++++++++++++++++++++**********
+++++++++++++++++++++++++++...........        ....++++++++++++++++++++++********
+++++++++++++++++++++++++.............       .......++++++++++++++++++++++******
++++++++++++++++++++++++.............        ........+++++++++++++++++++++++****
+++++++++++++++++++++++...........           ..........++++++++++++++++++++++***
+++++++++++++++++++++...........                .........++++++++++++++++++++++*
+++++++++++++++++++............                  ...........++++++++++++++++++++
+++++++++++++++++...............                 .............++++++++++++++++++
+++++++++++++++.................                 ...............++++++++++++++++
+++++++++++++..................                  .................++++++++++++++
++++++++++..................                      .................+++++++++++++
+++++++........        .                               .........  ..++++++++++++
+++............                                         ......    ....++++++++++
+..............                                                    ...++++++++++
+..............                                                    ....+++++++++
+..............                                                    .....++++++++
+.............                                                    ......++++++++
+...........                                                     .......++++++++
+.........                                                       ........+++++++
+.........                                                       ........+++++++
+.........                                                           ....+++++++
+........                                                             ...+++++++
+.......                                                              ...+++++++
+                                                                    ....+++++++
+                                                                   .....+++++++
+                                                                    ....+++++++
+                                                                    ....+++++++
+                                                                    ....+++++++
+Evaluated to 0.000000
+ready> ^D</pre>
+</div>
+<p>At this point, you may be starting to realize that Kaleidoscope is a
+real and powerful language. It may not be self-similar :), but it can be
+used to plot things that are!</p>
+<p>With this, we conclude the “adding user-defined operators” chapter of
+the tutorial. We have successfully augmented our language, adding the
+ability to extend the language in the library, and we have shown how
+this can be used to build a simple but interesting end-user application
+in Kaleidoscope. At this point, Kaleidoscope can build a variety of
+applications that are functional and can call functions with
+side-effects, but it can’t actually define and mutate a variable itself.</p>
+<p>Strikingly, variable mutation is an important feature of some languages,
+and it is not at all obvious how to <a class="reference external" href="LangImpl7.html">add support for mutable
+variables</a> without having to add an “SSA construction”
+phase to your front-end. In the next chapter, we will describe how you
+can add variable mutation without building SSA in your front-end.</p>
+</div>
+<div class="section" id="full-code-listing">
+<h2><a class="toc-backref" href="#id6">6.6. Full Code Listing</a><a class="headerlink" href="#full-code-listing" title="Permalink to this headline">¶</a></h2>
+<p>Here is the complete code listing for our running example, enhanced with
+the if/then/else and for expressions.. To build this example, use:</p>
+<div class="highlight-bash"><div class="highlight"><pre><span class="c"># Compile</span>
+clang++ -g toy.cpp <span class="sb">`</span>llvm-config --cppflags --ldflags --libs core jit native<span class="sb">`</span> -O3 -o toy
+<span class="c"># Run</span>
+./toy
+</pre></div>
+</div>
+<p>On some platforms, you will need to specify -rdynamic or
+-Wl,–export-dynamic when linking. This ensures that symbols defined in
+the main executable are exported to the dynamic linker and so are
+available for symbol resolution at run time. This is not needed if you
+compile your support code into a shared library, although doing that
+will cause problems on Windows.</p>
+<p>Here is the code:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include "llvm/Analysis/Passes.h"</span>
+<span class="cp">#include "llvm/Analysis/Verifier.h"</span>
+<span class="cp">#include "llvm/ExecutionEngine/ExecutionEngine.h"</span>
+<span class="cp">#include "llvm/ExecutionEngine/JIT.h"</span>
+<span class="cp">#include "llvm/IR/DataLayout.h"</span>
+<span class="cp">#include "llvm/IR/DerivedTypes.h"</span>
+<span class="cp">#include "llvm/IR/IRBuilder.h"</span>
+<span class="cp">#include "llvm/IR/LLVMContext.h"</span>
+<span class="cp">#include "llvm/IR/Module.h"</span>
+<span class="cp">#include "llvm/PassManager.h"</span>
+<span class="cp">#include "llvm/Support/TargetSelect.h"</span>
+<span class="cp">#include "llvm/Transforms/Scalar.h"</span>
+<span class="cp">#include <cctype></span>
+<span class="cp">#include <cstdio></span>
+<span class="cp">#include <map></span>
+<span class="cp">#include <string></span>
+<span class="cp">#include <vector></span>
+<span class="k">using</span> <span class="k">namespace</span> <span class="n">llvm</span><span class="p">;</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Lexer</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="c1">// The lexer returns tokens [0-255] if it is an unknown character, otherwise one</span>
+<span class="c1">// of these for known things.</span>
+<span class="k">enum</span> <span class="n">Token</span> <span class="p">{</span>
+  <span class="n">tok_eof</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span>
+
+  <span class="c1">// commands</span>
+  <span class="n">tok_def</span> <span class="o">=</span> <span class="o">-</span><span class="mi">2</span><span class="p">,</span> <span class="n">tok_extern</span> <span class="o">=</span> <span class="o">-</span><span class="mi">3</span><span class="p">,</span>
+
+  <span class="c1">// primary</span>
+  <span class="n">tok_identifier</span> <span class="o">=</span> <span class="o">-</span><span class="mi">4</span><span class="p">,</span> <span class="n">tok_number</span> <span class="o">=</span> <span class="o">-</span><span class="mi">5</span><span class="p">,</span>
+  
+  <span class="c1">// control</span>
+  <span class="n">tok_if</span> <span class="o">=</span> <span class="o">-</span><span class="mi">6</span><span class="p">,</span> <span class="n">tok_then</span> <span class="o">=</span> <span class="o">-</span><span class="mi">7</span><span class="p">,</span> <span class="n">tok_else</span> <span class="o">=</span> <span class="o">-</span><span class="mi">8</span><span class="p">,</span>
+  <span class="n">tok_for</span> <span class="o">=</span> <span class="o">-</span><span class="mi">9</span><span class="p">,</span> <span class="n">tok_in</span> <span class="o">=</span> <span class="o">-</span><span class="mi">10</span><span class="p">,</span>
+  
+  <span class="c1">// operators</span>
+  <span class="n">tok_binary</span> <span class="o">=</span> <span class="o">-</span><span class="mi">11</span><span class="p">,</span> <span class="n">tok_unary</span> <span class="o">=</span> <span class="o">-</span><span class="mi">12</span>
+<span class="p">};</span>
+
+<span class="k">static</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">IdentifierStr</span><span class="p">;</span>  <span class="c1">// Filled in if tok_identifier</span>
+<span class="k">static</span> <span class="kt">double</span> <span class="n">NumVal</span><span class="p">;</span>              <span class="c1">// Filled in if tok_number</span>
+
+<span class="c1">/// gettok - Return the next token from standard input.</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">gettok</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">static</span> <span class="kt">int</span> <span class="n">LastChar</span> <span class="o">=</span> <span class="sc">' '</span><span class="p">;</span>
+
+  <span class="c1">// Skip any whitespace.</span>
+  <span class="k">while</span> <span class="p">(</span><span class="n">isspace</span><span class="p">(</span><span class="n">LastChar</span><span class="p">))</span>
+    <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">isalpha</span><span class="p">(</span><span class="n">LastChar</span><span class="p">))</span> <span class="p">{</span> <span class="c1">// identifier: [a-zA-Z][a-zA-Z0-9]*</span>
+    <span class="n">IdentifierStr</span> <span class="o">=</span> <span class="n">LastChar</span><span class="p">;</span>
+    <span class="k">while</span> <span class="p">(</span><span class="n">isalnum</span><span class="p">((</span><span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">())))</span>
+      <span class="n">IdentifierStr</span> <span class="o">+=</span> <span class="n">LastChar</span><span class="p">;</span>
+
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"def"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_def</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"extern"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_extern</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"if"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_if</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"then"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_then</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"else"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_else</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"for"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_for</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"in"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_in</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"binary"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_binary</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">IdentifierStr</span> <span class="o">==</span> <span class="s">"unary"</span><span class="p">)</span> <span class="k">return</span> <span class="n">tok_unary</span><span class="p">;</span>
+    <span class="k">return</span> <span class="n">tok_identifier</span><span class="p">;</span>
+  <span class="p">}</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">isdigit</span><span class="p">(</span><span class="n">LastChar</span><span class="p">)</span> <span class="o">||</span> <span class="n">LastChar</span> <span class="o">==</span> <span class="sc">'.'</span><span class="p">)</span> <span class="p">{</span>   <span class="c1">// Number: [0-9.]+</span>
+    <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">NumStr</span><span class="p">;</span>
+    <span class="k">do</span> <span class="p">{</span>
+      <span class="n">NumStr</span> <span class="o">+=</span> <span class="n">LastChar</span><span class="p">;</span>
+      <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+    <span class="p">}</span> <span class="k">while</span> <span class="p">(</span><span class="n">isdigit</span><span class="p">(</span><span class="n">LastChar</span><span class="p">)</span> <span class="o">||</span> <span class="n">LastChar</span> <span class="o">==</span> <span class="sc">'.'</span><span class="p">);</span>
+
+    <span class="n">NumVal</span> <span class="o">=</span> <span class="n">strtod</span><span class="p">(</span><span class="n">NumStr</span><span class="p">.</span><span class="n">c_str</span><span class="p">(),</span> <span class="mi">0</span><span class="p">);</span>
+    <span class="k">return</span> <span class="n">tok_number</span><span class="p">;</span>
+  <span class="p">}</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">==</span> <span class="sc">'#'</span><span class="p">)</span> <span class="p">{</span>
+    <span class="c1">// Comment until end of line.</span>
+    <span class="k">do</span> <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+    <span class="k">while</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">!=</span> <span class="n">EOF</span> <span class="o">&&</span> <span class="n">LastChar</span> <span class="o">!=</span> <span class="sc">'\n'</span> <span class="o">&&</span> <span class="n">LastChar</span> <span class="o">!=</span> <span class="sc">'\r'</span><span class="p">);</span>
+    
+    <span class="k">if</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">!=</span> <span class="n">EOF</span><span class="p">)</span>
+      <span class="k">return</span> <span class="n">gettok</span><span class="p">();</span>
+  <span class="p">}</span>
+  
+  <span class="c1">// Check for end of file.  Don't eat the EOF.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">LastChar</span> <span class="o">==</span> <span class="n">EOF</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">tok_eof</span><span class="p">;</span>
+
+  <span class="c1">// Otherwise, just return the character as its ascii value.</span>
+  <span class="kt">int</span> <span class="n">ThisChar</span> <span class="o">=</span> <span class="n">LastChar</span><span class="p">;</span>
+  <span class="n">LastChar</span> <span class="o">=</span> <span class="n">getchar</span><span class="p">();</span>
+  <span class="k">return</span> <span class="n">ThisChar</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Abstract Syntax Tree (aka Parse Tree)</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="k">namespace</span> <span class="p">{</span>
+<span class="c1">/// ExprAST - Base class for all expression nodes.</span>
+<span class="k">class</span> <span class="nc">ExprAST</span> <span class="p">{</span>
+<span class="nl">public:</span>
+  <span class="k">virtual</span> <span class="o">~</span><span class="n">ExprAST</span><span class="p">()</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">()</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">};</span>
+
+<span class="c1">/// NumberExprAST - Expression class for numeric literals like "1.0".</span>
+<span class="k">class</span> <span class="nc">NumberExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="kt">double</span> <span class="n">Val</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">NumberExprAST</span><span class="p">(</span><span class="kt">double</span> <span class="n">val</span><span class="p">)</span> <span class="o">:</span> <span class="n">Val</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// VariableExprAST - Expression class for referencing a variable, like "a".</span>
+<span class="k">class</span> <span class="nc">VariableExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">Name</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">VariableExprAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">name</span><span class="p">)</span> <span class="o">:</span> <span class="n">Name</span><span class="p">(</span><span class="n">name</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// UnaryExprAST - Expression class for a unary operator.</span>
+<span class="k">class</span> <span class="nc">UnaryExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="kt">char</span> <span class="n">Opcode</span><span class="p">;</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Operand</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">UnaryExprAST</span><span class="p">(</span><span class="kt">char</span> <span class="n">opcode</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">operand</span><span class="p">)</span> 
+    <span class="o">:</span> <span class="n">Opcode</span><span class="p">(</span><span class="n">opcode</span><span class="p">),</span> <span class="n">Operand</span><span class="p">(</span><span class="n">operand</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// BinaryExprAST - Expression class for a binary operator.</span>
+<span class="k">class</span> <span class="nc">BinaryExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="kt">char</span> <span class="n">Op</span><span class="p">;</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">LHS</span><span class="p">,</span> <span class="o">*</span><span class="n">RHS</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">BinaryExprAST</span><span class="p">(</span><span class="kt">char</span> <span class="n">op</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">lhs</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">rhs</span><span class="p">)</span> 
+    <span class="o">:</span> <span class="n">Op</span><span class="p">(</span><span class="n">op</span><span class="p">),</span> <span class="n">LHS</span><span class="p">(</span><span class="n">lhs</span><span class="p">),</span> <span class="n">RHS</span><span class="p">(</span><span class="n">rhs</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// CallExprAST - Expression class for function calls.</span>
+<span class="k">class</span> <span class="nc">CallExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">Callee</span><span class="p">;</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">ExprAST</span><span class="o">*></span> <span class="n">Args</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">CallExprAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">callee</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">ExprAST</span><span class="o">*></span> <span class="o">&</span><span class="n">args</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">Callee</span><span class="p">(</span><span class="n">callee</span><span class="p">),</span> <span class="n">Args</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// IfExprAST - Expression class for if/then/else.</span>
+<span class="k">class</span> <span class="nc">IfExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Cond</span><span class="p">,</span> <span class="o">*</span><span class="n">Then</span><span class="p">,</span> <span class="o">*</span><span class="n">Else</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">IfExprAST</span><span class="p">(</span><span class="n">ExprAST</span> <span class="o">*</span><span class="n">cond</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">then</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">_else</span><span class="p">)</span>
+  <span class="o">:</span> <span class="n">Cond</span><span class="p">(</span><span class="n">cond</span><span class="p">),</span> <span class="n">Then</span><span class="p">(</span><span class="n">then</span><span class="p">),</span> <span class="n">Else</span><span class="p">(</span><span class="n">_else</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// ForExprAST - Expression class for for/in.</span>
+<span class="k">class</span> <span class="nc">ForExprAST</span> <span class="o">:</span> <span class="k">public</span> <span class="n">ExprAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">VarName</span><span class="p">;</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Start</span><span class="p">,</span> <span class="o">*</span><span class="n">End</span><span class="p">,</span> <span class="o">*</span><span class="n">Step</span><span class="p">,</span> <span class="o">*</span><span class="n">Body</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">ForExprAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">varname</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">start</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">end</span><span class="p">,</span>
+             <span class="n">ExprAST</span> <span class="o">*</span><span class="n">step</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">body</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">VarName</span><span class="p">(</span><span class="n">varname</span><span class="p">),</span> <span class="n">Start</span><span class="p">(</span><span class="n">start</span><span class="p">),</span> <span class="n">End</span><span class="p">(</span><span class="n">end</span><span class="p">),</span> <span class="n">Step</span><span class="p">(</span><span class="n">step</span><span class="p">),</span> <span class="n">Body</span><span class="p">(</span><span class="n">body</span><span class="p">)</span> <span class="p">{}</span>
+  <span class="k">virtual</span> <span class="n">Value</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// PrototypeAST - This class represents the "prototype" for a function,</span>
+<span class="c1">/// which captures its name, and its argument names (thus implicitly the number</span>
+<span class="c1">/// of arguments the function takes), as well as if it is an operator.</span>
+<span class="k">class</span> <span class="nc">PrototypeAST</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">Name</span><span class="p">;</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="n">Args</span><span class="p">;</span>
+  <span class="kt">bool</span> <span class="n">isOperator</span><span class="p">;</span>
+  <span class="kt">unsigned</span> <span class="n">Precedence</span><span class="p">;</span>  <span class="c1">// Precedence if a binary op.</span>
+<span class="nl">public:</span>
+  <span class="n">PrototypeAST</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&</span><span class="n">name</span><span class="p">,</span> <span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="o">&</span><span class="n">args</span><span class="p">,</span>
+               <span class="kt">bool</span> <span class="n">isoperator</span> <span class="o">=</span> <span class="nb">false</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="n">prec</span> <span class="o">=</span> <span class="mi">0</span><span class="p">)</span>
+  <span class="o">:</span> <span class="n">Name</span><span class="p">(</span><span class="n">name</span><span class="p">),</span> <span class="n">Args</span><span class="p">(</span><span class="n">args</span><span class="p">),</span> <span class="n">isOperator</span><span class="p">(</span><span class="n">isoperator</span><span class="p">),</span> <span class="n">Precedence</span><span class="p">(</span><span class="n">prec</span><span class="p">)</span> <span class="p">{}</span>
+  
+  <span class="kt">bool</span> <span class="n">isUnaryOp</span><span class="p">()</span> <span class="k">const</span> <span class="p">{</span> <span class="k">return</span> <span class="n">isOperator</span> <span class="o">&&</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">()</span> <span class="o">==</span> <span class="mi">1</span><span class="p">;</span> <span class="p">}</span>
+  <span class="kt">bool</span> <span class="n">isBinaryOp</span><span class="p">()</span> <span class="k">const</span> <span class="p">{</span> <span class="k">return</span> <span class="n">isOperator</span> <span class="o">&&</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">()</span> <span class="o">==</span> <span class="mi">2</span><span class="p">;</span> <span class="p">}</span>
+  
+  <span class="kt">char</span> <span class="n">getOperatorName</span><span class="p">()</span> <span class="k">const</span> <span class="p">{</span>
+    <span class="n">assert</span><span class="p">(</span><span class="n">isUnaryOp</span><span class="p">()</span> <span class="o">||</span> <span class="n">isBinaryOp</span><span class="p">());</span>
+    <span class="k">return</span> <span class="n">Name</span><span class="p">[</span><span class="n">Name</span><span class="p">.</span><span class="n">size</span><span class="p">()</span><span class="o">-</span><span class="mi">1</span><span class="p">];</span>
+  <span class="p">}</span>
+  
+  <span class="kt">unsigned</span> <span class="n">getBinaryPrecedence</span><span class="p">()</span> <span class="k">const</span> <span class="p">{</span> <span class="k">return</span> <span class="n">Precedence</span><span class="p">;</span> <span class="p">}</span>
+  
+  <span class="n">Function</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+
+<span class="c1">/// FunctionAST - This class represents a function definition itself.</span>
+<span class="k">class</span> <span class="nc">FunctionAST</span> <span class="p">{</span>
+  <span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">Proto</span><span class="p">;</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Body</span><span class="p">;</span>
+<span class="nl">public:</span>
+  <span class="n">FunctionAST</span><span class="p">(</span><span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">proto</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">body</span><span class="p">)</span>
+    <span class="o">:</span> <span class="n">Proto</span><span class="p">(</span><span class="n">proto</span><span class="p">),</span> <span class="n">Body</span><span class="p">(</span><span class="n">body</span><span class="p">)</span> <span class="p">{}</span>
+  
+  <span class="n">Function</span> <span class="o">*</span><span class="n">Codegen</span><span class="p">();</span>
+<span class="p">};</span>
+<span class="p">}</span> <span class="c1">// end anonymous namespace</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Parser</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="c1">/// CurTok/getNextToken - Provide a simple token buffer.  CurTok is the current</span>
+<span class="c1">/// token the parser is looking at.  getNextToken reads another token from the</span>
+<span class="c1">/// lexer and updates CurTok with its results.</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="n">CurTok</span><span class="p">;</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">getNextToken</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="n">CurTok</span> <span class="o">=</span> <span class="n">gettok</span><span class="p">();</span>
+<span class="p">}</span>
+
+<span class="c1">/// BinopPrecedence - This holds the precedence for each binary operator that is</span>
+<span class="c1">/// defined.</span>
+<span class="k">static</span> <span class="n">std</span><span class="o">::</span><span class="n">map</span><span class="o"><</span><span class="kt">char</span><span class="p">,</span> <span class="kt">int</span><span class="o">></span> <span class="n">BinopPrecedence</span><span class="p">;</span>
+
+<span class="c1">/// GetTokPrecedence - Get the precedence of the pending binary operator token.</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">GetTokPrecedence</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">isascii</span><span class="p">(</span><span class="n">CurTok</span><span class="p">))</span>
+    <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
+  
+  <span class="c1">// Make sure it's a declared binop.</span>
+  <span class="kt">int</span> <span class="n">TokPrec</span> <span class="o">=</span> <span class="n">BinopPrecedence</span><span class="p">[</span><span class="n">CurTok</span><span class="p">];</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">TokPrec</span> <span class="o"><=</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
+  <span class="k">return</span> <span class="n">TokPrec</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// Error* - These are little helper functions for error handling.</span>
+<span class="n">ExprAST</span> <span class="o">*</span><span class="nf">Error</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Error: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">Str</span><span class="p">);</span><span class="k">return</span> <span class="mi">0</span><span class="p">;}</span>
+<span class="n">PrototypeAST</span> <span class="o">*</span><span class="nf">ErrorP</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">Error</span><span class="p">(</span><span class="n">Str</span><span class="p">);</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span>
+<span class="n">FunctionAST</span> <span class="o">*</span><span class="nf">ErrorF</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">Error</span><span class="p">(</span><span class="n">Str</span><span class="p">);</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span>
+
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseExpression</span><span class="p">();</span>
+
+<span class="c1">/// identifierexpr</span>
+<span class="c1">///   ::= identifier</span>
+<span class="c1">///   ::= identifier '(' expression* ')'</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseIdentifierExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">IdName</span> <span class="o">=</span> <span class="n">IdentifierStr</span><span class="p">;</span>
+  
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat identifier.</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">'('</span><span class="p">)</span> <span class="c1">// Simple variable ref.</span>
+    <span class="k">return</span> <span class="k">new</span> <span class="n">VariableExprAST</span><span class="p">(</span><span class="n">IdName</span><span class="p">);</span>
+  
+  <span class="c1">// Call.</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat (</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">ExprAST</span><span class="o">*></span> <span class="n">Args</span><span class="p">;</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">')'</span><span class="p">)</span> <span class="p">{</span>
+    <span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+      <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Arg</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+      <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">Arg</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+      <span class="n">Args</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="n">Arg</span><span class="p">);</span>
+
+      <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">==</span> <span class="sc">')'</span><span class="p">)</span> <span class="k">break</span><span class="p">;</span>
+
+      <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">','</span><span class="p">)</span>
+        <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"Expected ')' or ',' in argument list"</span><span class="p">);</span>
+      <span class="n">getNextToken</span><span class="p">();</span>
+    <span class="p">}</span>
+  <span class="p">}</span>
+
+  <span class="c1">// Eat the ')'.</span>
+  <span class="n">getNextToken</span><span class="p">();</span>
+  
+  <span class="k">return</span> <span class="k">new</span> <span class="n">CallExprAST</span><span class="p">(</span><span class="n">IdName</span><span class="p">,</span> <span class="n">Args</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="c1">/// numberexpr ::= number</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseNumberExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Result</span> <span class="o">=</span> <span class="k">new</span> <span class="n">NumberExprAST</span><span class="p">(</span><span class="n">NumVal</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span> <span class="c1">// consume the number</span>
+  <span class="k">return</span> <span class="n">Result</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// parenexpr ::= '(' expression ')'</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseParenExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat (.</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">V</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">V</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">')'</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected ')'"</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat ).</span>
+  <span class="k">return</span> <span class="n">V</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// ifexpr ::= 'if' expression 'then' expression 'else' expression</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseIfExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat the if.</span>
+  
+  <span class="c1">// condition.</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Cond</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">Cond</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="n">tok_then</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected then"</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat the then</span>
+  
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Then</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Then</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="n">tok_else</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected else"</span><span class="p">);</span>
+  
+  <span class="n">getNextToken</span><span class="p">();</span>
+  
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Else</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">Else</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="k">return</span> <span class="k">new</span> <span class="n">IfExprAST</span><span class="p">(</span><span class="n">Cond</span><span class="p">,</span> <span class="n">Then</span><span class="p">,</span> <span class="n">Else</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="c1">/// forexpr ::= 'for' identifier '=' expr ',' expr (',' expr)? 'in' expression</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseForExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat the for.</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="n">tok_identifier</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected identifier after for"</span><span class="p">);</span>
+  
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">IdName</span> <span class="o">=</span> <span class="n">IdentifierStr</span><span class="p">;</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat identifier.</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">'='</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected '=' after for"</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat '='.</span>
+  
+  
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Start</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Start</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">','</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected ',' after for start value"</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>
+  
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">End</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">End</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="c1">// The step value is optional.</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Step</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">==</span> <span class="sc">','</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+    <span class="n">Step</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">Step</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="p">}</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="n">tok_in</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"expected 'in' after for"</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat 'in'.</span>
+  
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">Body</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Body</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="k">return</span> <span class="k">new</span> <span class="n">ForExprAST</span><span class="p">(</span><span class="n">IdName</span><span class="p">,</span> <span class="n">Start</span><span class="p">,</span> <span class="n">End</span><span class="p">,</span> <span class="n">Step</span><span class="p">,</span> <span class="n">Body</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="c1">/// primary</span>
+<span class="c1">///   ::= identifierexpr</span>
+<span class="c1">///   ::= numberexpr</span>
+<span class="c1">///   ::= parenexpr</span>
+<span class="c1">///   ::= ifexpr</span>
+<span class="c1">///   ::= forexpr</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParsePrimary</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">switch</span> <span class="p">(</span><span class="n">CurTok</span><span class="p">)</span> <span class="p">{</span>
+  <span class="nl">default:</span> <span class="k">return</span> <span class="n">Error</span><span class="p">(</span><span class="s">"unknown token when expecting an expression"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="n">tok_identifier</span>: <span class="k">return</span> <span class="n">ParseIdentifierExpr</span><span class="p">();</span>
+  <span class="k">case</span> <span class="n">tok_number</span>:     <span class="k">return</span> <span class="n">ParseNumberExpr</span><span class="p">();</span>
+  <span class="k">case</span> <span class="sc">'('</span>:            <span class="k">return</span> <span class="n">ParseParenExpr</span><span class="p">();</span>
+  <span class="k">case</span> <span class="n">tok_if</span>:         <span class="k">return</span> <span class="n">ParseIfExpr</span><span class="p">();</span>
+  <span class="k">case</span> <span class="n">tok_for</span>:        <span class="k">return</span> <span class="n">ParseForExpr</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="c1">/// unary</span>
+<span class="c1">///   ::= primary</span>
+<span class="c1">///   ::= '!' unary</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseUnary</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// If the current token is not an operator, it must be a primary expr.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">isascii</span><span class="p">(</span><span class="n">CurTok</span><span class="p">)</span> <span class="o">||</span> <span class="n">CurTok</span> <span class="o">==</span> <span class="sc">'('</span> <span class="o">||</span> <span class="n">CurTok</span> <span class="o">==</span> <span class="sc">','</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ParsePrimary</span><span class="p">();</span>
+  
+  <span class="c1">// If this is a unary operator, read it.</span>
+  <span class="kt">int</span> <span class="n">Opc</span> <span class="o">=</span> <span class="n">CurTok</span><span class="p">;</span>
+  <span class="n">getNextToken</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">ExprAST</span> <span class="o">*</span><span class="n">Operand</span> <span class="o">=</span> <span class="n">ParseUnary</span><span class="p">())</span>
+    <span class="k">return</span> <span class="k">new</span> <span class="n">UnaryExprAST</span><span class="p">(</span><span class="n">Opc</span><span class="p">,</span> <span class="n">Operand</span><span class="p">);</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// binoprhs</span>
+<span class="c1">///   ::= ('+' unary)*</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseBinOpRHS</span><span class="p">(</span><span class="kt">int</span> <span class="n">ExprPrec</span><span class="p">,</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="n">LHS</span><span class="p">)</span> <span class="p">{</span>
+  <span class="c1">// If this is a binop, find its precedence.</span>
+  <span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+    <span class="kt">int</span> <span class="n">TokPrec</span> <span class="o">=</span> <span class="n">GetTokPrecedence</span><span class="p">();</span>
+    
+    <span class="c1">// If this is a binop that binds at least as tightly as the current binop,</span>
+    <span class="c1">// consume it, otherwise we are done.</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">TokPrec</span> <span class="o"><</span> <span class="n">ExprPrec</span><span class="p">)</span>
+      <span class="k">return</span> <span class="n">LHS</span><span class="p">;</span>
+    
+    <span class="c1">// Okay, we know this is a binop.</span>
+    <span class="kt">int</span> <span class="n">BinOp</span> <span class="o">=</span> <span class="n">CurTok</span><span class="p">;</span>
+    <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat binop</span>
+    
+    <span class="c1">// Parse the unary expression after the binary operator.</span>
+    <span class="n">ExprAST</span> <span class="o">*</span><span class="n">RHS</span> <span class="o">=</span> <span class="n">ParseUnary</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">RHS</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+    
+    <span class="c1">// If BinOp binds less tightly with RHS than the operator after RHS, let</span>
+    <span class="c1">// the pending operator take RHS as its LHS.</span>
+    <span class="kt">int</span> <span class="n">NextPrec</span> <span class="o">=</span> <span class="n">GetTokPrecedence</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">TokPrec</span> <span class="o"><</span> <span class="n">NextPrec</span><span class="p">)</span> <span class="p">{</span>
+      <span class="n">RHS</span> <span class="o">=</span> <span class="n">ParseBinOpRHS</span><span class="p">(</span><span class="n">TokPrec</span><span class="o">+</span><span class="mi">1</span><span class="p">,</span> <span class="n">RHS</span><span class="p">);</span>
+      <span class="k">if</span> <span class="p">(</span><span class="n">RHS</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="p">}</span>
+    
+    <span class="c1">// Merge LHS/RHS.</span>
+    <span class="n">LHS</span> <span class="o">=</span> <span class="k">new</span> <span class="n">BinaryExprAST</span><span class="p">(</span><span class="n">BinOp</span><span class="p">,</span> <span class="n">LHS</span><span class="p">,</span> <span class="n">RHS</span><span class="p">);</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="c1">/// expression</span>
+<span class="c1">///   ::= unary binoprhs</span>
+<span class="c1">///</span>
+<span class="k">static</span> <span class="n">ExprAST</span> <span class="o">*</span><span class="nf">ParseExpression</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">ExprAST</span> <span class="o">*</span><span class="n">LHS</span> <span class="o">=</span> <span class="n">ParseUnary</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">LHS</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="k">return</span> <span class="n">ParseBinOpRHS</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">LHS</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="c1">/// prototype</span>
+<span class="c1">///   ::= id '(' id* ')'</span>
+<span class="c1">///   ::= binary LETTER number? (id, id)</span>
+<span class="c1">///   ::= unary LETTER (id)</span>
+<span class="k">static</span> <span class="n">PrototypeAST</span> <span class="o">*</span><span class="nf">ParsePrototype</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">FnName</span><span class="p">;</span>
+  
+  <span class="kt">unsigned</span> <span class="n">Kind</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="c1">// 0 = identifier, 1 = unary, 2 = binary.</span>
+  <span class="kt">unsigned</span> <span class="n">BinaryPrecedence</span> <span class="o">=</span> <span class="mi">30</span><span class="p">;</span>
+  
+  <span class="k">switch</span> <span class="p">(</span><span class="n">CurTok</span><span class="p">)</span> <span class="p">{</span>
+  <span class="nl">default:</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected function name in prototype"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="n">tok_identifier</span>:
+    <span class="n">FnName</span> <span class="o">=</span> <span class="n">IdentifierStr</span><span class="p">;</span>
+    <span class="n">Kind</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+    <span class="k">break</span><span class="p">;</span>
+  <span class="k">case</span> <span class="n">tok_unary</span>:
+    <span class="n">getNextToken</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">isascii</span><span class="p">(</span><span class="n">CurTok</span><span class="p">))</span>
+      <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected unary operator"</span><span class="p">);</span>
+    <span class="n">FnName</span> <span class="o">=</span> <span class="s">"unary"</span><span class="p">;</span>
+    <span class="n">FnName</span> <span class="o">+=</span> <span class="p">(</span><span class="kt">char</span><span class="p">)</span><span class="n">CurTok</span><span class="p">;</span>
+    <span class="n">Kind</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+    <span class="k">break</span><span class="p">;</span>
+  <span class="k">case</span> <span class="n">tok_binary</span>:
+    <span class="n">getNextToken</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">isascii</span><span class="p">(</span><span class="n">CurTok</span><span class="p">))</span>
+      <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected binary operator"</span><span class="p">);</span>
+    <span class="n">FnName</span> <span class="o">=</span> <span class="s">"binary"</span><span class="p">;</span>
+    <span class="n">FnName</span> <span class="o">+=</span> <span class="p">(</span><span class="kt">char</span><span class="p">)</span><span class="n">CurTok</span><span class="p">;</span>
+    <span class="n">Kind</span> <span class="o">=</span> <span class="mi">2</span><span class="p">;</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+    
+    <span class="c1">// Read the precedence if present.</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">==</span> <span class="n">tok_number</span><span class="p">)</span> <span class="p">{</span>
+      <span class="k">if</span> <span class="p">(</span><span class="n">NumVal</span> <span class="o"><</span> <span class="mi">1</span> <span class="o">||</span> <span class="n">NumVal</span> <span class="o">></span> <span class="mi">100</span><span class="p">)</span>
+        <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Invalid precedecnce: must be 1..100"</span><span class="p">);</span>
+      <span class="n">BinaryPrecedence</span> <span class="o">=</span> <span class="p">(</span><span class="kt">unsigned</span><span class="p">)</span><span class="n">NumVal</span><span class="p">;</span>
+      <span class="n">getNextToken</span><span class="p">();</span>
+    <span class="p">}</span>
+    <span class="k">break</span><span class="p">;</span>
+  <span class="p">}</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">'('</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected '(' in prototype"</span><span class="p">);</span>
+  
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="n">ArgNames</span><span class="p">;</span>
+  <span class="k">while</span> <span class="p">(</span><span class="n">getNextToken</span><span class="p">()</span> <span class="o">==</span> <span class="n">tok_identifier</span><span class="p">)</span>
+    <span class="n">ArgNames</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="n">IdentifierStr</span><span class="p">);</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CurTok</span> <span class="o">!=</span> <span class="sc">')'</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Expected ')' in prototype"</span><span class="p">);</span>
+  
+  <span class="c1">// success.</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat ')'.</span>
+  
+  <span class="c1">// Verify right number of names for operator.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Kind</span> <span class="o">&&</span> <span class="n">ArgNames</span><span class="p">.</span><span class="n">size</span><span class="p">()</span> <span class="o">!=</span> <span class="n">Kind</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorP</span><span class="p">(</span><span class="s">"Invalid number of operands for operator"</span><span class="p">);</span>
+  
+  <span class="k">return</span> <span class="k">new</span> <span class="n">PrototypeAST</span><span class="p">(</span><span class="n">FnName</span><span class="p">,</span> <span class="n">ArgNames</span><span class="p">,</span> <span class="n">Kind</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">BinaryPrecedence</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="c1">/// definition ::= 'def' prototype expression</span>
+<span class="k">static</span> <span class="n">FunctionAST</span> <span class="o">*</span><span class="nf">ParseDefinition</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat def.</span>
+  <span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">Proto</span> <span class="o">=</span> <span class="n">ParsePrototype</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Proto</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">ExprAST</span> <span class="o">*</span><span class="n">E</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">())</span>
+    <span class="k">return</span> <span class="k">new</span> <span class="n">FunctionAST</span><span class="p">(</span><span class="n">Proto</span><span class="p">,</span> <span class="n">E</span><span class="p">);</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// toplevelexpr ::= expression</span>
+<span class="k">static</span> <span class="n">FunctionAST</span> <span class="o">*</span><span class="nf">ParseTopLevelExpr</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">ExprAST</span> <span class="o">*</span><span class="n">E</span> <span class="o">=</span> <span class="n">ParseExpression</span><span class="p">())</span> <span class="p">{</span>
+    <span class="c1">// Make an anonymous proto.</span>
+    <span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">Proto</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PrototypeAST</span><span class="p">(</span><span class="s">""</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span><span class="p">());</span>
+    <span class="k">return</span> <span class="k">new</span> <span class="n">FunctionAST</span><span class="p">(</span><span class="n">Proto</span><span class="p">,</span> <span class="n">E</span><span class="p">);</span>
+  <span class="p">}</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// external ::= 'extern' prototype</span>
+<span class="k">static</span> <span class="n">PrototypeAST</span> <span class="o">*</span><span class="nf">ParseExtern</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">getNextToken</span><span class="p">();</span>  <span class="c1">// eat extern.</span>
+  <span class="k">return</span> <span class="n">ParsePrototype</span><span class="p">();</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Code Generation</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="k">static</span> <span class="n">Module</span> <span class="o">*</span><span class="n">TheModule</span><span class="p">;</span>
+<span class="k">static</span> <span class="n">IRBuilder</span><span class="o"><></span> <span class="n">Builder</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">());</span>
+<span class="k">static</span> <span class="n">std</span><span class="o">::</span><span class="n">map</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="p">,</span> <span class="n">Value</span><span class="o">*></span> <span class="n">NamedValues</span><span class="p">;</span>
+<span class="k">static</span> <span class="n">FunctionPassManager</span> <span class="o">*</span><span class="n">TheFPM</span><span class="p">;</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="nf">ErrorV</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">Str</span><span class="p">)</span> <span class="p">{</span> <span class="n">Error</span><span class="p">(</span><span class="n">Str</span><span class="p">);</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">NumberExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="n">ConstantFP</span><span class="o">::</span><span class="n">get</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="n">APFloat</span><span class="p">(</span><span class="n">Val</span><span class="p">));</span>
+<span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">VariableExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Look this variable up in the function.</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">V</span> <span class="o">=</span> <span class="n">NamedValues</span><span class="p">[</span><span class="n">Name</span><span class="p">];</span>
+  <span class="k">return</span> <span class="n">V</span> <span class="o">?</span> <span class="n">V</span> <span class="o">:</span> <span class="n">ErrorV</span><span class="p">(</span><span class="s">"Unknown variable name"</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">UnaryExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">OperandV</span> <span class="o">=</span> <span class="n">Operand</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">OperandV</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="n">Function</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">TheModule</span><span class="o">-></span><span class="n">getFunction</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="p">(</span><span class="s">"unary"</span><span class="p">)</span><span class="o">+</span><span class="n">Opcode</span><span class="p">);</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">F</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorV</span><span class="p">(</span><span class="s">"Unknown unary operator"</span><span class="p">);</span>
+  
+  <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateCall</span><span class="p">(</span><span class="n">F</span><span class="p">,</span> <span class="n">OperandV</span><span class="p">,</span> <span class="s">"unop"</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">BinaryExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">L</span> <span class="o">=</span> <span class="n">LHS</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">R</span> <span class="o">=</span> <span class="n">RHS</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">L</span> <span class="o">==</span> <span class="mi">0</span> <span class="o">||</span> <span class="n">R</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="k">switch</span> <span class="p">(</span><span class="n">Op</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">case</span> <span class="sc">'+'</span>: <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFAdd</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"addtmp"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="sc">'-'</span>: <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFSub</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"subtmp"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="sc">'*'</span>: <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFMul</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"multmp"</span><span class="p">);</span>
+  <span class="k">case</span> <span class="sc">'<'</span>:
+    <span class="n">L</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFCmpULT</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="s">"cmptmp"</span><span class="p">);</span>
+    <span class="c1">// Convert bool 0/1 to double 0.0 or 1.0</span>
+    <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateUIToFP</span><span class="p">(</span><span class="n">L</span><span class="p">,</span> <span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()),</span>
+                                <span class="s">"booltmp"</span><span class="p">);</span>
+  <span class="nl">default:</span> <span class="k">break</span><span class="p">;</span>
+  <span class="p">}</span>
+  
+  <span class="c1">// If it wasn't a builtin binary operator, it must be a user defined one. Emit</span>
+  <span class="c1">// a call to it.</span>
+  <span class="n">Function</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">TheModule</span><span class="o">-></span><span class="n">getFunction</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="p">(</span><span class="s">"binary"</span><span class="p">)</span><span class="o">+</span><span class="n">Op</span><span class="p">);</span>
+  <span class="n">assert</span><span class="p">(</span><span class="n">F</span> <span class="o">&&</span> <span class="s">"binary operator not found!"</span><span class="p">);</span>
+  
+  <span class="n">Value</span> <span class="o">*</span><span class="n">Ops</span><span class="p">[]</span> <span class="o">=</span> <span class="p">{</span> <span class="n">L</span><span class="p">,</span> <span class="n">R</span> <span class="p">};</span>
+  <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateCall</span><span class="p">(</span><span class="n">F</span><span class="p">,</span> <span class="n">Ops</span><span class="p">,</span> <span class="s">"binop"</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">CallExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Look up the name in the global module table.</span>
+  <span class="n">Function</span> <span class="o">*</span><span class="n">CalleeF</span> <span class="o">=</span> <span class="n">TheModule</span><span class="o">-></span><span class="n">getFunction</span><span class="p">(</span><span class="n">Callee</span><span class="p">);</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CalleeF</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">ErrorV</span><span class="p">(</span><span class="s">"Unknown function referenced"</span><span class="p">);</span>
+  
+  <span class="c1">// If argument mismatch error.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CalleeF</span><span class="o">-></span><span class="n">arg_size</span><span class="p">()</span> <span class="o">!=</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">())</span>
+    <span class="k">return</span> <span class="n">ErrorV</span><span class="p">(</span><span class="s">"Incorrect # arguments passed"</span><span class="p">);</span>
+
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">Value</span><span class="o">*></span> <span class="n">ArgsV</span><span class="p">;</span>
+  <span class="k">for</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">e</span> <span class="o">=</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">();</span> <span class="n">i</span> <span class="o">!=</span> <span class="n">e</span><span class="p">;</span> <span class="o">++</span><span class="n">i</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">ArgsV</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="n">Args</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">-></span><span class="n">Codegen</span><span class="p">());</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">ArgsV</span><span class="p">.</span><span class="n">back</span><span class="p">()</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="p">}</span>
+  
+  <span class="k">return</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateCall</span><span class="p">(</span><span class="n">CalleeF</span><span class="p">,</span> <span class="n">ArgsV</span><span class="p">,</span> <span class="s">"calltmp"</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">IfExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">CondV</span> <span class="o">=</span> <span class="n">Cond</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">CondV</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="c1">// Convert condition to a bool by comparing equal to 0.0.</span>
+  <span class="n">CondV</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFCmpONE</span><span class="p">(</span><span class="n">CondV</span><span class="p">,</span> 
+                              <span class="n">ConstantFP</span><span class="o">::</span><span class="n">get</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="n">APFloat</span><span class="p">(</span><span class="mf">0.0</span><span class="p">)),</span>
+                                <span class="s">"ifcond"</span><span class="p">);</span>
+  
+  <span class="n">Function</span> <span class="o">*</span><span class="n">TheFunction</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">GetInsertBlock</span><span class="p">()</span><span class="o">-></span><span class="n">getParent</span><span class="p">();</span>
+  
+  <span class="c1">// Create blocks for the then and else cases.  Insert the 'then' block at the</span>
+  <span class="c1">// end of the function.</span>
+  <span class="n">BasicBlock</span> <span class="o">*</span><span class="n">ThenBB</span> <span class="o">=</span> <span class="n">BasicBlock</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="s">"then"</span><span class="p">,</span> <span class="n">TheFunction</span><span class="p">);</span>
+  <span class="n">BasicBlock</span> <span class="o">*</span><span class="n">ElseBB</span> <span class="o">=</span> <span class="n">BasicBlock</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="s">"else"</span><span class="p">);</span>
+  <span class="n">BasicBlock</span> <span class="o">*</span><span class="n">MergeBB</span> <span class="o">=</span> <span class="n">BasicBlock</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="s">"ifcont"</span><span class="p">);</span>
+  
+  <span class="n">Builder</span><span class="p">.</span><span class="n">CreateCondBr</span><span class="p">(</span><span class="n">CondV</span><span class="p">,</span> <span class="n">ThenBB</span><span class="p">,</span> <span class="n">ElseBB</span><span class="p">);</span>
+  
+  <span class="c1">// Emit then value.</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">SetInsertPoint</span><span class="p">(</span><span class="n">ThenBB</span><span class="p">);</span>
+  
+  <span class="n">Value</span> <span class="o">*</span><span class="n">ThenV</span> <span class="o">=</span> <span class="n">Then</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">ThenV</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="n">Builder</span><span class="p">.</span><span class="n">CreateBr</span><span class="p">(</span><span class="n">MergeBB</span><span class="p">);</span>
+  <span class="c1">// Codegen of 'Then' can change the current block, update ThenBB for the PHI.</span>
+  <span class="n">ThenBB</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">GetInsertBlock</span><span class="p">();</span>
+  
+  <span class="c1">// Emit else block.</span>
+  <span class="n">TheFunction</span><span class="o">-></span><span class="n">getBasicBlockList</span><span class="p">().</span><span class="n">push_back</span><span class="p">(</span><span class="n">ElseBB</span><span class="p">);</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">SetInsertPoint</span><span class="p">(</span><span class="n">ElseBB</span><span class="p">);</span>
+  
+  <span class="n">Value</span> <span class="o">*</span><span class="n">ElseV</span> <span class="o">=</span> <span class="n">Else</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">ElseV</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="n">Builder</span><span class="p">.</span><span class="n">CreateBr</span><span class="p">(</span><span class="n">MergeBB</span><span class="p">);</span>
+  <span class="c1">// Codegen of 'Else' can change the current block, update ElseBB for the PHI.</span>
+  <span class="n">ElseBB</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">GetInsertBlock</span><span class="p">();</span>
+  
+  <span class="c1">// Emit merge block.</span>
+  <span class="n">TheFunction</span><span class="o">-></span><span class="n">getBasicBlockList</span><span class="p">().</span><span class="n">push_back</span><span class="p">(</span><span class="n">MergeBB</span><span class="p">);</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">SetInsertPoint</span><span class="p">(</span><span class="n">MergeBB</span><span class="p">);</span>
+  <span class="n">PHINode</span> <span class="o">*</span><span class="n">PN</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreatePHI</span><span class="p">(</span><span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()),</span> <span class="mi">2</span><span class="p">,</span>
+                                  <span class="s">"iftmp"</span><span class="p">);</span>
+  
+  <span class="n">PN</span><span class="o">-></span><span class="n">addIncoming</span><span class="p">(</span><span class="n">ThenV</span><span class="p">,</span> <span class="n">ThenBB</span><span class="p">);</span>
+  <span class="n">PN</span><span class="o">-></span><span class="n">addIncoming</span><span class="p">(</span><span class="n">ElseV</span><span class="p">,</span> <span class="n">ElseBB</span><span class="p">);</span>
+  <span class="k">return</span> <span class="n">PN</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="n">Value</span> <span class="o">*</span><span class="n">ForExprAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Output this as:</span>
+  <span class="c1">//   ...</span>
+  <span class="c1">//   start = startexpr</span>
+  <span class="c1">//   goto loop</span>
+  <span class="c1">// loop: </span>
+  <span class="c1">//   variable = phi [start, loopheader], [nextvariable, loopend]</span>
+  <span class="c1">//   ...</span>
+  <span class="c1">//   bodyexpr</span>
+  <span class="c1">//   ...</span>
+  <span class="c1">// loopend:</span>
+  <span class="c1">//   step = stepexpr</span>
+  <span class="c1">//   nextvariable = variable + step</span>
+  <span class="c1">//   endcond = endexpr</span>
+  <span class="c1">//   br endcond, loop, endloop</span>
+  <span class="c1">// outloop:</span>
+  
+  <span class="c1">// Emit the start code first, without 'variable' in scope.</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">StartVal</span> <span class="o">=</span> <span class="n">Start</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">StartVal</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="c1">// Make the new basic block for the loop header, inserting after current</span>
+  <span class="c1">// block.</span>
+  <span class="n">Function</span> <span class="o">*</span><span class="n">TheFunction</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">GetInsertBlock</span><span class="p">()</span><span class="o">-></span><span class="n">getParent</span><span class="p">();</span>
+  <span class="n">BasicBlock</span> <span class="o">*</span><span class="n">PreheaderBB</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">GetInsertBlock</span><span class="p">();</span>
+  <span class="n">BasicBlock</span> <span class="o">*</span><span class="n">LoopBB</span> <span class="o">=</span> <span class="n">BasicBlock</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="s">"loop"</span><span class="p">,</span> <span class="n">TheFunction</span><span class="p">);</span>
+  
+  <span class="c1">// Insert an explicit fall through from the current block to the LoopBB.</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">CreateBr</span><span class="p">(</span><span class="n">LoopBB</span><span class="p">);</span>
+
+  <span class="c1">// Start insertion in LoopBB.</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">SetInsertPoint</span><span class="p">(</span><span class="n">LoopBB</span><span class="p">);</span>
+  
+  <span class="c1">// Start the PHI node with an entry for Start.</span>
+  <span class="n">PHINode</span> <span class="o">*</span><span class="n">Variable</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreatePHI</span><span class="p">(</span><span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()),</span> <span class="mi">2</span><span class="p">,</span> <span class="n">VarName</span><span class="p">.</span><span class="n">c_str</span><span class="p">());</span>
+  <span class="n">Variable</span><span class="o">-></span><span class="n">addIncoming</span><span class="p">(</span><span class="n">StartVal</span><span class="p">,</span> <span class="n">PreheaderBB</span><span class="p">);</span>
+  
+  <span class="c1">// Within the loop, the variable is defined equal to the PHI node.  If it</span>
+  <span class="c1">// shadows an existing variable, we have to restore it, so save it now.</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">OldVal</span> <span class="o">=</span> <span class="n">NamedValues</span><span class="p">[</span><span class="n">VarName</span><span class="p">];</span>
+  <span class="n">NamedValues</span><span class="p">[</span><span class="n">VarName</span><span class="p">]</span> <span class="o">=</span> <span class="n">Variable</span><span class="p">;</span>
+  
+  <span class="c1">// Emit the body of the loop.  This, like any other expr, can change the</span>
+  <span class="c1">// current BB.  Note that we ignore the value computed by the body, but don't</span>
+  <span class="c1">// allow an error.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Body</span><span class="o">-></span><span class="n">Codegen</span><span class="p">()</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
+    <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="c1">// Emit the step value.</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">StepVal</span><span class="p">;</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Step</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">StepVal</span> <span class="o">=</span> <span class="n">Step</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">StepVal</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+    <span class="c1">// If not specified, use 1.0.</span>
+    <span class="n">StepVal</span> <span class="o">=</span> <span class="n">ConstantFP</span><span class="o">::</span><span class="n">get</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="n">APFloat</span><span class="p">(</span><span class="mf">1.0</span><span class="p">));</span>
+  <span class="p">}</span>
+  
+  <span class="n">Value</span> <span class="o">*</span><span class="n">NextVar</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFAdd</span><span class="p">(</span><span class="n">Variable</span><span class="p">,</span> <span class="n">StepVal</span><span class="p">,</span> <span class="s">"nextvar"</span><span class="p">);</span>
+
+  <span class="c1">// Compute the end condition.</span>
+  <span class="n">Value</span> <span class="o">*</span><span class="n">EndCond</span> <span class="o">=</span> <span class="n">End</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">EndCond</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="n">EndCond</span><span class="p">;</span>
+  
+  <span class="c1">// Convert condition to a bool by comparing equal to 0.0.</span>
+  <span class="n">EndCond</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">CreateFCmpONE</span><span class="p">(</span><span class="n">EndCond</span><span class="p">,</span> 
+                              <span class="n">ConstantFP</span><span class="o">::</span><span class="n">get</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="n">APFloat</span><span class="p">(</span><span class="mf">0.0</span><span class="p">)),</span>
+                                  <span class="s">"loopcond"</span><span class="p">);</span>
+  
+  <span class="c1">// Create the "after loop" block and insert it.</span>
+  <span class="n">BasicBlock</span> <span class="o">*</span><span class="n">LoopEndBB</span> <span class="o">=</span> <span class="n">Builder</span><span class="p">.</span><span class="n">GetInsertBlock</span><span class="p">();</span>
+  <span class="n">BasicBlock</span> <span class="o">*</span><span class="n">AfterBB</span> <span class="o">=</span> <span class="n">BasicBlock</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="s">"afterloop"</span><span class="p">,</span> <span class="n">TheFunction</span><span class="p">);</span>
+  
+  <span class="c1">// Insert the conditional branch into the end of LoopEndBB.</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">CreateCondBr</span><span class="p">(</span><span class="n">EndCond</span><span class="p">,</span> <span class="n">LoopBB</span><span class="p">,</span> <span class="n">AfterBB</span><span class="p">);</span>
+  
+  <span class="c1">// Any new code will be inserted in AfterBB.</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">SetInsertPoint</span><span class="p">(</span><span class="n">AfterBB</span><span class="p">);</span>
+  
+  <span class="c1">// Add a new entry to the PHI node for the backedge.</span>
+  <span class="n">Variable</span><span class="o">-></span><span class="n">addIncoming</span><span class="p">(</span><span class="n">NextVar</span><span class="p">,</span> <span class="n">LoopEndBB</span><span class="p">);</span>
+  
+  <span class="c1">// Restore the unshadowed variable.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">OldVal</span><span class="p">)</span>
+    <span class="n">NamedValues</span><span class="p">[</span><span class="n">VarName</span><span class="p">]</span> <span class="o">=</span> <span class="n">OldVal</span><span class="p">;</span>
+  <span class="k">else</span>
+    <span class="n">NamedValues</span><span class="p">.</span><span class="n">erase</span><span class="p">(</span><span class="n">VarName</span><span class="p">);</span>
+
+  
+  <span class="c1">// for expr always returns 0.0.</span>
+  <span class="k">return</span> <span class="n">Constant</span><span class="o">::</span><span class="n">getNullValue</span><span class="p">(</span><span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()));</span>
+<span class="p">}</span>
+
+<span class="n">Function</span> <span class="o">*</span><span class="n">PrototypeAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Make the function type:  double(double,double) etc.</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">Type</span><span class="o">*></span> <span class="n">Doubles</span><span class="p">(</span><span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">(),</span>
+                             <span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()));</span>
+  <span class="n">FunctionType</span> <span class="o">*</span><span class="n">FT</span> <span class="o">=</span> <span class="n">FunctionType</span><span class="o">::</span><span class="n">get</span><span class="p">(</span><span class="n">Type</span><span class="o">::</span><span class="n">getDoubleTy</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">()),</span>
+                                       <span class="n">Doubles</span><span class="p">,</span> <span class="nb">false</span><span class="p">);</span>
+  
+  <span class="n">Function</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">Function</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">FT</span><span class="p">,</span> <span class="n">Function</span><span class="o">::</span><span class="n">ExternalLinkage</span><span class="p">,</span> <span class="n">Name</span><span class="p">,</span> <span class="n">TheModule</span><span class="p">);</span>
+  
+  <span class="c1">// If F conflicted, there was already something named 'Name'.  If it has a</span>
+  <span class="c1">// body, don't allow redefinition or reextern.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">F</span><span class="o">-></span><span class="n">getName</span><span class="p">()</span> <span class="o">!=</span> <span class="n">Name</span><span class="p">)</span> <span class="p">{</span>
+    <span class="c1">// Delete the one we just made and get the existing one.</span>
+    <span class="n">F</span><span class="o">-></span><span class="n">eraseFromParent</span><span class="p">();</span>
+    <span class="n">F</span> <span class="o">=</span> <span class="n">TheModule</span><span class="o">-></span><span class="n">getFunction</span><span class="p">(</span><span class="n">Name</span><span class="p">);</span>
+    
+    <span class="c1">// If F already has a body, reject this.</span>
+    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">F</span><span class="o">-></span><span class="n">empty</span><span class="p">())</span> <span class="p">{</span>
+      <span class="n">ErrorF</span><span class="p">(</span><span class="s">"redefinition of function"</span><span class="p">);</span>
+      <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="p">}</span>
+    
+    <span class="c1">// If F took a different number of args, reject.</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">F</span><span class="o">-></span><span class="n">arg_size</span><span class="p">()</span> <span class="o">!=</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">())</span> <span class="p">{</span>
+      <span class="n">ErrorF</span><span class="p">(</span><span class="s">"redefinition of function with different # args"</span><span class="p">);</span>
+      <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="p">}</span>
+  <span class="p">}</span>
+  
+  <span class="c1">// Set names for all arguments.</span>
+  <span class="kt">unsigned</span> <span class="n">Idx</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+  <span class="k">for</span> <span class="p">(</span><span class="n">Function</span><span class="o">::</span><span class="n">arg_iterator</span> <span class="n">AI</span> <span class="o">=</span> <span class="n">F</span><span class="o">-></span><span class="n">arg_begin</span><span class="p">();</span> <span class="n">Idx</span> <span class="o">!=</span> <span class="n">Args</span><span class="p">.</span><span class="n">size</span><span class="p">();</span>
+       <span class="o">++</span><span class="n">AI</span><span class="p">,</span> <span class="o">++</span><span class="n">Idx</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">AI</span><span class="o">-></span><span class="n">setName</span><span class="p">(</span><span class="n">Args</span><span class="p">[</span><span class="n">Idx</span><span class="p">]);</span>
+    
+    <span class="c1">// Add arguments to variable symbol table.</span>
+    <span class="n">NamedValues</span><span class="p">[</span><span class="n">Args</span><span class="p">[</span><span class="n">Idx</span><span class="p">]]</span> <span class="o">=</span> <span class="n">AI</span><span class="p">;</span>
+  <span class="p">}</span>
+  
+  <span class="k">return</span> <span class="n">F</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="n">Function</span> <span class="o">*</span><span class="n">FunctionAST</span><span class="o">::</span><span class="n">Codegen</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">NamedValues</span><span class="p">.</span><span class="n">clear</span><span class="p">();</span>
+  
+  <span class="n">Function</span> <span class="o">*</span><span class="n">TheFunction</span> <span class="o">=</span> <span class="n">Proto</span><span class="o">-></span><span class="n">Codegen</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">TheFunction</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
+    <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+  
+  <span class="c1">// If this is an operator, install it.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">Proto</span><span class="o">-></span><span class="n">isBinaryOp</span><span class="p">())</span>
+    <span class="n">BinopPrecedence</span><span class="p">[</span><span class="n">Proto</span><span class="o">-></span><span class="n">getOperatorName</span><span class="p">()]</span> <span class="o">=</span> <span class="n">Proto</span><span class="o">-></span><span class="n">getBinaryPrecedence</span><span class="p">();</span>
+  
+  <span class="c1">// Create a new basic block to start insertion into.</span>
+  <span class="n">BasicBlock</span> <span class="o">*</span><span class="n">BB</span> <span class="o">=</span> <span class="n">BasicBlock</span><span class="o">::</span><span class="n">Create</span><span class="p">(</span><span class="n">getGlobalContext</span><span class="p">(),</span> <span class="s">"entry"</span><span class="p">,</span> <span class="n">TheFunction</span><span class="p">);</span>
+  <span class="n">Builder</span><span class="p">.</span><span class="n">SetInsertPoint</span><span class="p">(</span><span class="n">BB</span><span class="p">);</span>
+  
+  <span class="k">if</span> <span class="p">(</span><span class="n">Value</span> <span class="o">*</span><span class="n">RetVal</span> <span class="o">=</span> <span class="n">Body</span><span class="o">-></span><span class="n">Codegen</span><span class="p">())</span> <span class="p">{</span>
+    <span class="c1">// Finish off the function.</span>
+    <span class="n">Builder</span><span class="p">.</span><span class="n">CreateRet</span><span class="p">(</span><span class="n">RetVal</span><span class="p">);</span>
+
+    <span class="c1">// Validate the generated code, checking for consistency.</span>
+    <span class="n">verifyFunction</span><span class="p">(</span><span class="o">*</span><span class="n">TheFunction</span><span class="p">);</span>
+
+    <span class="c1">// Optimize the function.</span>
+    <span class="n">TheFPM</span><span class="o">-></span><span class="n">run</span><span class="p">(</span><span class="o">*</span><span class="n">TheFunction</span><span class="p">);</span>
+    
+    <span class="k">return</span> <span class="n">TheFunction</span><span class="p">;</span>
+  <span class="p">}</span>
+  
+  <span class="c1">// Error reading body, remove function.</span>
+  <span class="n">TheFunction</span><span class="o">-></span><span class="n">eraseFromParent</span><span class="p">();</span>
+
+  <span class="k">if</span> <span class="p">(</span><span class="n">Proto</span><span class="o">-></span><span class="n">isBinaryOp</span><span class="p">())</span>
+    <span class="n">BinopPrecedence</span><span class="p">.</span><span class="n">erase</span><span class="p">(</span><span class="n">Proto</span><span class="o">-></span><span class="n">getOperatorName</span><span class="p">());</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Top-Level parsing and JIT Driver</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="k">static</span> <span class="n">ExecutionEngine</span> <span class="o">*</span><span class="n">TheExecutionEngine</span><span class="p">;</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">HandleDefinition</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">FunctionAST</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">ParseDefinition</span><span class="p">())</span> <span class="p">{</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">Function</span> <span class="o">*</span><span class="n">LF</span> <span class="o">=</span> <span class="n">F</span><span class="o">-></span><span class="n">Codegen</span><span class="p">())</span> <span class="p">{</span>
+      <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Read function definition:"</span><span class="p">);</span>
+      <span class="n">LF</span><span class="o">-></span><span class="n">dump</span><span class="p">();</span>
+    <span class="p">}</span>
+  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+    <span class="c1">// Skip token for error recovery.</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">HandleExtern</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">PrototypeAST</span> <span class="o">*</span><span class="n">P</span> <span class="o">=</span> <span class="n">ParseExtern</span><span class="p">())</span> <span class="p">{</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">Function</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">P</span><span class="o">-></span><span class="n">Codegen</span><span class="p">())</span> <span class="p">{</span>
+      <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Read extern: "</span><span class="p">);</span>
+      <span class="n">F</span><span class="o">-></span><span class="n">dump</span><span class="p">();</span>
+    <span class="p">}</span>
+  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+    <span class="c1">// Skip token for error recovery.</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">HandleTopLevelExpression</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// Evaluate a top-level expression into an anonymous function.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">FunctionAST</span> <span class="o">*</span><span class="n">F</span> <span class="o">=</span> <span class="n">ParseTopLevelExpr</span><span class="p">())</span> <span class="p">{</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">Function</span> <span class="o">*</span><span class="n">LF</span> <span class="o">=</span> <span class="n">F</span><span class="o">-></span><span class="n">Codegen</span><span class="p">())</span> <span class="p">{</span>
+      <span class="c1">// JIT the function, returning a function pointer.</span>
+      <span class="kt">void</span> <span class="o">*</span><span class="n">FPtr</span> <span class="o">=</span> <span class="n">TheExecutionEngine</span><span class="o">-></span><span class="n">getPointerToFunction</span><span class="p">(</span><span class="n">LF</span><span class="p">);</span>
+      
+      <span class="c1">// Cast it to the right type (takes no arguments, returns a double) so we</span>
+      <span class="c1">// can call it as a native function.</span>
+      <span class="kt">double</span> <span class="p">(</span><span class="o">*</span><span class="n">FP</span><span class="p">)()</span> <span class="o">=</span> <span class="p">(</span><span class="kt">double</span> <span class="p">(</span><span class="o">*</span><span class="p">)())(</span><span class="kt">intptr_t</span><span class="p">)</span><span class="n">FPtr</span><span class="p">;</span>
+      <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Evaluated to %f</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">FP</span><span class="p">());</span>
+    <span class="p">}</span>
+  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+    <span class="c1">// Skip token for error recovery.</span>
+    <span class="n">getNextToken</span><span class="p">();</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="c1">/// top ::= definition | external | expression | ';'</span>
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">MainLoop</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"ready> "</span><span class="p">);</span>
+    <span class="k">switch</span> <span class="p">(</span><span class="n">CurTok</span><span class="p">)</span> <span class="p">{</span>
+    <span class="k">case</span> <span class="n">tok_eof</span>:    <span class="k">return</span><span class="p">;</span>
+    <span class="k">case</span> <span class="sc">';'</span>:        <span class="n">getNextToken</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>  <span class="c1">// ignore top-level semicolons.</span>
+    <span class="k">case</span> <span class="n">tok_def</span>:    <span class="n">HandleDefinition</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>
+    <span class="k">case</span> <span class="n">tok_extern</span>: <span class="n">HandleExtern</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>
+    <span class="nl">default:</span>         <span class="n">HandleTopLevelExpression</span><span class="p">();</span> <span class="k">break</span><span class="p">;</span>
+    <span class="p">}</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// "Library" functions that can be "extern'd" from user code.</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="c1">/// putchard - putchar that takes a double and returns 0.</span>
+<span class="k">extern</span> <span class="s">"C"</span> 
+<span class="kt">double</span> <span class="n">putchard</span><span class="p">(</span><span class="kt">double</span> <span class="n">X</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">putchar</span><span class="p">((</span><span class="kt">char</span><span class="p">)</span><span class="n">X</span><span class="p">);</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">/// printd - printf that takes a double prints it as "%f\n", returning 0.</span>
+<span class="k">extern</span> <span class="s">"C"</span> 
+<span class="kt">double</span> <span class="n">printd</span><span class="p">(</span><span class="kt">double</span> <span class="n">X</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">printf</span><span class="p">(</span><span class="s">"%f</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">X</span><span class="p">);</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+<span class="c1">// Main driver code.</span>
+<span class="c1">//===----------------------------------------------------------------------===//</span>
+
+<span class="kt">int</span> <span class="n">main</span><span class="p">()</span> <span class="p">{</span>
+  <span class="n">InitializeNativeTarget</span><span class="p">();</span>
+  <span class="n">LLVMContext</span> <span class="o">&</span><span class="n">Context</span> <span class="o">=</span> <span class="n">getGlobalContext</span><span class="p">();</span>
+
+  <span class="c1">// Install standard binary operators.</span>
+  <span class="c1">// 1 is lowest precedence.</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'<'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">10</span><span class="p">;</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'+'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">20</span><span class="p">;</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'-'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">20</span><span class="p">;</span>
+  <span class="n">BinopPrecedence</span><span class="p">[</span><span class="sc">'*'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">40</span><span class="p">;</span>  <span class="c1">// highest.</span>
+
+  <span class="c1">// Prime the first token.</span>
+  <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"ready> "</span><span class="p">);</span>
+  <span class="n">getNextToken</span><span class="p">();</span>
+
+  <span class="c1">// Make the module, which holds all the code.</span>
+  <span class="n">TheModule</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Module</span><span class="p">(</span><span class="s">"my cool jit"</span><span class="p">,</span> <span class="n">Context</span><span class="p">);</span>
+
+  <span class="c1">// Create the JIT.  This takes ownership of the module.</span>
+  <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">ErrStr</span><span class="p">;</span>
+  <span class="n">TheExecutionEngine</span> <span class="o">=</span> <span class="n">EngineBuilder</span><span class="p">(</span><span class="n">TheModule</span><span class="p">).</span><span class="n">setErrorStr</span><span class="p">(</span><span class="o">&</span><span class="n">ErrStr</span><span class="p">).</span><span class="n">create</span><span class="p">();</span>
+  <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">TheExecutionEngine</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Could not create ExecutionEngine: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">ErrStr</span><span class="p">.</span><span class="n">c_str</span><span class="p">());</span>
+    <span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>
+  <span class="p">}</span>
+
+  <span class="n">FunctionPassManager</span> <span class="n">OurFPM</span><span class="p">(</span><span class="n">TheModule</span><span class="p">);</span>
+
+  <span class="c1">// Set up the optimizer pipeline.  Start with registering info about how the</span>
+  <span class="c1">// target lays out data structures.</span>
+  <span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="k">new</span> <span class="n">DataLayout</span><span class="p">(</span><span class="o">*</span><span class="n">TheExecutionEngine</span><span class="o">-></span><span class="n">getDataLayout</span><span class="p">()));</span>
+  <span class="c1">// Provide basic AliasAnalysis support for GVN.</span>
+  <span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createBasicAliasAnalysisPass</span><span class="p">());</span>
+  <span class="c1">// Do simple "peephole" optimizations and bit-twiddling optzns.</span>
+  <span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createInstructionCombiningPass</span><span class="p">());</span>
+  <span class="c1">// Reassociate expressions.</span>
+  <span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createReassociatePass</span><span class="p">());</span>
+  <span class="c1">// Eliminate Common SubExpressions.</span>
+  <span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createGVNPass</span><span class="p">());</span>
+  <span class="c1">// Simplify the control flow graph (deleting unreachable blocks, etc).</span>
+  <span class="n">OurFPM</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createCFGSimplificationPass</span><span class="p">());</span>
+
+  <span class="n">OurFPM</span><span class="p">.</span><span class="n">doInitialization</span><span class="p">();</span>
+
+  <span class="c1">// Set the global so the code gen can use this.</span>
+  <span class="n">TheFPM</span> <span class="o">=</span> <span class="o">&</span><span class="n">OurFPM</span><span class="p">;</span>
+
+  <span class="c1">// Run the main "interpreter loop" now.</span>
+  <span class="n">MainLoop</span><span class="p">();</span>
+
+  <span class="n">TheFPM</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+
+  <span class="c1">// Print out all of the generated code.</span>
+  <span class="n">TheModule</span><span class="o">-></span><span class="n">dump</span><span class="p">();</span>
+
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p><a class="reference external" href="LangImpl7.html">Next: Extending the language: mutable variables / SSA
+construction</a></p>
+</div>
+</div>
+
+
+          </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="LangImpl7.html" title="7. Kaleidoscope: Extending the Language: Mutable Variables"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="LangImpl5.html" title="5. Kaleidoscope: Extending the Language: Control Flow"
+             >previous</a> |</li>
+  <li><a href="http://llvm.org/">LLVM Home</a> | </li>
+  <li><a href="../index.html">Documentation</a>»</li>
+
+          <li><a href="index.html" >LLVM Tutorial: Table of Contents</a> »</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        © Copyright 2003-2013, LLVM Project.
+      Last updated on 2014-06-16.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
+    </div>
+  </body>
+</html>
\ No newline at end of file





More information about the llvm-commits mailing list