mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 19:25:00 +00:00
DebugInfo: Reimplement DIRef<>::resolve() using TypedDebugNodeRef<>
Gut `DIRef<>::resolve()`, reimplementing it using `TypedDebugNodeRef<>::resolve()`. Use three separate functions rather than some sort of type traits, since the latter (i.e., mapping `DIScope` => `MDScope`) seems heavy-handed. I don't expect `DIRef<>` to last much longer in tree anyway. As a drive-by fix, make `TypedDebugNodeRef<>::resolve()` do the right thing with `nullptr`. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234248 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -685,6 +685,20 @@ template <> DITypeRef DIDescriptor::getFieldAs<DITypeRef>(unsigned Elt) const {
|
||||
return DITypeRef(cast_or_null<Metadata>(getField(DbgNode, Elt)));
|
||||
}
|
||||
|
||||
template <>
|
||||
DIDescriptor
|
||||
DIRef<DIDescriptor>::resolve(const DITypeIdentifierMap &Map) const {
|
||||
return DIDescriptor(DebugNodeRef(Val).resolve(Map));
|
||||
}
|
||||
template <>
|
||||
DIScope DIRef<DIScope>::resolve(const DITypeIdentifierMap &Map) const {
|
||||
return MDScopeRef(Val).resolve(Map);
|
||||
}
|
||||
template <>
|
||||
DIType DIRef<DIType>::resolve(const DITypeIdentifierMap &Map) const {
|
||||
return MDTypeRef(Val).resolve(Map);
|
||||
}
|
||||
|
||||
bool llvm::stripDebugInfo(Function &F) {
|
||||
bool Changed = false;
|
||||
for (BasicBlock &BB : F) {
|
||||
|
Reference in New Issue
Block a user