1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[CodeView] Mark this pointers as const.

This is for compatibility with MSVC, which also marks this pointers
as being const-qualified.

Fixes llvm.org/pr36526

Differential Revision: https://reviews.llvm.org/D54736

llvm-svn: 347353
This commit is contained in:
Zachary Turner 2018-11-20 22:13:23 +00:00
parent bac1f14341
commit 5b806cdb1d
11 changed files with 80 additions and 49 deletions

View File

@ -1715,6 +1715,9 @@ TypeIndex CodeViewDebug::lowerTypePointer(const DIDerivedType *Ty,
break;
}
if (Ty->isObjectPointer())
PO |= PointerOptions::Const;
PointerRecord PR(PointeeTI, PK, PM, PO, Ty->getSizeInBits() / 8);
return TypeTable.writeLeafType(PR);
}

View File

@ -82,7 +82,7 @@
; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
; CHECK: ReturnType: void (0x3)
; CHECK: ClassType: BClass ({{.*}})
; CHECK: ThisType: BClass* ({{.*}})
; CHECK: ThisType: BClass* const ({{.*}})
; CHECK: CallingConvention: NearC (0x0)
; CHECK: FunctionOptions [ (0x2)
; CHECK: Constructor (0x2)
@ -119,7 +119,7 @@
; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
; CHECK: ReturnType: void (0x3)
; CHECK: ClassType: C1Class ({{.*}})
; CHECK: ThisType: C1Class* ({{.*}})
; CHECK: ThisType: C1Class* const ({{.*}})
; CHECK: CallingConvention: NearC (0x0)
; CHECK: FunctionOptions [ (0x0)
; CHECK: ]
@ -156,7 +156,7 @@
; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
; CHECK: ReturnType: void (0x3)
; CHECK: ClassType: C2Class ({{.*}})
; CHECK: ThisType: C2Class* ({{.*}})
; CHECK: ThisType: C2Class* const ({{.*}})
; CHECK: CallingConvention: NearC (0x0)
; CHECK: FunctionOptions [ (0x0)
; CHECK: ]
@ -257,7 +257,7 @@
; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
; CHECK: ReturnType: void (0x3)
; CHECK: ClassType: BStruct ({{.*}})
; CHECK: ThisType: BStruct* ({{.*}})
; CHECK: ThisType: BStruct* const ({{.*}})
; CHECK: CallingConvention: NearC (0x0)
; CHECK: FunctionOptions [ (0x2)
; CHECK: Constructor (0x2)
@ -309,7 +309,7 @@
; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
; CHECK: ReturnType: void (0x3)
; CHECK: ClassType: BUnion ({{.*}})
; CHECK: ThisType: BUnion* ({{.*}})
; CHECK: ThisType: BUnion* const ({{.*}})
; CHECK: CallingConvention: NearC (0x0)
; CHECK: FunctionOptions [ (0x0)
; CHECK: ]

View File

@ -187,7 +187,7 @@ attributes #2 = { noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-ma
; YAML: - Kind: LF_POINTER
; YAML: Pointer:
; YAML: ReferentType: 4100
; YAML: Attrs: 32778
; YAML: Attrs: 33802
; YAML: - Kind: LF_ARGLIST
; YAML: ArgList:
; YAML: ArgIndices: [ 116, 116 ]
@ -281,17 +281,21 @@ attributes #2 = { noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-ma
; YAML: - DF04AA3125BBC50E
; YAML: - 95CEBA304A2C4493
; YAML: - C324F82D24D22283
; YAML: - 74698BE366891D3D
; YAML: - BB039258F2425BCF
; YAML: - DDE23757322DB7C3
; YAML: - 1692305447C3D360
; YAML: - C935E8E1F016CC27
; YAML: - D341E2F9BE57A1C7
; YAML: - 243F76AED6D8FB79
; YAML: - C75E2FD5D79D363D
; YAML: - 30FB9353B361B4B8
; YAML: - DD327744BE6783A4
; YAML: - 479521BB013A4AEC
; YAML: - 7820AAA31FC8CC67
; YAML: - 0634944401BCC520
; YAML: - DF0B7BE0B5AD5B4F
; YAML: - 0916E74F3860DA92
; YAML: - 17D3CDC3384402DD
; YAML: - F380373F5DE8E9A3
; YAML: - 2ADB463E9E726E20
; YAML: - 74698BE366891D3D
; YAML: - 4470750F2E319329
; YAML: - 0FB556FD1FAB66D7
; YAML: - 5970EFB4874D0F3F
; YAML: - EDB1D74C120CF44A
; ...

View File

@ -28,7 +28,7 @@
; CHECK-NEXT: TypeLeafKind: LF_MFUNCTION (0x1009)
; CHECK-NEXT: ReturnType: void (0x3)
; CHECK-NEXT: ClassType: A ({{.*}})
; CHECK-NEXT: ThisType: A* ({{.*}})
; CHECK-NEXT: ThisType: A* const ({{.*}})
; CHECK-NEXT: CallingConvention: ThisCall (0xB)
; CHECK-NEXT: FunctionOptions [ (0x0)
; CHECK-NEXT: ]

View File

@ -249,7 +249,7 @@
; CHECK: PtrType: Near64 (0xC)
; CHECK: PtrMode: Pointer (0x0)
; CHECK: IsFlat: 0
; CHECK: IsConst: 0
; CHECK: IsConst: 1
; CHECK: IsVolatile: 0
; CHECK: IsUnaligned: 0
; CHECK: IsRestrict: 0
@ -266,7 +266,7 @@
; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
; CHECK: ReturnType: int (0x74)
; CHECK: ClassType: h::Foo (0x1016)
; CHECK: ThisType: h::Foo* (0x1017)
; CHECK: ThisType: h::Foo* const (0x1017)
; CHECK: CallingConvention: NearC (0x0)
; CHECK: FunctionOptions [ (0x0)
; CHECK: ]
@ -337,16 +337,28 @@
; CHECK: FunctionType: int h::Foo::(int) (0x1019)
; CHECK: Name: func
; CHECK: }
; CHECK: Modifier (0x1020) {
; CHECK: Pointer (0x1020) {
; CHECK: TypeLeafKind: LF_POINTER (0x1002)
; CHECK: PointeeType: h::Foo (0x1016)
; CHECK: PtrType: Near64 (0xC)
; CHECK: PtrMode: Pointer (0x0)
; CHECK: IsFlat: 0
; CHECK: IsConst: 0
; CHECK: IsVolatile: 0
; CHECK: IsUnaligned: 0
; CHECK: IsRestrict: 0
; CHECK: SizeOf: 8
; CHECK: }
; CHECK: Modifier (0x1021) {
; CHECK: TypeLeafKind: LF_MODIFIER (0x1001)
; CHECK: ModifiedType: char (0x70)
; CHECK: Modifiers [ (0x1)
; CHECK: Const (0x1)
; CHECK: ]
; CHECK: }
; CHECK: Array (0x1021) {
; CHECK: Array (0x1022) {
; CHECK: TypeLeafKind: LF_ARRAY (0x1503)
; CHECK: ElementType: const char (0x1020)
; CHECK: ElementType: const char (0x1021)
; CHECK: IndexType: unsigned __int64 (0x23)
; CHECK: SizeOf: 4
; CHECK: Name:

View File

@ -106,7 +106,7 @@
; CHECK: PtrType: Near64 (0xC)
; CHECK: PtrMode: Pointer (0x0)
; CHECK: IsFlat: 0
; CHECK: IsConst: 0
; CHECK: IsConst: 1
; CHECK: IsVolatile: 0
; CHECK: IsUnaligned: 0
; CHECK: }
@ -120,7 +120,7 @@
; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
; CHECK: ReturnType: void (0x3)
; CHECK: ClassType: A (0x1005)
; CHECK: ThisType: A* (0x1007)
; CHECK: ThisType: A* const (0x1007)
; CHECK: CallingConvention: NearC (0x0)
; CHECK: FunctionOptions [ (0x0)
; CHECK: ]

View File

@ -33,7 +33,7 @@
; CHECK: PtrType: Near32 (0xA)
; CHECK: PtrMode: Pointer (0x0)
; CHECK: IsFlat: 0
; CHECK: IsConst: 0
; CHECK: IsConst: 1
; CHECK: IsVolatile: 0
; CHECK: IsUnaligned: 0
; CHECK: SizeOf: 4
@ -48,7 +48,7 @@
; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
; CHECK: ReturnType: void (0x3)
; CHECK: ClassType: A (0x1000)
; CHECK: ThisType: A* (0x1001)
; CHECK: ThisType: A* const (0x1001)
; CHECK: CallingConvention: ThisCall (0xB)
; CHECK: FunctionOptions [ (0x0)
; CHECK: ]
@ -92,7 +92,19 @@
; CHECK: FunctionType: void A::() (0x1003)
; CHECK: Name: A::thiscallcc
; CHECK: }
; CHECK: Procedure (0x1009) {
; CHECK: Pointer (0x1009) {
; CHECK: TypeLeafKind: LF_POINTER (0x1002)
; CHECK: PointeeType: A (0x1000)
; CHECK: PtrType: Near32 (0xA)
; CHECK: PtrMode: Pointer (0x0)
; CHECK: IsFlat: 0
; CHECK: IsConst: 0
; CHECK: IsVolatile: 0
; CHECK: IsUnaligned: 0
; CHECK: IsRestrict: 0
; CHECK: SizeOf: 4
; CHECK: }
; CHECK: Procedure (0x100A) {
; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008)
; CHECK: ReturnType: void (0x3)
; CHECK: CallingConvention: NearC (0x0)
@ -101,13 +113,13 @@
; CHECK: NumParameters: 0
; CHECK: ArgListType: () (0x1002)
; CHECK: }
; CHECK: FuncId (0x100A) {
; CHECK: FuncId (0x100B) {
; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601)
; CHECK: ParentScope: 0x0
; CHECK: FunctionType: void () (0x1009)
; CHECK: FunctionType: void () (0x100A)
; CHECK: Name: cdeclcc
; CHECK: }
; CHECK: Procedure (0x100B) {
; CHECK: Procedure (0x100C) {
; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008)
; CHECK: ReturnType: void (0x3)
; CHECK: CallingConvention: NearFast (0x4)
@ -116,13 +128,13 @@
; CHECK: NumParameters: 0
; CHECK: ArgListType: () (0x1002)
; CHECK: }
; CHECK: FuncId (0x100C) {
; CHECK: FuncId (0x100D) {
; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601)
; CHECK: ParentScope: 0x0
; CHECK: FunctionType: void () (0x100B)
; CHECK: FunctionType: void () (0x100C)
; CHECK: Name: fastcallcc
; CHECK: }
; CHECK: Procedure (0x100D) {
; CHECK: Procedure (0x100E) {
; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008)
; CHECK: ReturnType: void (0x3)
; CHECK: CallingConvention: NearStdCall (0x7)
@ -131,13 +143,13 @@
; CHECK: NumParameters: 0
; CHECK: ArgListType: () (0x1002)
; CHECK: }
; CHECK: FuncId (0x100E) {
; CHECK: FuncId (0x100F) {
; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601)
; CHECK: ParentScope: 0x0
; CHECK: FunctionType: void () (0x100D)
; CHECK: FunctionType: void () (0x100E)
; CHECK: Name: stdcallcc
; CHECK: }
; CHECK: Procedure (0x100F) {
; CHECK: Procedure (0x1010) {
; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008)
; CHECK: ReturnType: void (0x3)
; CHECK: CallingConvention: NearVector (0x18)
@ -146,10 +158,10 @@
; CHECK: NumParameters: 0
; CHECK: ArgListType: () (0x1002)
; CHECK: }
; CHECK: FuncId (0x1010) {
; CHECK: FuncId (0x1011) {
; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601)
; CHECK: ParentScope: 0x0
; CHECK: FunctionType: void () (0x100F)
; CHECK: FunctionType: void () (0x1010)
; CHECK: Name: vectorcallcc
; CHECK: }
; CHECK: ]

View File

@ -33,7 +33,7 @@
; CHECK: }
; CHECK: UDTSym {
; CHECK: Kind: S_UDT (0x1108)
; CHECK: Type: void (int, float, <no type>)* (0x100E)
; CHECK: Type: void (int, float, <no type>)* (0x100F)
; CHECK: UDTName: FuncTypedef
; CHECK: }
; CHECK: ]

