File tree Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -346,7 +346,7 @@ def warn_unnecessary_packed : Warning<
346
346
347
347
// RandStruct implementation
348
348
def warn_randomize_attr_conflict : Warning<
349
- "struct declared with 'randomize_layout' and 'no_randomize_layout' attributes. "
350
- "attribute 'no_randomize_layout' takes precedence ">;
349
+ "struct declared with 'randomize_layout' and 'no_randomize_layout' attributes; "
350
+ "attribute 'no_randomize_layout' takes precedence">;
351
351
352
352
}
Original file line number Diff line number Diff line change @@ -2988,26 +2988,14 @@ ASTContext::getASTRecordLayout(const RecordDecl *D) const {
2988
2988
const ASTRecordLayout *NewEntry = nullptr ;
2989
2989
2990
2990
bool ShouldBeRandomized = D->getAttr <RandomizeLayoutAttr>() != nullptr ;
2991
- if (ShouldBeRandomized) {
2992
- Randstruct randstruct;
2993
- randstruct.reorganizeFields (*this , D);
2994
2991
bool NotToBeRandomized = D->getAttr <NoRandomizeLayoutAttr>() != nullptr ;
2995
2992
2996
2993
if (ShouldBeRandomized && NotToBeRandomized) {
2997
- // Diag(D->getLocation(), diag::warn_randomize_attr_conflict);
2998
2994
getDiagnostics ().Report (D->getLocation (), diag::warn_randomize_attr_conflict);
2999
2995
}
3000
2996
else if (ShouldBeRandomized) {
3001
- // A staging area to easily reorder the fields
3002
- SmallVector<Decl *, 64 > fields;
3003
- for (auto f : D->fields ()) {
3004
- fields.push_back (f);
3005
- }
3006
-
3007
- fields = rearrange (*this , fields);
3008
-
3009
- // This will rebuild the Decl chain of fields
3010
- D->reorderFields (fields);
2997
+ Randstruct randstruct;
2998
+ randstruct.reorganizeFields (*this ,D);
3011
2999
}
3012
3000
3013
3001
if (isMsLayout (*this )) {
You can’t perform that action at this time.
0 commit comments