This is an archive of the discontinued LLVM Phabricator instance.

[llvm-lib] Write object files in reversed order.
ClosedPublic

Authored by jacek on Feb 7 2023, 4:38 PM.

Details

Summary

I don't strictly needed, but this matches how MSVC lib.exe writes to archives, so this makes llvm-lib more compatible and simplifies comparing output between tools.

Diff Detail

Event Timeline

jacek created this revision.Feb 7 2023, 4:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 7 2023, 4:38 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
jacek requested review of this revision.Feb 7 2023, 4:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 7 2023, 4:38 PM

Not sure if I have a strong opinion on whether we should do this... but I guess this is reasonable.

llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
142

llvm::reverse.

hans added inline comments.Feb 8 2023, 3:29 AM
llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
143

Do we have a test covering the order of these printed filenames?

It's surprising to me that we need to reverse here, but if it matches msvc it sounds good to me.

jacek updated this revision to Diff 495923.Feb 8 2023, 12:39 PM

Updated using llvm::reverse.

jacek added a comment.Feb 8 2023, 12:41 PM

Yes, it's covered by tests, llvm-lib/list.test and two other tests fail if I'd change the order written to the archive, but don't change printed order. I also manually confirmed that with VS 2022.

jacek retitled this revision from [llvm-lib 1/5] Write object files in reversed order. to [llvm-lib] Write object files in reversed order..Feb 8 2023, 12:46 PM
hans accepted this revision.Feb 9 2023, 3:45 AM

lgtm

This revision is now accepted and ready to land.Feb 9 2023, 3:45 AM

lgtm

@jacek If you don't have commit access, I can push the patch for you - what's your preferred git author line for these patches?

jacek added a comment.Feb 9 2023, 6:38 AM

@jacek If you don't have commit access, I can push the patch for you - what's your preferred git author line for these patches?

Yes, I don't have commit access. Please use "Jacek Caban <jacek@codeweavers.com>". Thanks!

This revision was landed with ongoing or failed builds.Feb 9 2023, 2:52 PM
This revision was automatically updated to reflect the committed changes.