Skip to content

Commit 3fe3338

Browse files
authored
Merge branch 'main' into users/rampitec/10-27-_amdgpu_support_true16_spill_restore_with_sram-ecc
2 parents 211f4ab + 9702ec0 commit 3fe3338

File tree

576 files changed

+184906
-243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

576 files changed

+184906
-243
lines changed

clang/lib/Format/WhitespaceManager.cpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ AlignTokenSequence(const FormatStyle &Style, unsigned Start, unsigned End,
288288
ArrayRef<unsigned> Matches,
289289
SmallVector<WhitespaceManager::Change, 16> &Changes) {
290290
int Shift = 0;
291+
// Set when the shift is applied anywhere in the line. Cleared when the line
292+
// ends.
293+
bool LineShifted = false;
291294

292295
// ScopeStack keeps track of the current scope depth. It contains the levels
293296
// of at most 2 scopes. The first one is the one that the matched token is
@@ -339,8 +342,11 @@ AlignTokenSequence(const FormatStyle &Style, unsigned Start, unsigned End,
339342
Changes[i - 1].Tok->is(tok::string_literal);
340343
bool SkipMatchCheck = InsideNestedScope || ContinuedStringLiteral;
341344

342-
if (CurrentChange.NewlinesBefore > 0 && !SkipMatchCheck)
343-
Shift = 0;
345+
if (CurrentChange.NewlinesBefore > 0) {
346+
LineShifted = false;
347+
if (!SkipMatchCheck)
348+
Shift = 0;
349+
}
344350

345351
// If this is the first matching token to be aligned, remember by how many
346352
// spaces it has to be shifted, so the rest of the changes on the line are
@@ -349,7 +355,6 @@ AlignTokenSequence(const FormatStyle &Style, unsigned Start, unsigned End,
349355
Shift = Column - (RightJustify ? CurrentChange.TokenLength : 0) -
350356
CurrentChange.StartOfTokenColumn;
351357
ScopeStack = {CurrentChange.indentAndNestingLevel()};
352-
CurrentChange.Spaces += Shift;
353358
}
354359

355360
if (Shift == 0)
@@ -358,8 +363,10 @@ AlignTokenSequence(const FormatStyle &Style, unsigned Start, unsigned End,
358363
// This is for lines that are split across multiple lines, as mentioned in
359364
// the ScopeStack comment. The stack size being 1 means that the token is
360365
// not in a scope that should not move.
361-
if (ScopeStack.size() == 1u && CurrentChange.NewlinesBefore > 0 &&
362-
(ContinuedStringLiteral || InsideNestedScope)) {
366+
if ((!Matches.empty() && Matches[0] == i) ||
367+
(ScopeStack.size() == 1u && CurrentChange.NewlinesBefore > 0 &&
368+
(ContinuedStringLiteral || InsideNestedScope))) {
369+
LineShifted = true;
363370
CurrentChange.Spaces += Shift;
364371
}
365372

@@ -369,9 +376,11 @@ AlignTokenSequence(const FormatStyle &Style, unsigned Start, unsigned End,
369376
static_cast<int>(Changes[i].Tok->SpacesRequiredBefore) ||
370377
CurrentChange.Tok->is(tok::eof));
371378

372-
CurrentChange.StartOfTokenColumn += Shift;
373-
if (i + 1 != Changes.size())
374-
Changes[i + 1].PreviousEndOfTokenColumn += Shift;
379+
if (LineShifted) {
380+
CurrentChange.StartOfTokenColumn += Shift;
381+
if (i + 1 != Changes.size())
382+
Changes[i + 1].PreviousEndOfTokenColumn += Shift;
383+
}
375384

376385
// If PointerAlignment is PAS_Right, keep *s or &s next to the token,
377386
// except if the token is equal, then a space is needed.

clang/test/DebugInfo/ObjC/property-2.m

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
2+
3+
// CHECK-NOT: setter
4+
// CHECK-NOT: getter
5+
6+
@interface I1
7+
@property int p1;
8+
@end
9+
10+
@implementation I1
11+
@end
12+
13+
void foo(I1 *ptr) {}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Checks basic debug-info generation for property. Makes sure we
2+
// create a DIObjCProperty for the synthesized property.
3+
4+
// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
5+
6+
// CHECK: !DIObjCProperty(name: "p1"
7+
// CHECK-SAME: attributes: 2316
8+
// CHECK-SAME: type: ![[P1_TYPE:[0-9]+]]
9+
//
10+
// CHECK: ![[P1_TYPE]] = !DIBasicType(name: "int"
11+
12+
@interface I1 {
13+
int p1;
14+
}
15+
@property int p1;
16+
@end
17+
18+
@implementation I1
19+
@synthesize p1;
20+
@end
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
2+
3+
// CHECK: !DIObjCProperty(name: "baseInt"
4+
// CHECK-SAME: setter: "mySetBaseInt:"
5+
// CHECK-SAME: getter: "myGetBaseInt"
6+
// CHECK-SAME: attributes: 2446
7+
// CHECK-SAME: type: ![[P1_TYPE:[0-9]+]]
8+
//
9+
// CHECK: ![[P1_TYPE]] = !DIBasicType(name: "int"
10+
11+
@interface BaseClass2
12+
{
13+
int _baseInt;
14+
}
15+
- (int) myGetBaseInt;
16+
- (void) mySetBaseInt: (int) in_int;
17+
@property(getter=myGetBaseInt,setter=mySetBaseInt:) int baseInt;
18+
@end
19+
20+
@implementation BaseClass2
21+
22+
- (int) myGetBaseInt
23+
{
24+
return _baseInt;
25+
}
26+
27+
- (void) mySetBaseInt: (int) in_int
28+
{
29+
_baseInt = 2 * in_int;
30+
}
31+
@end
32+
33+
34+
void foo(BaseClass2 *ptr) {}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
2+
3+
// CHECK: ![[BASE_PROP:[0-9]+]] = !DIObjCProperty(name: "base"
4+
// CHECK-SAME: attributes: 2316
5+
// CHECK-SAME: type: ![[P1_TYPE:[0-9]+]]
6+
//
7+
// CHECK: ![[P1_TYPE]] = !DIBasicType(name: "int"
8+
//
9+
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "_customIvar"
10+
// CHECK-SAME: extraData: ![[BASE_PROP]]
11+
12+
@interface C {
13+
int _customIvar;
14+
}
15+
@property int base;
16+
@end
17+
18+
@implementation C
19+
@synthesize base = _customIvar;
20+
@end
21+
22+
void foo(C *cptr) {}

clang/test/DebugInfo/ObjC/property.m

Lines changed: 0 additions & 15 deletions
This file was deleted.

clang/test/DebugInfo/ObjC/property2.m

Lines changed: 0 additions & 15 deletions
This file was deleted.

clang/test/DebugInfo/ObjC/property4.m

Lines changed: 0 additions & 18 deletions
This file was deleted.

clang/test/DebugInfo/ObjC/property5.m

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)