mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-18 10:24:45 +00:00
Switch the type field in DIVariable and DIGlobalVariable over to DITypeRefs.
This allows us to catch more opportunities for ODR-based type uniquing during LTO. Paired commit with CFE which updates some testcases to verify the new DIBuilder behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204106 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -541,10 +541,11 @@ bool DIGlobalVariable::Verify() const {
|
||||
|
||||
if (getDisplayName().empty())
|
||||
return false;
|
||||
// Make sure context @ field 2 and type @ field 8 are MDNodes.
|
||||
// Make sure context @ field 2 is an MDNode.
|
||||
if (!fieldIsMDNode(DbgNode, 2))
|
||||
return false;
|
||||
if (!fieldIsMDNode(DbgNode, 8))
|
||||
// Make sure that type @ field 8 is a DITypeRef.
|
||||
if (!fieldIsTypeRef(DbgNode, 8))
|
||||
return false;
|
||||
// Make sure StaticDataMemberDeclaration @ field 12 is MDNode.
|
||||
if (!fieldIsMDNode(DbgNode, 12))
|
||||
@@ -558,10 +559,11 @@ bool DIVariable::Verify() const {
|
||||
if (!isVariable())
|
||||
return false;
|
||||
|
||||
// Make sure context @ field 1 and type @ field 5 are MDNodes.
|
||||
// Make sure context @ field 1 is an MDNode.
|
||||
if (!fieldIsMDNode(DbgNode, 1))
|
||||
return false;
|
||||
if (!fieldIsMDNode(DbgNode, 5))
|
||||
// Make sure that type @ field 5 is a DITypeRef.
|
||||
if (!fieldIsTypeRef(DbgNode, 5))
|
||||
return false;
|
||||
return DbgNode->getNumOperands() >= 8;
|
||||
}
|
||||
@@ -999,7 +1001,7 @@ void DebugInfoFinder::processModule(const Module &M) {
|
||||
DIGlobalVariable DIG(GVs.getElement(i));
|
||||
if (addGlobalVariable(DIG)) {
|
||||
processScope(DIG.getContext());
|
||||
processType(DIG.getType());
|
||||
processType(DIG.getType().resolve(TypeIdentifierMap));
|
||||
}
|
||||
}
|
||||
DIArray SPs = CU.getSubprograms();
|
||||
@@ -1133,7 +1135,7 @@ void DebugInfoFinder::processDeclare(const Module &M,
|
||||
if (!NodesSeen.insert(DV))
|
||||
return;
|
||||
processScope(DIVariable(N).getContext());
|
||||
processType(DIVariable(N).getType());
|
||||
processType(DIVariable(N).getType().resolve(TypeIdentifierMap));
|
||||
}
|
||||
|
||||
void DebugInfoFinder::processValue(const Module &M, const DbgValueInst *DVI) {
|
||||
@@ -1149,7 +1151,7 @@ void DebugInfoFinder::processValue(const Module &M, const DbgValueInst *DVI) {
|
||||
if (!NodesSeen.insert(DV))
|
||||
return;
|
||||
processScope(DIVariable(N).getContext());
|
||||
processType(DIVariable(N).getType());
|
||||
processType(DIVariable(N).getType().resolve(TypeIdentifierMap));
|
||||
}
|
||||
|
||||
/// addType - Add type into Tys.
|
||||
|
Reference in New Issue
Block a user