[llvm] r234904 - DebugInfo: Add implicit conversion from DISubprogram to DIScope

Duncan P. N. Exon Smith dexonsmith at apple.com
Fri Apr 17 17:05:30 PDT 2015


> On 2015 Apr 16, at 06:13, Sean Silva <chisophugis at gmail.com> wrote:
> 
> 
> 
> On Tue, Apr 14, 2015 at 5:19 PM, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
> Author: dexonsmith
> Date: Tue Apr 14 11:19:44 2015
> New Revision: 234904
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=234904&view=rev
> Log:
> DebugInfo: Add implicit conversion from DISubprogram to DIScope
> 
> As a follow-up to r234850, add an implicit conversion from
> `DISubprogram` to `DIScope` to support Kaleidoscope Ch. 8.  This also
> reverts that band-aid from r234890.
> 
> (/me learns *again* to build Kaleidoscope before commit...)
> 
> There is also http://llvm.org/docs/tutorial/LangImpl8.html (llvm/docs/tutorial/LangImpl8.rst)

Right!  r235244.

> 
> -- Sean Silva
> 
>  
> 
> Modified:
>     llvm/trunk/examples/Kaleidoscope/Chapter8/toy.cpp
>     llvm/trunk/include/llvm/IR/DebugInfo.h
> 
> Modified: llvm/trunk/examples/Kaleidoscope/Chapter8/toy.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/Chapter8/toy.cpp?rev=234904&r1=234903&r2=234904&view=diff
> ==============================================================================
> --- llvm/trunk/examples/Kaleidoscope/Chapter8/toy.cpp (original)
> +++ llvm/trunk/examples/Kaleidoscope/Chapter8/toy.cpp Tue Apr 14 11:19:44 2015
> @@ -1234,7 +1234,7 @@ Function *PrototypeAST::Codegen() {
>        CreateFunctionType(Args.size(), Unit), false /* internal linkage */,
>        true /* definition */, ScopeLine, DIDescriptor::FlagPrototyped, false, F);
> 
> -  KSDbgInfo.FnScopeMap[this] = (DIScope)SP;
> +  KSDbgInfo.FnScopeMap[this] = SP;
>    return F;
>  }
> 
> 
> Modified: llvm/trunk/include/llvm/IR/DebugInfo.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugInfo.h?rev=234904&r1=234903&r2=234904&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/IR/DebugInfo.h (original)
> +++ llvm/trunk/include/llvm/IR/DebugInfo.h Tue Apr 14 11:19:44 2015
> @@ -437,6 +437,7 @@ public:
>        : N(const_cast<MDSubprogram *>(N)) {}
> 
>    operator DIDescriptor() const { return N; }
> +  operator DIScope() const { return N; }
>    operator MDSubprogram *() const { return N; }
>    MDSubprogram *operator->() const { return N; }
>    MDSubprogram &operator*() const { return *N; }
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 





More information about the llvm-commits mailing list