Skip to content

Commit 4ca4f81

Browse files
authored
[llvm] clang-format llvm/IR/BasicBlock.h and llvmLTO/LTOGodeGenerator.h (#141849)
Reformat a couple of headers under llvm/include with `clang-format` in preparation for a codemod. This is just a formatting change; no functionality is impacted.
1 parent 150d466 commit 4ca4f81

File tree

2 files changed

+44
-42
lines changed

2 files changed

+44
-42
lines changed

llvm/include/llvm/IR/BasicBlock.h

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
218218

219219
/// Return the enclosing method, or null if none.
220220
const Function *getParent() const { return Parent; }
221-
Function *getParent() { return Parent; }
221+
Function *getParent() { return Parent; }
222222

223223
/// Return the module owning the function this basic block belongs to, or
224224
/// nullptr if the function does not have a module.
@@ -227,7 +227,7 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
227227
const Module *getModule() const;
228228
Module *getModule() {
229229
return const_cast<Module *>(
230-
static_cast<const BasicBlock *>(this)->getModule());
230+
static_cast<const BasicBlock *>(this)->getModule());
231231
}
232232

233233
/// Get the data layout of the module this basic block belongs to.
@@ -253,16 +253,17 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
253253
const CallInst *getTerminatingDeoptimizeCall() const;
254254
CallInst *getTerminatingDeoptimizeCall() {
255255
return const_cast<CallInst *>(
256-
static_cast<const BasicBlock *>(this)->getTerminatingDeoptimizeCall());
256+
static_cast<const BasicBlock *>(this)->getTerminatingDeoptimizeCall());
257257
}
258258

259259
/// Returns the call instruction calling \@llvm.experimental.deoptimize
260260
/// that is present either in current basic block or in block that is a unique
261-
/// successor to current block, if such call is present. Otherwise, returns null.
261+
/// successor to current block, if such call is present. Otherwise, returns
262+
/// null.
262263
const CallInst *getPostdominatingDeoptimizeCall() const;
263264
CallInst *getPostdominatingDeoptimizeCall() {
264-
return const_cast<CallInst *>(
265-
static_cast<const BasicBlock *>(this)->getPostdominatingDeoptimizeCall());
265+
return const_cast<CallInst *>(static_cast<const BasicBlock *>(this)
266+
->getPostdominatingDeoptimizeCall());
266267
}
267268

268269
/// Returns the call instruction marked 'musttail' prior to the terminating
@@ -271,7 +272,7 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
271272
const CallInst *getTerminatingMustTailCall() const;
272273
CallInst *getTerminatingMustTailCall() {
273274
return const_cast<CallInst *>(
274-
static_cast<const BasicBlock *>(this)->getTerminatingMustTailCall());
275+
static_cast<const BasicBlock *>(this)->getTerminatingMustTailCall());
275276
}
276277

277278
/// Returns a pointer to the first instruction in this block that is not a
@@ -336,7 +337,8 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
336337
const_iterator getFirstInsertionPt() const;
337338
iterator getFirstInsertionPt() {
338339
return static_cast<const BasicBlock *>(this)
339-
->getFirstInsertionPt().getNonConst();
340+
->getFirstInsertionPt()
341+
.getNonConst();
340342
}
341343

342344
/// Returns an iterator to the first instruction in this block that is
@@ -351,10 +353,10 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
351353
/// Returns the first potential AsynchEH faulty instruction
352354
/// currently it checks for loads/stores (which may dereference a null
353355
/// pointer) and calls/invokes (which may propagate exceptions)
354-
const Instruction* getFirstMayFaultInst() const;
355-
Instruction* getFirstMayFaultInst() {
356-
return const_cast<Instruction*>(
357-
static_cast<const BasicBlock*>(this)->getFirstMayFaultInst());
356+
const Instruction *getFirstMayFaultInst() const;
357+
Instruction *getFirstMayFaultInst() {
358+
return const_cast<Instruction *>(
359+
static_cast<const BasicBlock *>(this)->getFirstMayFaultInst());
358360
}
359361

360362
/// Return a const iterator range over the instructions in the block, skipping
@@ -408,7 +410,7 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
408410
const BasicBlock *getSinglePredecessor() const;
409411
BasicBlock *getSinglePredecessor() {
410412
return const_cast<BasicBlock *>(
411-
static_cast<const BasicBlock *>(this)->getSinglePredecessor());
413+
static_cast<const BasicBlock *>(this)->getSinglePredecessor());
412414
}
413415

414416
/// Return the predecessor of this block if it has a unique predecessor
@@ -420,7 +422,7 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
420422
const BasicBlock *getUniquePredecessor() const;
421423
BasicBlock *getUniquePredecessor() {
422424
return const_cast<BasicBlock *>(
423-
static_cast<const BasicBlock *>(this)->getUniquePredecessor());
425+
static_cast<const BasicBlock *>(this)->getUniquePredecessor());
424426
}
425427

