1
- // ===-- BBSectionsPrepare .cpp ---=========- --------------------------------===//
1
+ // ===-- BasicBlockSections .cpp ---=========--------------------------------===//
2
2
//
3
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
4
// See https://llvm.org/LICENSE.txt for license information.
5
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
6
//
7
7
// ===----------------------------------------------------------------------===//
8
8
//
9
- // BBSectionsPrepare implementation.
9
+ // BasicBlockSections implementation.
10
10
//
11
11
// The purpose of this pass is to assign sections to basic blocks when
12
12
// -fbasic-block-sections= option is used. Further, with profile information
@@ -100,7 +100,7 @@ struct BBClusterInfo {
100
100
101
101
using ProgramBBClusterInfoMapTy = StringMap<SmallVector<BBClusterInfo, 4 >>;
102
102
103
- class BBSectionsPrepare : public MachineFunctionPass {
103
+ class BasicBlockSections : public MachineFunctionPass {
104
104
public:
105
105
static char ID;
106
106
@@ -119,13 +119,13 @@ class BBSectionsPrepare : public MachineFunctionPass {
119
119
// name for which we have mapping in ProgramBBClusterInfo.
120
120
StringMap<StringRef> FuncAliasMap;
121
121
122
- BBSectionsPrepare (const MemoryBuffer *Buf)
122
+ BasicBlockSections (const MemoryBuffer *Buf)
123
123
: MachineFunctionPass(ID), MBuf(Buf) {
124
- initializeBBSectionsPreparePass (*PassRegistry::getPassRegistry ());
124
+ initializeBasicBlockSectionsPass (*PassRegistry::getPassRegistry ());
125
125
};
126
126
127
- BBSectionsPrepare () : MachineFunctionPass(ID) {
128
- initializeBBSectionsPreparePass (*PassRegistry::getPassRegistry ());
127
+ BasicBlockSections () : MachineFunctionPass(ID) {
128
+ initializeBasicBlockSectionsPass (*PassRegistry::getPassRegistry ());
129
129
}
130
130
131
131
StringRef getPassName () const override {
@@ -144,8 +144,8 @@ class BBSectionsPrepare : public MachineFunctionPass {
144
144
145
145
} // end anonymous namespace
146
146
147
- char BBSectionsPrepare ::ID = 0 ;
148
- INITIALIZE_PASS (BBSectionsPrepare , " bbsections-prepare" ,
147
+ char BasicBlockSections ::ID = 0 ;
148
+ INITIALIZE_PASS (BasicBlockSections , " bbsections-prepare" ,
149
149
" Prepares for basic block sections, by splitting functions "
150
150
" into clusters of basic blocks." ,
151
151
false , false )
@@ -324,7 +324,7 @@ static bool assignSectionsAndSortBasicBlocks(
324
324
return true ;
325
325
}
326
326
327
- bool BBSectionsPrepare ::runOnMachineFunction (MachineFunction &MF) {
327
+ bool BasicBlockSections ::runOnMachineFunction (MachineFunction &MF) {
328
328
auto BBSectionsType = MF.getTarget ().getBBSectionsType ();
329
329
assert (BBSectionsType != BasicBlockSection::None &&
330
330
" BB Sections not enabled!" );
@@ -438,20 +438,20 @@ static Error getBBClusterInfo(const MemoryBuffer *MBuf,
438
438
return Error::success ();
439
439
}
440
440
441
- bool BBSectionsPrepare ::doInitialization (Module &M) {
441
+ bool BasicBlockSections ::doInitialization (Module &M) {
442
442
if (!MBuf)
443
443
return false ;
444
444
if (auto Err = getBBClusterInfo (MBuf, ProgramBBClusterInfo, FuncAliasMap))
445
445
report_fatal_error (std::move (Err));
446
446
return false ;
447
447
}
448
448
449
- void BBSectionsPrepare ::getAnalysisUsage (AnalysisUsage &AU) const {
449
+ void BasicBlockSections ::getAnalysisUsage (AnalysisUsage &AU) const {
450
450
AU.setPreservesAll ();
451
451
MachineFunctionPass::getAnalysisUsage (AU);
452
452
}
453
453
454
454
MachineFunctionPass *
455
- llvm::createBBSectionsPreparePass (const MemoryBuffer *Buf) {
456
- return new BBSectionsPrepare (Buf);
455
+ llvm::createBasicBlockSectionsPass (const MemoryBuffer *Buf) {
456
+ return new BasicBlockSections (Buf);
457
457
}
0 commit comments