diff --git a/llvm/lib/DebugInfo/CodeView/Formatters.cpp b/llvm/lib/DebugInfo/CodeView/Formatters.cpp --- a/llvm/lib/DebugInfo/CodeView/Formatters.cpp +++ b/llvm/lib/DebugInfo/CodeView/Formatters.cpp @@ -25,11 +25,13 @@ void GuidAdapter::format(raw_ostream &Stream, StringRef Style) { static const char *Lookup = "0123456789ABCDEF"; + static const uint8_t Order[16] = {3, 2, 1, 0, 5, 4, 7, 6, + 8, 9, 10, 11, 12, 13, 14, 15}; assert(Item.size() == 16 && "Expected 16-byte GUID"); Stream << "{"; for (int i = 0; i < 16;) { - uint8_t Byte = Item[i]; + uint8_t Byte = Item[Order[i]]; uint8_t HighNibble = (Byte >> 4) & 0xF; uint8_t LowNibble = Byte & 0xF; Stream << Lookup[HighNibble] << Lookup[LowNibble]; diff --git a/llvm/test/tools/llvm-pdbutil/explain-pdb-stream.test b/llvm/test/tools/llvm-pdbutil/explain-pdb-stream.test --- a/llvm/test/tools/llvm-pdbutil/explain-pdb-stream.test +++ b/llvm/test/tools/llvm-pdbutil/explain-pdb-stream.test @@ -39,7 +39,7 @@ CHECK-NEXT: Within the PDB stream: CHECK-NEXT: address is at offset 12/28 of the PDB Stream Header. CHECK-NEXT: which contains the guid of the PDB. -CHECK-NEXT: The current value is {826BE46E-02ED-7043-9C27-20CCC07E92A7}. +CHECK-NEXT: The current value is {6EE46B82-ED02-4370-9C27-20CCC07E92A7}. CHECK: Block:Offset = 11:001C. CHECK-NEXT: Address is in block 17 (allocated). diff --git a/llvm/test/tools/llvm-pdbutil/stripped.test b/llvm/test/tools/llvm-pdbutil/stripped.test --- a/llvm/test/tools/llvm-pdbutil/stripped.test +++ b/llvm/test/tools/llvm-pdbutil/stripped.test @@ -8,7 +8,7 @@ ; CHECK-NEXT: Number of streams: 12 ; CHECK-NEXT: Signature: 1541179274 ; CHECK-NEXT: Age: 2 -; CHECK-NEXT: GUID: {FF4F9B62-D99A-4647-97A7-22C702B1E053} +; CHECK-NEXT: GUID: {629B4FFF-9AD9-4746-97A7-22C702B1E053} ; CHECK-NEXT: Features: 0x1 ; CHECK-NEXT: Has Debug Info: true ; CHECK-NEXT: Has Types: true