[midend-LATG]将调试信息改为DEBUG生效

This commit is contained in:
rain2133
2025-08-10 17:32:45 +08:00
parent ad19a6715f
commit 4d0e2d73ea

View File

@ -52,14 +52,16 @@ bool LargeArrayToGlobalPass::runOnModule(Module *M, AnalysisManager &AM) {
// Calculate the size of the allocated type // Calculate the size of the allocated type
unsigned size = calculateTypeSize(allocatedType); unsigned size = calculateTypeSize(allocatedType);
if(DEBUG){
// Debug: print size information // Debug: print size information
std::cout << "LargeArrayToGlobalPass: Found alloca with size " << size std::cout << "LargeArrayToGlobalPass: Found alloca with size " << size
<< " for type " << typeToString(allocatedType) << std::endl; << " for type " << typeToString(allocatedType) << std::endl;
}
// Convert arrays of 1KB (1024 bytes) or larger to global variables // Convert arrays of 1KB (1024 bytes) or larger to global variables
if (size >= 1024) { if (size >= 1024) {
std::cout << "LargeArrayToGlobalPass: Converting array of size " << size << " to global" << std::endl; if(DEBUG)
std::cout << "LargeArrayToGlobalPass: Converting array of size " << size << " to global" << std::endl;
allocasToConvert.emplace_back(alloca, F); allocasToConvert.emplace_back(alloca, F);
} }
} }