View File

@ -363,7 +363,7 @@
; CHECK: PtrType: Near64 (0xC)
; CHECK: PtrMode: Pointer (0x0)
; CHECK: IsFlat: 0
; CHECK: IsConst: 0
; CHECK: IsConst: 1
; CHECK: IsVolatile: 0
; CHECK: IsUnaligned: 0
; CHECK: SizeOf: 8
@ -372,7 +372,7 @@
; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
; CHECK: ReturnType: void (0x3)
; CHECK: ClassType: DerivedClass (0x1011)
; CHECK: ThisType: DerivedClass* (0x101C)
; CHECK: ThisType: DerivedClass* const (0x101C)
; CHECK: CallingConvention: NearC (0x0)
; CHECK: FunctionOptions [ (0x0)
; CHECK: ]

View File

@ -67,7 +67,7 @@
; CHECK: PtrType: Near32 (0xA)
; CHECK: PtrMode: Pointer (0x0)
; CHECK: IsFlat: 0
; CHECK: IsConst: 0
; CHECK: IsConst: 1
; CHECK: IsVolatile: 0
; CHECK: IsUnaligned: 0
; CHECK: }
@ -75,7 +75,7 @@
; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
; CHECK: ReturnType: void (0x3)
; CHECK: ClassType: A (0x1003)
; CHECK: ThisType: A* (0x1004)
; CHECK: ThisType: A* const (0x1004)
; CHECK: CallingConvention: ThisCall (0xB)
; CHECK: FunctionOptions [ (0x0)
; CHECK: ]
@ -146,7 +146,7 @@
; CHECK: PtrType: Near32 (0xA)
; CHECK: PtrMode: Pointer (0x0)
; CHECK: IsFlat: 0
; CHECK: IsConst: 0
; CHECK: IsConst: 1
; CHECK: IsVolatile: 0
; CHECK: IsUnaligned: 0
; CHECK: SizeOf: 4
@ -155,7 +155,7 @@
; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
; CHECK: ReturnType: void (0x3)
; CHECK: ClassType: B (0x100A)
; CHECK: ThisType: B* (0x100B)
; CHECK: ThisType: B* const (0x100B)
; CHECK: CallingConvention: ThisCall (0xB)
; CHECK: FunctionOptions [ (0x0)
; CHECK: ]
@ -174,7 +174,7 @@
; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
; CHECK: ReturnType: void (0x3)
; CHECK: ClassType: B (0x100A)
; CHECK: ThisType: B* (0x100B)
; CHECK: ThisType: B* const (0x100B)
; CHECK: CallingConvention: ThisCall (0xB)
; CHECK: FunctionOptions [ (0x0)
; CHECK: ]
@ -193,7 +193,7 @@
; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
; CHECK: ReturnType: void (0x3)
; CHECK: ClassType: B (0x100A)
; CHECK: ThisType: B* (0x100B)
; CHECK: ThisType: B* const (0x100B)
; CHECK: CallingConvention: ThisCall (0xB)
; CHECK: FunctionOptions [ (0x0)
; CHECK: ]

