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/lib/ObjectYAML/CodeViewYAMLTypes.cpp b/llvm/lib/ObjectYAML/CodeViewYAMLTypes.cpp --- a/llvm/lib/ObjectYAML/CodeViewYAMLTypes.cpp +++ b/llvm/lib/ObjectYAML/CodeViewYAMLTypes.cpp @@ -146,6 +146,8 @@ } StringRef ScalarTraits::input(StringRef Scalar, void *Ctx, GUID &S) { + static const uint8_t Order[16] = {3, 2, 1, 0, 5, 4, 7, 6, + 8, 9, 10, 11, 12, 13, 14, 15}; if (Scalar.size() != 38) return "GUID strings are 38 characters long"; if (Scalar[0] != '{' || Scalar[37] != '}') @@ -154,7 +156,7 @@ Scalar[24] != '-') return "GUID sections are not properly delineated with dashes"; - uint8_t *OutBuffer = S.Guid; + uint8_t I = 0; for (auto Iter = Scalar.begin(); Iter != Scalar.end();) { if (*Iter == '-' || *Iter == '{' || *Iter == '}') { ++Iter; @@ -162,7 +164,7 @@ } uint8_t Value = (llvm::hexDigitValue(*Iter++) << 4); Value |= llvm::hexDigitValue(*Iter++); - *OutBuffer++ = Value; + S.Guid[Order[I++]] = Value; } return ""; diff --git a/llvm/test/DebugInfo/PDB/DIA/pdbdump-flags.test b/llvm/test/DebugInfo/PDB/DIA/pdbdump-flags.test --- a/llvm/test/DebugInfo/PDB/DIA/pdbdump-flags.test +++ b/llvm/test/DebugInfo/PDB/DIA/pdbdump-flags.test @@ -5,7 +5,7 @@ ; Check that neither symbols nor compilands are dumped when neither argument specified. ; NO_ARGS: empty.pdb -; NO_ARGS: Guid: {0B355641-86A0-A249-896F-9988FAE52FF0} +; NO_ARGS: Guid: {4156350B-A086-49A2-896F-9988FAE52FF0} ; NO_ARGS: Attributes: HasPrivateSymbols ; NO_ARGS-NOT: ---TYPES--- ; NO_ARGS-NOT: ---COMPILANDS--- @@ -14,7 +14,7 @@ ; Check that only types are dumped when only -types is specified. ; TYPES: empty.pdb -; TYPES: Guid: {0B355641-86A0-A249-896F-9988FAE52FF0} +; TYPES: Guid: {4156350B-A086-49A2-896F-9988FAE52FF0} ; TYPES: Attributes: HasPrivateSymbols ; TYPES: ---TYPES--- ; TYPES-NOT: ---COMPILANDS--- @@ -23,7 +23,7 @@ ; Check that only compilands are dumped when only -compilands is specified. ; COMPILANDS: empty.pdb -; COMPILANDS: Guid: {0B355641-86A0-A249-896F-9988FAE52FF0} +; COMPILANDS: Guid: {4156350B-A086-49A2-896F-9988FAE52FF0} ; COMPILANDS: Attributes: HasPrivateSymbols ; COMPILANDS: ---COMPILANDS--- ; COMPILANDS-NOT: ---TYPES--- @@ -32,7 +32,7 @@ ; Check that types and compilands are dumped when both arguments are specified. ; MULTIPLE: empty.pdb -; MULTIPLE: Guid: {0B355641-86A0-A249-896F-9988FAE52FF0} +; MULTIPLE: Guid: {4156350B-A086-49A2-896F-9988FAE52FF0} ; MULTIPLE: Attributes: HasPrivateSymbols ; MULTIPLE: ---COMPILANDS--- ; MULTIPLE: ---TYPES--- diff --git a/llvm/test/DebugInfo/PDB/Native/pdb-native-summary.test b/llvm/test/DebugInfo/PDB/Native/pdb-native-summary.test --- a/llvm/test/DebugInfo/PDB/Native/pdb-native-summary.test +++ b/llvm/test/DebugInfo/PDB/Native/pdb-native-summary.test @@ -6,6 +6,6 @@ ; `-native` option produces identical output. ; EMPTY: Size: 102400 bytes -; EMPTY: Guid: {0B355641-86A0-A249-896F-9988FAE52FF0} +; EMPTY: Guid: {4156350B-A086-49A2-896F-9988FAE52FF0} ; EMPTY: Age: 1 ; EMPTY: Attributes: HasPrivateSymbols diff --git a/llvm/test/DebugInfo/PDB/pdbdump-headers.test b/llvm/test/DebugInfo/PDB/pdbdump-headers.test --- a/llvm/test/DebugInfo/PDB/pdbdump-headers.test +++ b/llvm/test/DebugInfo/PDB/pdbdump-headers.test @@ -12,7 +12,7 @@ ALL-NEXT: Number of streams: 17 ALL-NEXT: Signature: 1424295906 ALL-NEXT: Age: 1 -ALL-NEXT: GUID: {0B355641-86A0-A249-896F-9988FAE52FF0} +ALL-NEXT: GUID: {4156350B-A086-49A2-896F-9988FAE52FF0} ALL-NEXT: Features: 0x1 ALL-NEXT: Has Debug Info: true ALL-NEXT: Has Types: true @@ -601,7 +601,7 @@ BIG-NEXT: Number of streams: 64 BIG-NEXT: Signature: 1461714535 BIG-NEXT: Age: 1 -BIG-NEXT: GUID: {880ECC89-DF81-0B4F-839C-58CBD052E937} +BIG-NEXT: GUID: {89CC0E88-81DF-4F0B-839C-58CBD052E937} BIG-NEXT: Features: 0x1 BIG-NEXT: Has Debug Info: true BIG-NEXT: Has Types: true diff --git a/llvm/test/DebugInfo/PDB/pdbdump-readwrite.test b/llvm/test/DebugInfo/PDB/pdbdump-readwrite.test --- a/llvm/test/DebugInfo/PDB/pdbdump-readwrite.test +++ b/llvm/test/DebugInfo/PDB/pdbdump-readwrite.test @@ -14,7 +14,7 @@ CHECK-NEXT: Number of streams: CHECK-NEXT: Signature: 1424295906 CHECK-NEXT: Age: 1 -CHECK-NEXT: GUID: {0B355641-86A0-A249-896F-9988FAE52FF0} +CHECK-NEXT: GUID: {4156350B-A086-49A2-896F-9988FAE52FF0} CHECK-NEXT: Features: 0x1 CHECK-NEXT: Has Debug Info: true CHECK-NEXT: Has Types: true diff --git a/llvm/test/DebugInfo/PDB/pdbdump-yaml.test b/llvm/test/DebugInfo/PDB/pdbdump-yaml.test --- a/llvm/test/DebugInfo/PDB/pdbdump-yaml.test +++ b/llvm/test/DebugInfo/PDB/pdbdump-yaml.test @@ -42,7 +42,7 @@ ; YAML-NEXT: - '$T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = ' ; YAML-NEXT: PdbStream: ; YAML-NEXT: Age: 1 -; YAML-NEXT: Guid: '{0B355641-86A0-A249-896F-9988FAE52FF0}' +; YAML-NEXT: Guid: '{4156350B-A086-49A2-896F-9988FAE52FF0}' ; YAML-NEXT: Signature: 1424295906 ; YAML-NEXT: Features: [ VC110 ] ; YAML-NEXT: Version: VC70 diff --git a/llvm/test/ObjectYAML/CodeView/sections.yaml b/llvm/test/ObjectYAML/CodeView/sections.yaml --- a/llvm/test/ObjectYAML/CodeView/sections.yaml +++ b/llvm/test/ObjectYAML/CodeView/sections.yaml @@ -13,7 +13,7 @@ Types: - Kind: LF_TYPESERVER2 TypeServer2: - Guid: '{01DF191B-22BF-6B42-96CE-5258B8329FE5}' + Guid: '{1B19DF01-BF22-426B-96CE-5258B8329FE5}' Age: 24 Name: 'C:\src\llvm-project\build\vc140.pdb' - Name: '.debug$H' @@ -66,7 +66,7 @@ # CHECK: Types: # CHECK: - Kind: LF_TYPESERVER2 # CHECK: TypeServer2: -# CHECK: Guid: '{01DF191B-22BF-6B42-96CE-5258B8329FE5}' +# CHECK: Guid: '{1B19DF01-BF22-426B-96CE-5258B8329FE5}' # CHECK: Age: 24 # CHECK: Name: 'C:\src\llvm-project\build\vc140.pdb' # CHECK: - Name: '.debug$H' 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