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
This commit is contained in:
Duncan P. N. Exon Smith 2015-04-14 16:19:44 +00:00
parent 091be7b530
commit 66192e4b08
2 changed files with 2 additions and 1 deletions

View File

@ -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;
}

View File

@ -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; }