ArchSpec: fix unintentional promotion of unspecified unknowns to specified unknowns
* ArchSpec::MergeFrom() would erroneously promote an unspecified unknown to a specified unknown when both the ArchSpec and the merged in ArchSpec were both unspecified unknowns. This no longer happens, which fixes issues with global module cache lookup in some situations. * Added ArchSpec::DumpTriple(Stream&) that now properly prints unspecified unknowns as '*' and specified unknows as 'unknown'. This makes it trivial to tell the difference between the two. Converted printing code over ot using DumpTriple() rather than building from scratch. * Fixed up a couple places that were not guaranteeing that an unspecified unknown was recorded as such. llvm-svn: 250253
This commit is contained in:
@@ -1605,6 +1605,12 @@ ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl §ion_headers,
|
||||
}
|
||||
}
|
||||
|
||||
// Make any unknown triple components to be unspecified unknowns.
|
||||
if (arch_spec.GetTriple().getVendor() == llvm::Triple::UnknownVendor)
|
||||
arch_spec.GetTriple().setVendorName (llvm::StringRef());
|
||||
if (arch_spec.GetTriple().getOS() == llvm::Triple::UnknownOS)
|
||||
arch_spec.GetTriple().setOSName (llvm::StringRef());
|
||||
|
||||
return section_headers.size();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user