1313#ifndef LLVM_IR_BASICBLOCK_H
1414#define LLVM_IR_BASICBLOCK_H
1515
16- #include " llvm/Support/Compiler.h"
1716#include " llvm-c/Types.h"
1817#include " llvm/ADT/DenseMap.h"
1918#include " llvm/ADT/Twine.h"
2524#include " llvm/IR/Instruction.h"
2625#include " llvm/IR/SymbolTableListTraits.h"
2726#include " llvm/IR/Value.h"
27+ #include " llvm/Support/Compiler.h"
2828#include < cassert>
2929#include < cstddef>
3030#include < iterator>
@@ -138,7 +138,8 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
138138 LLVM_ABI void insertDbgRecordAfter (DbgRecord *DR, Instruction *I);
139139
140140 // / Insert a DbgRecord into a block at the position given by \p Here.
141- LLVM_ABI void insertDbgRecordBefore (DbgRecord *DR, InstListType::iterator Here);
141+ LLVM_ABI void insertDbgRecordBefore (DbgRecord *DR,
142+ InstListType::iterator Here);
142143
143144 // / Eject any debug-info trailing at the end of a block. DbgRecords can
144145 // / transiently be located "off the end" of a block if the blocks terminator
@@ -151,8 +152,9 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
151152 // / happens in RemoveDIs debug-info mode, some special patching-up needs to
152153 // / occur: inserting into the middle of a sequence of dbg.value intrinsics
153154 // / does not have an equivalent with DbgRecords.
154- LLVM_ABI void reinsertInstInDbgRecords (Instruction *I,
155- std::optional<DbgRecord::self_iterator> Pos);
155+ LLVM_ABI void
156+ reinsertInstInDbgRecords (Instruction *I,
157+ std::optional<DbgRecord::self_iterator> Pos);
156158
157159private:
158160 void setParent (Function *parent);
@@ -163,8 +165,8 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
163165 // / inserted at either the end of the function (if InsertBefore is null), or
164166 // / before the specified basic block.
165167 LLVM_ABI explicit BasicBlock (LLVMContext &C, const Twine &Name = " " ,
166- Function *Parent = nullptr ,
167- BasicBlock *InsertBefore = nullptr );
168+ Function *Parent = nullptr ,
169+ BasicBlock *InsertBefore = nullptr );
168170
169171public:
170172 BasicBlock (const BasicBlock &) = delete ;
@@ -236,8 +238,8 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
236238 // / Requires the basic block to have a parent module.
237239 LLVM_ABI const DataLayout &getDataLayout () const ;
238240
239- // / Returns the terminator instruction if the block is well formed or null
240- // / if the block is not well formed.
241+ // / Returns the terminator instruction if the block is well formed or
242+ // / null if the block is not well formed.
241243 const Instruction *getTerminator () const LLVM_READONLY {
242244 if (InstList.empty () || !InstList.back ().isTerminator ())
243245 return nullptr ;
@@ -285,11 +287,11 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
285287 // /
286288 // / Deprecated in favour of getFirstNonPHIIt, which returns an iterator that
287289 // / preserves some debugging information.
288- LLVM_ABI LLVM_DEPRECATED (" Use iterators as instruction positions" , " getFirstNonPHIIt" )
289- const Instruction *getFirstNonPHI() const ;
290+ LLVM_ABI LLVM_DEPRECATED (" Use iterators as instruction positions" ,
291+ " getFirstNonPHIIt" ) const
292+ Instruction *getFirstNonPHI() const ;
290293 LLVM_ABI LLVM_DEPRECATED (" Use iterators as instruction positions instead" ,
291- " getFirstNonPHIIt" )
292- Instruction *getFirstNonPHI();
294+ " getFirstNonPHIIt" ) Instruction *getFirstNonPHI();
293295
294296 // / Returns an iterator to the first instruction in this block that is not a
295297 // / PHINode instruction.
@@ -363,7 +365,8 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
363365 // / Return a const iterator range over the instructions in the block, skipping
364366 // / any debug instructions. Skip any pseudo operations as well if \c
365367 // / SkipPseudoOp is true.
366- LLVM_ABI iterator_range<filter_iterator<BasicBlock::const_iterator,
368+ LLVM_ABI
369+ iterator_range<filter_iterator<BasicBlock::const_iterator,
367370 std::function<bool (const Instruction &)>>>
368371 instructionsWithoutDebug (bool SkipPseudoOp = true ) const ;
369372
@@ -375,7 +378,8 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
375378 instructionsWithoutDebug (bool SkipPseudoOp = true );
376379
377380 // / Return the size of the basic block ignoring debug instructions
378- LLVM_ABI filter_iterator<BasicBlock::const_iterator,
381+ LLVM_ABI
382+ filter_iterator<BasicBlock::const_iterator,
379383 std::function<bool (const Instruction &)>>::difference_type
380384 sizeWithoutDebug () const ;
381385
@@ -404,7 +408,8 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
404408 // / provided, inserts before that basic block, otherwise inserts at the end.
405409 // /
406410 // / \pre \a getParent() is \c nullptr.
407- LLVM_ABI void insertInto (Function *Parent, BasicBlock *InsertBefore = nullptr );
411+ LLVM_ABI void insertInto (Function *Parent,
412+ BasicBlock *InsertBefore = nullptr );
408413
409414 // / Return the predecessor of this block if it has a single predecessor
410415 // / block. Otherwise return a null pointer.
@@ -455,8 +460,8 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
455460 // / Print the basic block to an output stream with an optional
456461 // / AssemblyAnnotationWriter.
457462 LLVM_ABI void print (raw_ostream &OS, AssemblyAnnotationWriter *AAW = nullptr ,
458- bool ShouldPreserveUseListOrder = false ,
459- bool IsForDebug = false ) const ;
463+ bool ShouldPreserveUseListOrder = false ,
464+ bool IsForDebug = false ) const ;
460465
461466 // ===--------------------------------------------------------------------===//
462467 // / Instruction iterator methods
@@ -610,7 +615,8 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
610615 // / If \p KeepOneInputPHIs is true then don't remove PHIs that are left with
611616 // / zero or one incoming values, and don't simplify PHIs with all incoming
612617 // / values the same.
613- LLVM_ABI void removePredecessor (BasicBlock *Pred, bool KeepOneInputPHIs = false );
618+ LLVM_ABI void removePredecessor (BasicBlock *Pred,
619+ bool KeepOneInputPHIs = false );
614620
615621 LLVM_ABI bool canSplitPredecessors () const ;
616622
@@ -633,7 +639,7 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
633639 // / Also note that this doesn't preserve any passes. To split blocks while
634640 // / keeping loop information consistent, use the SplitBlock utility function.
635641 LLVM_ABI BasicBlock *splitBasicBlock (iterator I, const Twine &BBName = " " ,
636- bool Before = false );
642+ bool Before = false );
637643 BasicBlock *splitBasicBlock (Instruction *I, const Twine &BBName = " " ,
638644 bool Before = false ) {
639645 return splitBasicBlock (I->getIterator (), BBName, Before);
@@ -656,7 +662,8 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
656662 // / Also note that this doesn't preserve any passes. To split blocks while
657663 // / keeping loop information consistent, use the SplitBlockBefore utility
658664 // / function.
659- LLVM_ABI BasicBlock *splitBasicBlockBefore (iterator I, const Twine &BBName = " " );
665+ LLVM_ABI BasicBlock *splitBasicBlockBefore (iterator I,
666+ const Twine &BBName = " " );
660667 BasicBlock *splitBasicBlockBefore (Instruction *I, const Twine &BBName = " " ) {
661668 return splitBasicBlockBefore (I->getIterator (), BBName);
662669 }
@@ -680,12 +687,13 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
680687 // / Transfer a range of instructions that belong to \p FromBB from \p
681688 // / FromBeginIt to \p FromEndIt, to this basic block at \p ToIt.
682689 LLVM_ABI void splice (BasicBlock::iterator ToIt, BasicBlock *FromBB,
683- BasicBlock::iterator FromBeginIt, BasicBlock::iterator FromEndIt);
690+ BasicBlock::iterator FromBeginIt,
691+ BasicBlock::iterator FromEndIt);
684692
685693 // / Erases a range of instructions from \p FromIt to (not including) \p ToIt.
686694 // / \Returns \p ToIt.
687695 LLVM_ABI BasicBlock::iterator erase (BasicBlock::iterator FromIt,
688- BasicBlock::iterator ToIt);
696+ BasicBlock::iterator ToIt);
689697
690698 // / Returns true if there are any uses of this basic block other than
691699 // / direct branches, switches, etc. to it.
0 commit comments