Skip to content

Commit d4c1db5

Browse files
Fix downstream violation on strict getTrailingObjects
Fix downstream build after upstream PR llvm#144930. rdar://154701604
1 parent 6792651 commit d4c1db5

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

clang/include/clang/AST/Expr.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3980,11 +3980,11 @@ class AssumptionExpr final
39803980
friend class ASTStmtWriter;
39813981

39823982
Expr **getTrailingExprs() {
3983-
return const_cast<Expr **>(getTrailingObjects<Expr *>());
3983+
return const_cast<Expr **>(getTrailingObjects());
39843984
}
39853985

39863986
Expr *const *getTrailingExprs() const {
3987-
return getTrailingObjects<Expr *>();
3987+
return getTrailingObjects();
39883988
}
39893989

39903990
AssumptionExpr(EmptyShell Empty, unsigned NumExprs)
@@ -4325,10 +4325,10 @@ class PredefinedBoundsCheckExpr final
43254325
}
43264326

43274327
Stmt **getTrailingStmts() {
4328-
return const_cast<Stmt **>(getTrailingObjects<Stmt *>());
4328+
return const_cast<Stmt **>(getTrailingObjects());
43294329
}
43304330

4331-
Stmt *const *getTrailingStmts() const { return getTrailingObjects<Stmt *>(); }
4331+
Stmt *const *getTrailingStmts() const { return getTrailingObjects(); }
43324332

43334333
Expr **getSubExprs() { return reinterpret_cast<Expr **>(getTrailingStmts()); }
43344334

@@ -4474,11 +4474,11 @@ class BoundsCheckExpr final :
44744474
}
44754475

44764476
Stmt **getTrailingStmts() {
4477-
return const_cast<Stmt **>(getTrailingObjects<Stmt *>());
4477+
return const_cast<Stmt **>(getTrailingObjects());
44784478
}
44794479

44804480
Stmt *const *getTrailingStmts() const {
4481-
return getTrailingObjects<Stmt *>();
4481+
return getTrailingObjects();
44824482
}
44834483

44844484
Expr **getSubExprs() {
@@ -4589,11 +4589,11 @@ class MaterializeSequenceExpr final :
45894589
}
45904590

45914591
Expr **getSubExprs() {
4592-
return getTrailingObjects<Expr *>();
4592+
return getTrailingObjects();
45934593
}
45944594

45954595
Expr *const *getSubExprs() const {
4596-
return getTrailingObjects<Expr *>();
4596+
return getTrailingObjects();
45974597
}
45984598

45994599
friend class ASTStmtReader;

clang/include/clang/AST/ExprObjC.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,7 +1714,7 @@ class ObjCAvailabilityCheckExpr final
17141714
VersionToCheck(), AtLoc(AtLoc), RParen(RParen) {
17151715
setDependence(ExprDependence::None);
17161716
setHasDomainName(true);
1717-
strcpy(getTrailingObjects<char>(), DomainName.data());
1717+
strcpy(getTrailingObjects(), DomainName.data());
17181718
}
17191719

17201720
public:
@@ -1756,7 +1756,7 @@ class ObjCAvailabilityCheckExpr final
17561756
}
17571757
StringRef getDomainName() const {
17581758
assert(hasDomainName());
1759-
return getTrailingObjects<char>();
1759+
return getTrailingObjects();
17601760
}
17611761

17621762
child_range children() {

clang/include/clang/AST/Type.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3752,7 +3752,7 @@ class DynamicRangePointerType final
37523752
}
37533753

37543754
decl_iterator startptr_decl_begin() const {
3755-
return getTrailingObjects<TypeCoupledDeclRefInfo>();
3755+
return getTrailingObjects();
37563756
}
37573757

37583758
decl_iterator startptr_decl_end() const {

clang/lib/AST/Expr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2209,7 +2209,7 @@ AssumptionExpr *AssumptionExpr::CreateEmpty(const ASTContext &Ctx,
22092209
}
22102210

22112211
Stmt **BoundsSafetyPointerPromotionExpr::getPointerPtr() {
2212-
return getTrailingObjects<Stmt *>();
2212+
return getTrailingObjects();
22132213
}
22142214

22152215
Stmt **BoundsSafetyPointerPromotionExpr::getLowerBoundPtr() {

clang/lib/AST/ExprObjC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ ObjCAvailabilityCheckExpr *ObjCAvailabilityCheckExpr::CreateEmpty(
353353
totalSizeToAlloc<char>(FeaturesLen + 1),
354354
alignof(ObjCAvailabilityCheckExpr));
355355
new (E) ObjCAvailabilityCheckExpr(Empty);
356-
memset(E->getTrailingObjects<char>(), 0, FeaturesLen + 1);
356+
memset(E->getTrailingObjects(), 0, FeaturesLen + 1);
357357
return E;
358358
}
359359

clang/lib/AST/Type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4131,7 +4131,7 @@ DynamicRangePointerType::DynamicRangePointerType(
41314131
assert(StartPtrDecls.size() < (1 << 16));
41324132
DynamicRangePointerTypeBits.NumEndPtrDecls = EndPtrDecls.size();
41334133
DynamicRangePointerTypeBits.NumStartPtrDecls = StartPtrDecls.size();
4134-
auto *DeclSlot = getTrailingObjects<TypeCoupledDeclRefInfo>();
4134+
auto *DeclSlot = getTrailingObjects();
41354135
Decls = llvm::ArrayRef(DeclSlot,
41364136
EndPtrDecls.size() + StartPtrDecls.size());
41374137
for (unsigned i = 0; i != StartPtrDecls.size(); ++i)

clang/lib/Serialization/ASTReaderStmt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,7 @@ void ASTStmtReader::VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E)
16881688
if (E->hasDomainName()) {
16891689
std::string DomainName = Record.readString();
16901690
assert(DomainNameLength == DomainName.size());
1691-
strcpy(E->getTrailingObjects<char>(), DomainName.data());
1691+
strcpy(E->getTrailingObjects(), DomainName.data());
16921692
}
16931693
}
16941694

0 commit comments

Comments
 (0)