From: Duncan P. N. Exon Smith Date: Tue, 14 Apr 2015 16:19:44 +0000 (+0000) Subject: DebugInfo: Add implicit conversion from DISubprogram to DIScope X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=66192e4b082f024d2141af3266bf35ffb72537bc;p=oota-llvm.git 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...) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234904 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/examples/Kaleidoscope/Chapter8/toy.cpp b/examples/Kaleidoscope/Chapter8/toy.cpp index 8dfec4b2eba..2838d6df593 100644 --- a/examples/Kaleidoscope/Chapter8/toy.cpp +++ b/examples/Kaleidoscope/Chapter8/toy.cpp @@ -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; } diff --git a/include/llvm/IR/DebugInfo.h b/include/llvm/IR/DebugInfo.h index 56033dfead0..46ebcb4b8df 100644 --- a/include/llvm/IR/DebugInfo.h +++ b/include/llvm/IR/DebugInfo.h @@ -437,6 +437,7 @@ public: : N(const_cast(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; }