[llvm] r234904 - DebugInfo: Add implicit conversion from DISubprogram to DIScope
Duncan P. N. Exon Smith
dexonsmith at apple.com
Tue Apr 14 09:19:44 PDT 2015
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...)
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; }
More information about the llvm-commits
mailing list