LexicalScopes: Use debug info hierarchy pervasively
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 30 Mar 2015 23:21:21 +0000 (23:21 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 30 Mar 2015 23:21:21 +0000 (23:21 +0000)
commit62e3e389b9e72a0d43f4166ba9b7cc88b58b49f5
tree85c02a9cf5c28cc2325d0a60168023dca5cbe124
parent23ff386e07474da75a50e58177db93a74798914a
LexicalScopes: Use debug info hierarchy pervasively

Pervasively use the types provided by the debug info hierarchy rather
than `MDNode` in `LexicalScopes`.

I noticed (again, I guess, based on comments in the implementation?)
that `DILexicalBlockFile::getScope()` returns something different from
`DILexicalBlockFile::getContext()`.  I created a local helper for
getting the same logic from `MDLexicalBlockFile` called
`getScopeOfScope()`.  I still don't really understand it, but I've added
some FIXMEs and I'll come back to it (I suspect the way we encode these
objects isn't really ideal).

Note that my previous commit r233610 accidentally changed behaviour in
`findLexicalScope()` -- it transitioned from a call to
`DILexicalBlockFile::getScope()` to `MDLexicalBlockFile::getScope()`
(sounds right, doesn't it?) -- so I've fixed that as a drive-by.  No
tests failed with my error, so it looks like we're missing some coverage
here... when I come back to understand the logic, I'll see if I can add
some.

Other than the fix to `findLexicalScope()`, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233640 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/LexicalScopes.h
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/LexicalScopes.cpp