Skip to content

Commit 9d3845e

Browse files
author
jeff
committed
Clean up PR
PR was slightly behind, update and fix punctuation
1 parent a4a855d commit 9d3845e

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

clang/include/clang/Basic/DiagnosticASTKinds.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def warn_unnecessary_packed : Warning<
346346

347347
// RandStruct implementation
348348
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">;
351351

352352
}

clang/lib/AST/RecordLayoutBuilder.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2988,26 +2988,14 @@ ASTContext::getASTRecordLayout(const RecordDecl *D) const {
29882988
const ASTRecordLayout *NewEntry = nullptr;
29892989

29902990
bool ShouldBeRandomized = D->getAttr<RandomizeLayoutAttr>() != nullptr;
2991-
if (ShouldBeRandomized) {
2992-
Randstruct randstruct;
2993-
randstruct.reorganizeFields(*this, D);
29942991
bool NotToBeRandomized = D->getAttr<NoRandomizeLayoutAttr>() != nullptr;
29952992

29962993
if (ShouldBeRandomized && NotToBeRandomized) {
2997-
//Diag(D->getLocation(), diag::warn_randomize_attr_conflict);
29982994
getDiagnostics().Report(D->getLocation(), diag::warn_randomize_attr_conflict);
29992995
}
30002996
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);
30112999
}
30123000

30133001
if (isMsLayout(*this)) {

0 commit comments

Comments
 (0)