426428
/// Return true if this block has exactly N predecessors.
@@ -436,7 +438,7 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
436438
const BasicBlock *getSingleSuccessor() const;
437439
BasicBlock *getSingleSuccessor() {
438440
return const_cast<BasicBlock *>(
439-
static_cast<const BasicBlock *>(this)->getSingleSuccessor());
441+
static_cast<const BasicBlock *>(this)->getSingleSuccessor());
440442
}
441443

442444
/// Return the successor of this block if it has a unique successor.
@@ -446,7 +448,7 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
446448
const BasicBlock *getUniqueSuccessor() const;
447449
BasicBlock *getUniqueSuccessor() {
448450
return const_cast<BasicBlock *>(
449-
static_cast<const BasicBlock *>(this)->getUniqueSuccessor());
451+
static_cast<const BasicBlock *>(this)->getUniqueSuccessor());
450452
}
451453

452454
/// Print the basic block to an output stream with an optional
@@ -471,20 +473,20 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
471473
It.setHeadBit(true);
472474
return It;
473475
}
474-
inline iterator end () { return InstList.end(); }
475-
inline const_iterator end () const { return InstList.end(); }
476+
inline iterator end() { return InstList.end(); }
477+
inline const_iterator end() const { return InstList.end(); }
476478

477-
inline reverse_iterator rbegin() { return InstList.rbegin(); }
478-
inline const_reverse_iterator rbegin() const { return InstList.rbegin(); }
479-
inline reverse_iterator rend () { return InstList.rend(); }
480-
inline const_reverse_iterator rend () const { return InstList.rend(); }
479+
inline reverse_iterator rbegin() { return InstList.rbegin(); }
480+
inline const_reverse_iterator rbegin() const { return InstList.rbegin(); }
481+
inline reverse_iterator rend() { return InstList.rend(); }
482+
inline const_reverse_iterator rend() const { return InstList.rend(); }
481483

482-
inline size_t size() const { return InstList.size(); }
483-
inline bool empty() const { return InstList.empty(); }
484-
inline const Instruction &front() const { return InstList.front(); }
485-
inline Instruction &front() { return InstList.front(); }
486-
inline const Instruction &back() const { return InstList.back(); }
487-
inline Instruction &back() { return InstList.back(); }
484+
inline size_t size() const { return InstList.size(); }
485+
inline bool empty() const { return InstList.empty(); }
486+
inline const Instruction &front() const { return InstList.front(); }
487+
inline Instruction &front() { return InstList.front(); }
488+
inline const Instruction &back() const { return InstList.back(); }
489+
inline Instruction &back() { return InstList.back(); }
488490

489491
/// Iterator to walk just the phi nodes in the basic block.
490492
template <typename PHINodeT = PHINode, typename BBIteratorT = iterator>
@@ -677,12 +679,12 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
677679
/// Transfer a range of instructions that belong to \p FromBB from \p
678680
/// FromBeginIt to \p FromEndIt, to this basic block at \p ToIt.
679681
void splice(BasicBlock::iterator ToIt, BasicBlock *FromBB,
680-
BasicBlock::iterator FromBeginIt,
681-
BasicBlock::iterator FromEndIt);
682+
BasicBlock::iterator FromBeginIt, BasicBlock::iterator FromEndIt);
682683

683684
/// Erases a range of instructions from \p FromIt to (not including) \p ToIt.
684685
/// \Returns \p ToIt.
685-
BasicBlock::iterator erase(BasicBlock::iterator FromIt, BasicBlock::iterator ToIt);
686+
BasicBlock::iterator erase(BasicBlock::iterator FromIt,
687+
BasicBlock::iterator ToIt);
686688

687689
/// Returns true if there are any uses of this basic block other than
688690
/// direct branches, switches, etc. to it.
@@ -715,7 +717,7 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
715717
const LandingPadInst *getLandingPadInst() const;
716718
LandingPadInst *getLandingPadInst() {
717719
return const_cast<LandingPadInst *>(
718-
static_cast<const BasicBlock *>(this)->getLandingPadInst());
720+
static_cast<const BasicBlock *>(this)->getLandingPadInst());
719721
}
720722

721723
/// Return true if it is legal to hoist instructions into this block.

llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@
5353

5454
namespace llvm {
5555
template <typename T> class ArrayRef;
56-
class LLVMContext;
57-
class DiagnosticInfo;
58-
class Linker;
59-
class Mangler;
60-
class MemoryBuffer;
61-
class TargetLibraryInfo;
62-
class TargetMachine;
63-
class raw_ostream;
64-
class raw_pwrite_stream;
56+
class LLVMContext;
57+
class DiagnosticInfo;
58+
class Linker;
59+
class Mangler;
60+
class MemoryBuffer;
61+
class TargetLibraryInfo;
62+
class TargetMachine;
63+
class raw_ostream;
64+
class raw_pwrite_stream;
6565

6666
/// Enable global value internalization in LTO.
6767
extern cl::opt<bool> EnableLTOInternalization;
@@ -253,5 +253,5 @@ struct LTOCodeGenerator {
253253
/// A convenience function that calls cl::ParseCommandLineOptions on the given
254254
/// set of options.
255255
void parseCommandLineOptions(std::vector<std::string> &Options);
256-
}
256+
} // namespace llvm
257257
#endif

0 commit comments

Comments
 (0)