diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -790,8 +790,8 @@ StringRef CompilerVersion = CU->getProducer(); Version FrontVer = parseVersion(CompilerVersion); OS.AddComment("Frontend version"); - for (int N = 0; N < 4; ++N) - OS.emitInt16(FrontVer.Part[N]); + for (int Part : FrontVer.Part) + OS.emitInt32(Part); // Some Microsoft tools, like Binscope, expect a backend version number of at // least 8.something, so we'll coerce the LLVM version into a form that @@ -803,8 +803,8 @@ Major = std::min(Major, std::numeric_limits::max()); Version BackVer = {{ Major, 0, 0, 0 }}; OS.AddComment("Backend version"); - for (int N = 0; N < 4; ++N) - OS.emitInt16(BackVer.Part[N]); + for (int Part : BackVer.Part) + OS.emitInt32(Part); OS.AddComment("Null-terminated compiler version string"); emitNullTerminatedSymbolName(OS, CompilerVersion);