View File

@ -25,7 +25,7 @@
; CHECK-NEXT: TypeLeafKind: LF_MFUNCTION (0x1009)
; CHECK-NEXT: ReturnType: int (0x74)
; CHECK-NEXT: ClassType: A ({{.*}})
; CHECK-NEXT: ThisType: A* ({{.*}})
; CHECK-NEXT: ThisType: A* const ({{.*}})
; CHECK-NEXT: CallingConvention: NearC (0x0)
; CHECK-NEXT: FunctionOptions [ (0x0)
; CHECK-NEXT: ]
@ -39,7 +39,7 @@
; CHECK-NEXT: TypeLeafKind: LF_MFUNCTION (0x1009)
; CHECK-NEXT: ReturnType: int (0x74)
; CHECK-NEXT: ClassType: B ({{.*}})
; CHECK-NEXT: ThisType: B* ({{.*}})
; CHECK-NEXT: ThisType: B* const ({{.*}})
; CHECK-NEXT: CallingConvention: NearC (0x0)
; CHECK-NEXT: FunctionOptions [ (0x0)
; CHECK-NEXT: ]
@ -53,7 +53,7 @@
; CHECK-NEXT: TypeLeafKind: LF_MFUNCTION (0x1009)
; CHECK-NEXT: ReturnType: int (0x74)
; CHECK-NEXT: ClassType: C ({{.*}})
; CHECK-NEXT: ThisType: C* ({{.*}})
; CHECK-NEXT: ThisType: C* const ({{.*}})
; CHECK-NEXT: CallingConvention: NearC (0x0)
; CHECK-NEXT: FunctionOptions [ (0x0)
; CHECK-NEXT: ]
@ -77,7 +77,7 @@
; CHECK-NEXT: TypeLeafKind: LF_MFUNCTION (0x1009)
; CHECK-NEXT: ReturnType: int (0x74)
; CHECK-NEXT: ClassType: D ({{.*}})
; CHECK-NEXT: ThisType: D* ({{.*}})
; CHECK-NEXT: ThisType: D* const ({{.*}})
; CHECK-NEXT: CallingConvention: NearC (0x0)
; CHECK-NEXT: FunctionOptions [ (0x0)
; CHECK-NEXT: ]