Skip to content

Commit 7f770b6

Browse files
jurahulvinay-deshmukh
authored andcommitted
[NFC][LLVM][Transforms/Utils] Fix indentation inside namespace (llvm#166624)
Code inside namespace need not be indented. Fix such indendations in a few cases.
1 parent e6e3c1c commit 7f770b6

File tree

3 files changed

+72
-71
lines changed

3 files changed

+72
-71
lines changed

llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,43 +39,44 @@ using namespace llvm;
3939
STATISTIC(NumBroken, "Number of blocks inserted");
4040

4141
namespace {
42-
struct BreakCriticalEdges : public FunctionPass {
43-
static char ID; // Pass identification, replacement for typeid
44-
BreakCriticalEdges() : FunctionPass(ID) {
45-
initializeBreakCriticalEdgesPass(*PassRegistry::getPassRegistry());
46-
}
42+
struct BreakCriticalEdges : public FunctionPass {
43+
static char ID; // Pass identification, replacement for typeid
44+
BreakCriticalEdges() : FunctionPass(ID) {
45+
initializeBreakCriticalEdgesPass(*PassRegistry::getPassRegistry());
46+
}
4747

48-
bool runOnFunction(Function &F) override {
49-
auto *DTWP = getAnalysisIfAvailable<DominatorTreeWrapperPass>();
50-
auto *DT = DTWP ? &DTWP->getDomTree() : nullptr;
48+
bool runOnFunction(Function &F) override {
49+
auto *DTWP = getAnalysisIfAvailable<DominatorTreeWrapperPass>();
50+
auto *DT = DTWP ? &DTWP->getDomTree() : nullptr;
5151

52-
auto *PDTWP = getAnalysisIfAvailable<PostDominatorTreeWrapperPass>();
53-
auto *PDT = PDTWP ? &PDTWP->getPostDomTree() : nullptr;
52+
auto *PDTWP = getAnalysisIfAvailable<PostDominatorTreeWrapperPass>();
53+
auto *PDT = PDTWP ? &PDTWP->getPostDomTree() : nullptr;
5454

55-
auto *LIWP = getAnalysisIfAvailable<LoopInfoWrapperPass>();
56-
auto *LI = LIWP ? &LIWP->getLoopInfo() : nullptr;
57-
unsigned N =
58-
SplitAllCriticalEdges(F, CriticalEdgeSplittingOptions(DT, LI, nullptr, PDT));
59-
NumBroken += N;
60-
return N > 0;
61-
}
55+
auto *LIWP = getAnalysisIfAvailable<LoopInfoWrapperPass>();
56+
auto *LI = LIWP ? &LIWP->getLoopInfo() : nullptr;
57+
unsigned N = SplitAllCriticalEdges(
58+
F, CriticalEdgeSplittingOptions(DT, LI, nullptr, PDT));
59+
NumBroken += N;
60+
return N > 0;
61+
}
6262

63-
void getAnalysisUsage(AnalysisUsage &AU) const override {
64-
AU.addPreserved<DominatorTreeWrapperPass>();
65-
AU.addPreserved<LoopInfoWrapperPass>();
63+
void getAnalysisUsage(AnalysisUsage &AU) const override {
64+
AU.addPreserved<DominatorTreeWrapperPass>();
65+
AU.addPreserved<LoopInfoWrapperPass>();
6666

67-
// No loop canonicalization guarantees are broken by this pass.
68-
AU.addPreservedID(LoopSimplifyID);
69-
}
70-
};
71-
}
67+
// No loop canonicalization guarantees are broken by this pass.
68+
AU.addPreservedID(LoopSimplifyID);
69+
}
70+
};
71+
} // namespace
7272

7373
char BreakCriticalEdges::ID = 0;
7474
INITIALIZE_PASS(BreakCriticalEdges, "break-crit-edges",
7575
"Break critical edges in CFG", false, false)
7676

7777
// Publicly exposed interface to pass...
7878
char &llvm::BreakCriticalEdgesID = BreakCriticalEdges::ID;
79+
7980
FunctionPass *llvm::createBreakCriticalEdgesPass() {
8081
return new BreakCriticalEdges();
8182
}

llvm/lib/Transforms/Utils/BypassSlowDivision.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,22 @@ using namespace llvm;
4040

