<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 14, 2015 at 5:19 PM, Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Author: dexonsmith<br>
Date: Tue Apr 14 11:19:44 2015<br>
New Revision: 234904<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=234904&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=234904&view=rev</a><br>
Log:<br>
DebugInfo: Add implicit conversion from DISubprogram to DIScope<br>
<br>
As a follow-up to r234850, add an implicit conversion from<br>
`DISubprogram` to `DIScope` to support Kaleidoscope Ch. 8.  This also<br>
reverts that band-aid from r234890.<br>
<br>
(/me learns *again* to build Kaleidoscope before commit...)<br></blockquote><div><br></div><div>There is also <a href="http://llvm.org/docs/tutorial/LangImpl8.html">http://llvm.org/docs/tutorial/LangImpl8.html</a> (llvm/docs/tutorial/LangImpl8.rst)</div><div><br></div><div>-- Sean Silva</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Modified:<br>
    llvm/trunk/examples/Kaleidoscope/Chapter8/toy.cpp<br>
    llvm/trunk/include/llvm/IR/DebugInfo.h<br>
<br>
Modified: llvm/trunk/examples/Kaleidoscope/Chapter8/toy.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/Chapter8/toy.cpp?rev=234904&r1=234903&r2=234904&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/Chapter8/toy.cpp?rev=234904&r1=234903&r2=234904&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/examples/Kaleidoscope/Chapter8/toy.cpp (original)<br>
+++ llvm/trunk/examples/Kaleidoscope/Chapter8/toy.cpp Tue Apr 14 11:19:44 2015<br>
@@ -1234,7 +1234,7 @@ Function *PrototypeAST::Codegen() {<br>
       CreateFunctionType(Args.size(), Unit), false /* internal linkage */,<br>
       true /* definition */, ScopeLine, DIDescriptor::FlagPrototyped, false, F);<br>
<br>
-  KSDbgInfo.FnScopeMap[this] = (DIScope)SP;<br>
+  KSDbgInfo.FnScopeMap[this] = SP;<br>
   return F;<br>
 }<br>
<br>
<br>
Modified: llvm/trunk/include/llvm/IR/DebugInfo.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugInfo.h?rev=234904&r1=234903&r2=234904&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugInfo.h?rev=234904&r1=234903&r2=234904&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/IR/DebugInfo.h (original)<br>
+++ llvm/trunk/include/llvm/IR/DebugInfo.h Tue Apr 14 11:19:44 2015<br>
@@ -437,6 +437,7 @@ public:<br>
       : N(const_cast<MDSubprogram *>(N)) {}<br>
<br>
   operator DIDescriptor() const { return N; }<br>
+  operator DIScope() const { return N; }<br>
   operator MDSubprogram *() const { return N; }<br>
   MDSubprogram *operator->() const { return N; }<br>
   MDSubprogram &operator*() const { return *N; }<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>