Skip to content

Commit 73325c9

Browse files
committed
Delete hacky reorderFields method
1 parent 4ba74e9 commit 73325c9

File tree

3 files changed

+0
-20
lines changed

3 files changed

+0
-20
lines changed

clang/include/clang/AST/Decl.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3814,8 +3814,6 @@ class RecordDecl : public TagDecl {
38143814
/// nullptr is returned if no named data member exists.
38153815
const FieldDecl *findFirstNamedDataMember() const;
38163816

3817-
void reorderFields(ArrayRef<Decl *> Decls) const;
3818-
38193817
private:
38203818
/// Deserialize just the fields.
38213819
void LoadFieldsFromExternalStorage() const;

clang/lib/AST/Decl.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4148,14 +4148,6 @@ RecordDecl::field_iterator RecordDecl::field_begin() const {
41484148
return field_iterator(decl_iterator(FirstDecl));
41494149
}
41504150

4151-
void RecordDecl::reorderFields(ArrayRef<Decl *> Decls) const {
4152-
Decl *NewFirst, *NewLast;
4153-
std::tie(NewFirst, NewLast) =
4154-
BuildDeclChain(Decls, false);
4155-
FirstDecl = NewFirst;
4156-
LastDecl = NewLast;
4157-
}
4158-
41594151
/// completeDefinition - Notes that the definition of this type is now
41604152
/// complete.
41614153
void RecordDecl::completeDefinition() {

clang/lib/AST/RecordLayoutBuilder.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2989,16 +2989,6 @@ ASTContext::getASTRecordLayout(const RecordDecl *D) const {
29892989

29902990
bool ShouldBeRandomized = D->getAttr<RandomizeLayoutAttr>() != nullptr;
29912991
if (ShouldBeRandomized) {
2992-
// A staging area to easily reorder the fields
2993-
SmallVector<Decl *, 64> fields;
2994-
for (auto f : D->fields()) {
2995-
fields.push_back(f);
2996-
}
2997-
2998-
fields = rearrange(*this, fields);
2999-
3000-
// This will rebuild the Decl chain of fields
3001-
D->reorderFields(fields);
30022992
}
30032993

30042994
if (isMsLayout(*this)) {

0 commit comments

Comments
 (0)