mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-16 11:24:39 +00:00
DIBuilder: Don't rauw null pointers with empty arrays in finalize().
This makes the IR a little easier to read. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241470 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -90,10 +90,14 @@ void DIBuilder::finalize() {
|
|||||||
for (unsigned I = 0, E = AllRetainTypes.size(); I < E; I++)
|
for (unsigned I = 0, E = AllRetainTypes.size(); I < E; I++)
|
||||||
if (RetainSet.insert(AllRetainTypes[I]).second)
|
if (RetainSet.insert(AllRetainTypes[I]).second)
|
||||||
RetainValues.push_back(AllRetainTypes[I]);
|
RetainValues.push_back(AllRetainTypes[I]);
|
||||||
CUNode->replaceRetainedTypes(MDTuple::get(VMContext, RetainValues));
|
|
||||||
|
if (!RetainValues.empty())
|
||||||
|
CUNode->replaceRetainedTypes(MDTuple::get(VMContext, RetainValues));
|
||||||
|
|
||||||
DISubprogramArray SPs = MDTuple::get(VMContext, AllSubprograms);
|
DISubprogramArray SPs = MDTuple::get(VMContext, AllSubprograms);
|
||||||
CUNode->replaceSubprograms(SPs.get());
|
if (!AllSubprograms.empty())
|
||||||
|
CUNode->replaceSubprograms(SPs.get());
|
||||||
|
|
||||||
for (auto *SP : SPs) {
|
for (auto *SP : SPs) {
|
||||||
if (MDTuple *Temp = SP->getVariables().get()) {
|
if (MDTuple *Temp = SP->getVariables().get()) {
|
||||||
const auto &PV = PreservedVariables.lookup(SP);
|
const auto &PV = PreservedVariables.lookup(SP);
|
||||||
@@ -103,11 +107,13 @@ void DIBuilder::finalize() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CUNode->replaceGlobalVariables(MDTuple::get(VMContext, AllGVs));
|
if (!AllGVs.empty())
|
||||||
|
CUNode->replaceGlobalVariables(MDTuple::get(VMContext, AllGVs));
|
||||||
|
|
||||||
CUNode->replaceImportedEntities(MDTuple::get(
|
if (!AllImportedModules.empty())
|
||||||
VMContext, SmallVector<Metadata *, 16>(AllImportedModules.begin(),
|
CUNode->replaceImportedEntities(MDTuple::get(
|
||||||
AllImportedModules.end())));
|
VMContext, SmallVector<Metadata *, 16>(AllImportedModules.begin(),
|
||||||
|
AllImportedModules.end())));
|
||||||
|
|
||||||
// Now that all temp nodes have been replaced or deleted, resolve remaining
|
// Now that all temp nodes have been replaced or deleted, resolve remaining
|
||||||
// cycles.
|
// cycles.
|
||||||
|
Reference in New Issue
Block a user