This is an archive of the discontinued LLVM Phabricator instance.

[randstruct] Check final randomized layout ordering
ClosedPublic

Authored by void on Apr 21 2022, 12:39 PM.

Details

Summary

This uses "llvm::shuffle" to stop differences in shuffle ordering on
different platforms.

Diff Detail

Event Timeline

void created this revision.Apr 21 2022, 12:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2022, 12:39 PM
Herald added a subscriber: StephenFan. · View Herald Transcript
void requested review of this revision.Apr 21 2022, 12:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2022, 12:39 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
MaskRay added inline comments.Apr 21 2022, 2:54 PM
clang/lib/AST/Randstruct.cpp
153

This was my original fix and your reland dropped it :(

clang/unittests/AST/RandstructTest.cpp
359

We haven't used c++17 yet.

void added inline comments.Apr 21 2022, 7:15 PM
clang/lib/AST/Randstruct.cpp
153

I think you reverted your change along with my patch. I don't remember intentionally changing this.

void updated this revision to Diff 424357.Apr 21 2022, 7:17 PM

Fixed "std::vector" mishap

MaskRay accepted this revision.Apr 21 2022, 7:30 PM
This revision is now accepted and ready to land.Apr 21 2022, 7:30 PM
This revision was landed with ongoing or failed builds.Apr 21 2022, 7:41 PM
This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Apr 21 2022, 7:59 PM

Looks like this breaks tests on windows: http://45.33.8.238/win/56771/step_7.txt

Please take a look and revert for now if it takes a while to fix.

Maskray?

I think this is likely the failure I saw when I tried fix forward in 46b2a463bdef1bd1d80abee869b09f95ca5a4fc2 .
I was/am puzzled. Someone with a MSVC environment may check what's wrong with the random number generator.