Skip to content

Commit 9b0f3de

Browse files
committed
testing: Emit message when randomize_layout
1 parent 3b9829e commit 9b0f3de

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: clang/lib/AST/RecordLayoutBuilder.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8-
98
#include "clang/AST/RecordLayout.h"
109
#include "clang/AST/ASTContext.h"
1110
#include "clang/AST/ASTDiagnostic.h"
@@ -1362,7 +1361,13 @@ void ItaniumRecordLayoutBuilder::LayoutFields(const RecordDecl *D) {
13621361
// the future, this will need to be tweakable by targets.
13631362
bool InsertExtraPadding = D->mayInsertExtraPadding(/*EmitRemark=*/true);
13641363
bool HasFlexibleArrayMember = D->hasFlexibleArrayMember();
1365-
for (auto I = D->field_begin(), End = D->field_end(); I != End; ++I) {
1364+
1365+
bool ShouldBeRandomized = D->getAttr<RandomizedAttr>() != nullptr;
1366+
if (ShouldBeRandomized) {
1367+
llvm::outs() << D->getNameAsString() << "\n";
1368+
}
1369+
1370+
for (auto I = fields.begin(), End = fields.end(); I != End; ++I) {
13661371
auto Next(I);
13671372
++Next;
13681373
LayoutField(*I,

0 commit comments

Comments
 (0)