<div dir="ltr"><p style="margin:0px 0px 1em;padding:0px;border:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-weight:400;font-stretch:inherit;font-size:15px;line-height:inherit;font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;vertical-align:baseline;box-sizing:inherit;clear:both;color:rgb(36,39,41);letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">I am trying to parse LLVM IR from a bit code file. I went through the following steps.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-weight:400;font-stretch:inherit;font-size:15px;line-height:inherit;font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;vertical-align:baseline;box-sizing:inherit;clear:both;color:rgb(36,39,41);letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">hello.cpp</p><pre class="gmail-lang-cpp gmail-prettyprint gmail-prettyprinted" style="margin:0px 0px 1em;padding:5px;border:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-weight:400;font-stretch:inherit;font-size:13px;line-height:inherit;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;vertical-align:baseline;box-sizing:inherit;width:auto;max-height:600px;overflow:auto;background-color:rgb(239,240,241);display:block;color:rgb(57,51,24);word-wrap:normal;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><code style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:13px;line-height:inherit;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;vertical-align:baseline;box-sizing:inherit;background-color:rgb(239,240,241);white-space:inherit"><span class="gmail-com" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(133,140,147)">#include</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> </span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(125,39,39)"><iostream></span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">
</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(43,145,175)">int</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> main</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">()</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">{</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">
std</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">::</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">cout </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"><<</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> </span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(125,39,39)">"Hello world!"</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"><<</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> </span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(125,39,39)">"\n"</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(16,16,148)">return</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> </span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(125,39,39)">0</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">
</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">}</span></code></pre><p style="margin:0px 0px 1em;padding:0px;border:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-weight:400;font-stretch:inherit;font-size:15px;line-height:inherit;font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;vertical-align:baseline;box-sizing:inherit;clear:both;color:rgb(36,39,41);letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">dump.cpp</p><pre class="gmail-lang-cpp gmail-prettyprint gmail-prettyprinted" style="margin:0px 0px 1em;padding:5px;border:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-weight:400;font-stretch:inherit;font-size:13px;line-height:inherit;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;vertical-align:baseline;box-sizing:inherit;width:auto;max-height:600px;overflow:auto;background-color:rgb(239,240,241);display:block;color:rgb(57,51,24);word-wrap:normal;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><code style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:13px;line-height:inherit;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;vertical-align:baseline;box-sizing:inherit;background-color:rgb(239,240,241);white-space:inherit"><span class="gmail-com" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(133,140,147)">#include</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> </span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(125,39,39)"><llvm/IR/Module.h></span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">
</span><span class="gmail-com" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(133,140,147)">#include</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> </span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(125,39,39)"><llvm/IRReader/IRReader.h></span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">
</span><span class="gmail-com" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(133,140,147)">#include</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> </span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(125,39,39)"><llvm/IR/LLVMContext.h></span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">
</span><span class="gmail-com" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(133,140,147)">#include</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> </span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(125,39,39)"><llvm/Support/SourceMgr.h></span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(16,16,148)">using</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(16,16,148)">namespace</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> llvm</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">
</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(43,145,175)">int</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> main</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">()</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">
</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">{</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">
</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(43,145,175)">LLVMContext</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> context</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">
</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(43,145,175)">SMDiagnostic</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> error</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">
</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(43,145,175)">Module</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">*</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">m </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> parseIRFile</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(125,39,39)">"hello.bc"</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> error</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> context</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">).</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">get</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">();</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(16,16,148)">if</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">m</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">
</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">{</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">
m</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">-></span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">dump</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">();</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">
</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">}</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(16,16,148)">return</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> </span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(125,39,39)">0</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">
</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">}</span></code></pre><p style="margin:0px 0px 1em;padding:0px;border:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-weight:400;font-stretch:inherit;font-size:15px;line-height:inherit;font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;vertical-align:baseline;box-sizing:inherit;clear:both;color:rgb(36,39,41);letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><strong style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:bold;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">$ clang++ -S -O3 -emit-llvm hello.cpp -c -o hello.bc</strong></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-weight:400;font-stretch:inherit;font-size:15px;line-height:inherit;font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;vertical-align:baseline;box-sizing:inherit;clear:both;color:rgb(36,39,41);letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><strong style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:bold;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">$ clang++ -g -O3 dump.cpp<span> `</span><code style="margin:0px;padding:1px 5px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:13px;line-height:inherit;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;vertical-align:baseline;box-sizing:inherit;background-color:rgb(239,240,241);white-space:pre-wrap">llvm-config --cxxflags --ldflags --system-libs --libs all`</code>-o dump</strong></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-weight:400;font-stretch:inherit;font-size:15px;line-height:inherit;font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;vertical-align:baseline;box-sizing:inherit;clear:both;color:rgb(36,39,41);letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><strong style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:bold;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">$ ./dump</strong></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-weight:400;font-stretch:inherit;font-size:15px;line-height:inherit;font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;vertical-align:baseline;box-sizing:inherit;clear:both;color:rgb(36,39,41);letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">But I am getting a segmentation fault as given below. What may be causing this? I am on llvm-6.0 rc2.</p><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px">* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT<br></span></font><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px"> * frame #0: 0x00007fff71902e3e libsystem_kernel.dylib`__pthread_kill + 10<br></span></font><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px"> frame #1: 0x00007fff71a41150 libsystem_pthread.dylib`pthread_kill + 333<br></span></font><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px"> frame #2: 0x00007fff7185f312 libsystem_c.dylib`abort + 127<br></span></font><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px"> frame #3: 0x00007fff71827368 libsystem_c.dylib`__assert_rtn + 320<br></span></font><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px"> frame #4: 0x0000000100477eb9 dump`llvm::isa_impl_cl<llvm::PointerType, llvm::Type const*>::doit(Val=0x0000000000000000) at Casting.h:106<br></span></font><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px"> frame #5: 0x0000000100477e28 dump`llvm::isa_impl_wrap<llvm::PointerType, llvm::Type const*, llvm::Type const*>::doit(Val=0x00007ffeefbfee20) at Casting.h:133<br></span></font><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px"> frame #6: 0x0000000100477e02 dump`llvm::isa_impl_wrap<llvm::PointerType, llvm::Type* const, llvm::Type const*>::doit(Val=0x00007ffeefbfee68) at Casting.h:123<br></span></font><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px"> frame #7: 0x0000000100477db5 dump`bool llvm::isa<llvm::PointerType, llvm::Type*>(Val=0x00007ffeefbfee68) at Casting.h:143<br></span></font><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px"> frame #8: 0x0000000100477d18 dump`llvm::cast_retty<llvm::PointerType, llvm::Type*>::ret_type llvm::cast<llvm::PointerType, llvm::Type>(Val=0x0000000000000000) at Casting.h:255<br></span></font><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px"> frame #9: 0x000000010047227d dump`llvm::GlobalValue::getType(this=0x00000001013ffff6) const at GlobalValue.h:265<br></span></font><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px"> frame #10: 0x00000001004bad34 dump`llvm::TypeFinder::run(this=0x00007ffeefbff530, M=0x0000000101401e80, onlyNamed=false) at TypeFinder.cpp:38<br></span></font><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px"> frame #11: 0x00000001001a97c9 dump`(anonymous namespace)::TypePrinting::incorporateTypes(this=0x00007ffeefbff530, M=0x0000000101401e80) at AsmWriter.cpp:491<br></span></font><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px"> frame #12: 0x00000001001a964f dump`(anonymous namespace)::AssemblyWriter::AssemblyWriter(this=0x00007ffeefbff510, o=0x00007ffeefbff3f8, Mac=0x00007ffeefbff438, M=0x0000000101401e80, AAW=0x0000000000000000, IsForDebug=true, ShouldPreserveUseListOrder=false) at AsmWriter.cpp:2210<br></span></font><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px"> frame #13: 0x000000010019ce22 dump`(anonymous namespace)::AssemblyWriter::AssemblyWriter(this=0x00007ffeefbff510, o=0x00007ffeefbff3f8, Mac=0x00007ffeefbff438, M=0x0000000101401e80, AAW=0x0000000000000000, IsForDebug=true, ShouldPreserveUseListOrder=false) at AsmWriter.cpp:2207<br></span></font><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px"> frame #14: 0x000000010019e3e3 dump`llvm::Module::print(this=0x0000000101401e80, ROS=0x00000001007d1a70, AAW=0x0000000000000000, ShouldPreserveUseListOrder=false, IsForDebug=true) const at AsmWriter.cpp:3415<br></span></font><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px"> frame #15: 0x00000001001a77e1 dump`llvm::Module::dump(this=0x0000000101401e80) const at AsmWriter.cpp:3650<br></span></font><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px"> frame #16: 0x000000010000250e dump`main at dump.cpp:17 [opt]<br></span></font><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px"> frame #17: 0x00007fff717b3115 libdyld.dylib`start + 1</span></font></blockquote><p style="margin:0px 0px 1em;padding:0px;border:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-weight:400;font-stretch:inherit;font-size:15px;line-height:inherit;font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;vertical-align:baseline;box-sizing:inherit;clear:both;color:rgb(36,39,41);letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-weight:400;font-stretch:inherit;font-size:15px;line-height:inherit;font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;vertical-align:baseline;box-sizing:inherit;clear:both;color:rgb(36,39,41);letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Thanks</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-weight:400;font-stretch:inherit;font-size:15px;line-height:inherit;font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;vertical-align:baseline;box-sizing:inherit;clear:both;color:rgb(36,39,41);letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Buddhika</p></div>