Merge pull request #1041 from asuessenbach/check

move checks on StructureAliases before checks on Structures.
This commit is contained in:
Andreas Süßenbach 2021-08-04 17:18:59 +02:00 committed by GitHub
commit b00d8e8a23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1368,6 +1368,17 @@ void VulkanHppGenerator::checkHandleCorrectness() const
void VulkanHppGenerator::checkStructCorrectness() void VulkanHppGenerator::checkStructCorrectness()
{ {
for ( auto const & structAlias : m_structureAliases )
{
auto structIt = m_structures.find( structAlias.second.alias );
check( structIt != m_structures.end(),
structAlias.second.xmlLine,
"unknown struct alias <" + structAlias.second.alias + ">" );
check( structIt->second.aliases.insert( structAlias.first ).second,
structIt->second.xmlLine,
"struct <" + structIt->first + "> already uses alias <" + structAlias.first + ">" );
}
std::set<std::string> sTypeValues; std::set<std::string> sTypeValues;
for ( auto const & structure : m_structures ) for ( auto const & structure : m_structures )
{ {
@ -1416,15 +1427,6 @@ void VulkanHppGenerator::checkStructCorrectness()
} }
} }
assert( sTypeValues.empty() ); assert( sTypeValues.empty() );
for ( auto const & structAlias : m_structureAliases )
{
auto structIt = m_structures.find( structAlias.second.alias );
check( structIt != m_structures.end(), structAlias.second.xmlLine, "unknown struct alias <" + structAlias.second.alias + ">" );
check( structIt->second.aliases.insert( structAlias.first ).second,
structIt->second.xmlLine,
"struct <" + structIt->first + "> already uses alias <" + structAlias.first + ">" );
}
} }
void VulkanHppGenerator::checkStructMemberCorrectness( std::string const & structureName, void VulkanHppGenerator::checkStructMemberCorrectness( std::string const & structureName,
@ -17045,7 +17047,7 @@ extern "C" __declspec( dllimport ) FARPROC __stdcall GetProcAddress( HINSTANCE h
std::cout << "VulkanHppGenerator: Parsing " << filename << std::endl; std::cout << "VulkanHppGenerator: Parsing " << filename << std::endl;
VulkanHppGenerator generator( doc ); VulkanHppGenerator generator( doc );
std::cout << "VulkanHppGenerator: Generating" << VULKAN_ENUMS_HPP_FILE << " ..." << std::endl; std::cout << "VulkanHppGenerator: Generating " << VULKAN_ENUMS_HPP_FILE << " ..." << std::endl;
std::string str; std::string str;
str = generator.getVulkanLicenseHeader(); str = generator.getVulkanLicenseHeader();
str += +R"( str += +R"(