xref: /freebsd/contrib/llvm-project/llvm/include/llvm/CodeGen/BasicBlockSectionUtils.h (revision 7ef62cebc2f965b0f640263e179276928885e33d)
1 //===- BasicBlockSectionUtils.h - Utilities for basic block sections     --===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_CODEGEN_BASICBLOCKSECTIONUTILS_H
10 #define LLVM_CODEGEN_BASICBLOCKSECTIONUTILS_H
11 
12 #include "llvm/ADT/STLExtras.h"
13 #include "llvm/Support/CommandLine.h"
14 
15 namespace llvm {
16 
17 extern cl::opt<std::string> BBSectionsColdTextPrefix;
18 
19 class MachineFunction;
20 class MachineBasicBlock;
21 
22 using MachineBasicBlockComparator =
23     function_ref<bool(const MachineBasicBlock &, const MachineBasicBlock &)>;
24 
25 void sortBasicBlocksAndUpdateBranches(MachineFunction &MF,
26                                       MachineBasicBlockComparator MBBCmp);
27 
28 void avoidZeroOffsetLandingPad(MachineFunction &MF);
29 
30 } // end namespace llvm
31 
32 #endif // LLVM_CODEGEN_BASICBLOCKSECTIONUTILS_H
33