4141
namespace {
4242

43-
struct QuotRemPair {
44-
Value *Quotient;
45-
Value *Remainder;
46-
47-
QuotRemPair(Value *InQuotient, Value *InRemainder)
48-
: Quotient(InQuotient), Remainder(InRemainder) {}
49-
};
50-
51-
/// A quotient and remainder, plus a BB from which they logically "originate".
52-
/// If you use Quotient or Remainder in a Phi node, you should use BB as its
53-
/// corresponding predecessor.
54-
struct QuotRemWithBB {
55-
BasicBlock *BB = nullptr;
56-
Value *Quotient = nullptr;
57-
Value *Remainder = nullptr;
58-
};
43+
struct QuotRemPair {
44+
Value *Quotient;
45+
Value *Remainder;
46+
47+
QuotRemPair(Value *InQuotient, Value *InRemainder)
48+
: Quotient(InQuotient), Remainder(InRemainder) {}
49+
};
50+
51+
/// A quotient and remainder, plus a BB from which they logically "originate".
52+
/// If you use Quotient or Remainder in a Phi node, you should use BB as its
53+
/// corresponding predecessor.
54+
struct QuotRemWithBB {
55+
BasicBlock *BB = nullptr;
56+
Value *Quotient = nullptr;
57+
Value *Remainder = nullptr;
58+
};
5959

6060
using DivCacheTy = DenseMap<DivRemMapKey, QuotRemPair>;
6161
using BypassWidthsTy = DenseMap<unsigned, unsigned>;

llvm/lib/Transforms/Utils/LoopSimplify.cpp

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ static BasicBlock *insertUniqueBackedgeBlock(Loop *L, BasicBlock *Preheader,
378378
if (P != Preheader) BackedgeBlocks.push_back(P);
379379
}
380380

381-
// Create and insert the new backedge block...
381+
// Create and insert the new backedge block.
382382
BasicBlock *BEBlock = BasicBlock::Create(Header->getContext(),
383383
Header->getName() + ".backedge", F);
384384
BranchInst *BETerminator = BranchInst::Create(Header, BEBlock);
@@ -737,39 +737,39 @@ bool llvm::simplifyLoop(Loop *L, DominatorTree *DT, LoopInfo *LI,
737737
}
738738

739739
namespace {
740-
struct LoopSimplify : public FunctionPass {
741-
static char ID; // Pass identification, replacement for typeid
742-
LoopSimplify() : FunctionPass(ID) {
743-
initializeLoopSimplifyPass(*PassRegistry::getPassRegistry());
744-
}
740+
struct LoopSimplify : public FunctionPass {
741+
static char ID; // Pass identification, replacement for typeid
742+
LoopSimplify() : FunctionPass(ID) {
743+
initializeLoopSimplifyPass(*PassRegistry::getPassRegistry());
744+
}
745745

746-
bool runOnFunction(Function &F) override;
746+
bool runOnFunction(Function &F) override;
747747

748-
void getAnalysisUsage(AnalysisUsage &AU) const override {
749-
AU.addRequired<AssumptionCacheTracker>();
748+
void getAnalysisUsage(AnalysisUsage &AU) const override {
749+
AU.addRequired<AssumptionCacheTracker>();
750750

751-
// We need loop information to identify the loops...
752-
AU.addRequired<DominatorTreeWrapperPass>();
753-
AU.addPreserved<DominatorTreeWrapperPass>();
751+
// We need loop information to identify the loops.
752+
AU.addRequired<DominatorTreeWrapperPass>();
753+
AU.addPreserved<DominatorTreeWrapperPass>();
754754

755-
AU.addRequired<LoopInfoWrapperPass>();
756-
AU.addPreserved<LoopInfoWrapperPass>();
755+
AU.addRequired<LoopInfoWrapperPass>();
756+
AU.addPreserved<LoopInfoWrapperPass>();
757757

758-
AU.addPreserved<BasicAAWrapperPass>();
759-
AU.addPreserved<AAResultsWrapperPass>();
760-
AU.addPreserved<GlobalsAAWrapperPass>();
761-
AU.addPreserved<ScalarEvolutionWrapperPass>();
762-
AU.addPreserved<SCEVAAWrapperPass>();
763-
AU.addPreservedID(LCSSAID);
764-
AU.addPreservedID(BreakCriticalEdgesID); // No critical edges added.
765-
AU.addPreserved<BranchProbabilityInfoWrapperPass>();
766-
AU.addPreserved<MemorySSAWrapperPass>();
767-
}
758+
AU.addPreserved<BasicAAWrapperPass>();
759+
AU.addPreserved<AAResultsWrapperPass>();
760+
AU.addPreserved<GlobalsAAWrapperPass>();
761+
AU.addPreserved<ScalarEvolutionWrapperPass>();
762+
AU.addPreserved<SCEVAAWrapperPass>();
763+
AU.addPreservedID(LCSSAID);
764+
AU.addPreservedID(BreakCriticalEdgesID); // No critical edges added.
765+
AU.addPreserved<BranchProbabilityInfoWrapperPass>();
766+
AU.addPreserved<MemorySSAWrapperPass>();
767+
}
768768

769-
/// verifyAnalysis() - Verify LoopSimplifyForm's guarantees.
770-
void verifyAnalysis() const override;
771-
};
772-
}
769+
/// verifyAnalysis() - Verify LoopSimplifyForm's guarantees.
770+
void verifyAnalysis() const override;
771+
};
772+
} // namespace
773773

774774
char LoopSimplify::ID = 0;
775775
INITIALIZE_PASS_BEGIN(LoopSimplify, "loop-simplify",
@@ -780,12 +780,12 @@ INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass)
780780
INITIALIZE_PASS_END(LoopSimplify, "loop-simplify", "Canonicalize natural loops",
781781
false, false)
782782

783-
// Publicly exposed interface to pass...
783+
// Publicly exposed interface to pass.
784784
char &llvm::LoopSimplifyID = LoopSimplify::ID;
785785
Pass *llvm::createLoopSimplifyPass() { return new LoopSimplify(); }
786786

787787
/// runOnFunction - Run down all loops in the CFG (recursively, but we could do
788-
/// it in any convenient order) inserting preheaders...
788+
/// it in any convenient order) inserting preheaders.
789789
///
790790
bool LoopSimplify::runOnFunction(Function &F) {
791791
bool Changed = false;

0 commit comments

Comments
 (0)