[BOLT] Add main fragment to function layout
authorFabian Parzefall <parzefall@fb.com>
Wed, 17 Aug 2022 21:51:29 +0000 (14:51 -0700)
committerFabian Parzefall <parzefall@fb.com>
Wed, 17 Aug 2022 21:51:31 +0000 (14:51 -0700)
commit0f8412c19c32dbda994248bc1bdfd6bc71346049
tree716883fe3f5c85daad7b7dd50152922b83fbd4e0
parent7ed3d81333b7a366d48a27521bb36ac58dc12fa2
[BOLT] Add main fragment to function layout

Functions that do not contain any code still have to be emitted. This
occurs on AArch64 where functions can consist only of a constant island.
To support fragment semantics in code emission, this commits adds a
guaranteed main fragment to function layout. This fragment might be
empty, but allows us omit checks whether the function is empty in most
places.

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D130051
bolt/include/bolt/Core/FunctionLayout.h
bolt/lib/Core/BinaryEmitter.cpp
bolt/lib/Core/BinaryFunction.cpp
bolt/lib/Core/FunctionLayout.cpp