File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -903,18 +903,18 @@ void CodeViewDebug::emitCompilerInformation() {
903903 OS.AddComment (" CPUType" );
904904 OS.emitInt16 (static_cast <uint64_t >(TheCPU));
905905
906+ StringRef CompilerVersion = " 0" ;
906907 auto CUs = MMI->getModule ()->debug_compile_units ();
907- if (CUs.empty ())
908- return ;
909-
910- const MDNode *Node = *CUs.begin ();
911- const auto *CU = cast<DICompileUnit>(Node);
908+ if (!CUs.empty ()) {
909+ const MDNode *Node = *CUs.begin ();
910+ const auto *CU = cast<DICompileUnit>(Node);
912911
913- StringRef CompilerVersion = CU->getProducer ();
914- Version FrontVer = parseVersion (CompilerVersion);
915- OS.AddComment (" Frontend version" );
916- for (int N : FrontVer.Part ) {
917- OS.emitInt16 (N);
912+ CompilerVersion = CU->getProducer ();
913+ Version FrontVer = parseVersion (CompilerVersion);
914+ OS.AddComment (" Frontend version" );
915+ for (int N : FrontVer.Part ) {
916+ OS.emitInt16 (N);
917+ }
918918 }
919919
920920 // Some Microsoft tools, like Binscope, expect a backend version number of at
Original file line number Diff line number Diff line change 1919; CHECK-NEXT: .short 4412 # Record kind: S_COMPILE3
2020; CHECK-NEXT: .long 3 # Flags and language
2121; CHECK-NEXT: .short 208 # CPUType
22+ ; CHECK-NEXT: .short 22000 # Backend version
23+ ; CHECK-NEXT: .short 0
24+ ; CHECK-NEXT: .short 0
25+ ; CHECK-NEXT: .short 0
26+ ; CHECK-NEXT: .asciz "0" # Null-terminated compiler version string
27+ ; CHECK-NEXT: .p2align 2, 0x0
28+ ; CHECK-NEXT: .Ltmp5:
2229; CHECK-NEXT: .Ltmp1:
2330; CHECK-NEXT: .p2align 2, 0x0
2431; CHECK-NEXT: .cv_filechecksums # File index to string table offset subsection
You can’t perform that action at this time.
0 commit comments