This is an archive of the discontinued LLVM Phabricator instance.

[Alignment][NFC] Use Align in MCStreamer::emitValueToAlignment
ClosedPublic

Authored by gchatelet on Nov 24 2022, 7:25 AM.

Diff Detail

Event Timeline

gchatelet created this revision.Nov 24 2022, 7:25 AM
Herald added a reviewer: Amir. · View Herald Transcript
Herald added a reviewer: maksfb. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
gchatelet requested review of this revision.Nov 24 2022, 7:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 24 2022, 7:25 AM
courbet accepted this revision.Nov 24 2022, 7:55 AM
courbet added inline comments.
bolt/lib/Core/BinaryEmitter.cpp
798

I don;t think there is really anything guaranteeing that this is a power of 2 , but it looks like it's the case all targets upstream.

This revision is now accepted and ready to land.Nov 24 2022, 7:55 AM
gchatelet marked an inline comment as done.Nov 24 2022, 8:08 AM
gchatelet added inline comments.
bolt/lib/Core/BinaryEmitter.cpp
798

Looks like relevant code is here.
https://github.com/llvm/llvm-project/blob/b9e3f5f864fb1944be60725aca400a9332ac6aa5/bolt/include/bolt/Core/BinaryContext.h#L377-L380

I think it's fine to assume it's aligned. If it changes Align ctor will assert and a proper fix can be applied.

This revision was landed with ongoing or failed builds.Nov 24 2022, 8:10 AM
This revision was automatically updated to reflect the committed changes.
gchatelet marked an inline comment as done.