1- // ===-- BBSectionsPrepare .cpp ---=========- --------------------------------===//
1+ // ===-- BasicBlockSections .cpp ---=========--------------------------------===//
22//
33// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44// See https://llvm.org/LICENSE.txt for license information.
55// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66//
77// ===----------------------------------------------------------------------===//
88//
9- // BBSectionsPrepare implementation.
9+ // BasicBlockSections implementation.
1010//
1111// The purpose of this pass is to assign sections to basic blocks when
1212// -fbasic-block-sections= option is used. Further, with profile information
@@ -100,7 +100,7 @@ struct BBClusterInfo {
100100
101101using ProgramBBClusterInfoMapTy = StringMap<SmallVector<BBClusterInfo, 4 >>;
102102
103- class BBSectionsPrepare : public MachineFunctionPass {
103+ class BasicBlockSections : public MachineFunctionPass {
104104public:
105105 static char ID;
106106
@@ -119,13 +119,13 @@ class BBSectionsPrepare : public MachineFunctionPass {
119119 // name for which we have mapping in ProgramBBClusterInfo.
120120 StringMap<StringRef> FuncAliasMap;
121121
122- BBSectionsPrepare (const MemoryBuffer *Buf)
122+ BasicBlockSections (const MemoryBuffer *Buf)
123123 : MachineFunctionPass(ID), MBuf(Buf) {
124- initializeBBSectionsPreparePass (*PassRegistry::getPassRegistry ());
124+ initializeBasicBlockSectionsPass (*PassRegistry::getPassRegistry ());
125125 };
126126
127- BBSectionsPrepare () : MachineFunctionPass(ID) {
128- initializeBBSectionsPreparePass (*PassRegistry::getPassRegistry ());
127+ BasicBlockSections () : MachineFunctionPass(ID) {
128+ initializeBasicBlockSectionsPass (*PassRegistry::getPassRegistry ());
129129 }
130130
131131 StringRef getPassName () const override {
@@ -144,8 +144,8 @@ class BBSectionsPrepare : public MachineFunctionPass {
144144
145145} // end anonymous namespace
146146
147- char BBSectionsPrepare ::ID = 0 ;
148- INITIALIZE_PASS (BBSectionsPrepare , " bbsections-prepare" ,
147+ char BasicBlockSections ::ID = 0 ;
148+ INITIALIZE_PASS (BasicBlockSections , " bbsections-prepare" ,
149149 " Prepares for basic block sections, by splitting functions "
150150 " into clusters of basic blocks." ,
151151 false , false )
@@ -324,7 +324,7 @@ static bool assignSectionsAndSortBasicBlocks(
324324 return true ;
325325}
326326
327- bool BBSectionsPrepare ::runOnMachineFunction (MachineFunction &MF) {
327+ bool BasicBlockSections ::runOnMachineFunction (MachineFunction &MF) {
328328 auto BBSectionsType = MF.getTarget ().getBBSectionsType ();
329329 assert (BBSectionsType != BasicBlockSection::None &&
330330 " BB Sections not enabled!" );
@@ -438,20 +438,20 @@ static Error getBBClusterInfo(const MemoryBuffer *MBuf,
438438 return Error::success ();
439439}
440440
441- bool BBSectionsPrepare ::doInitialization (Module &M) {
441+ bool BasicBlockSections ::doInitialization (Module &M) {
442442 if (!MBuf)
443443 return false ;
444444 if (auto Err = getBBClusterInfo (MBuf, ProgramBBClusterInfo, FuncAliasMap))
445445 report_fatal_error (std::move (Err));
446446 return false ;
447447}
448448
449- void BBSectionsPrepare ::getAnalysisUsage (AnalysisUsage &AU) const {
449+ void BasicBlockSections ::getAnalysisUsage (AnalysisUsage &AU) const {
450450 AU.setPreservesAll ();
451451 MachineFunctionPass::getAnalysisUsage (AU);
452452}
453453
454454MachineFunctionPass *
455- llvm::createBBSectionsPreparePass (const MemoryBuffer *Buf) {
456- return new BBSectionsPrepare (Buf);
455+ llvm::createBasicBlockSectionsPass (const MemoryBuffer *Buf) {
456+ return new BasicBlockSections (Buf);
457457}
0 commit comments