Skip to content

Commit 4b70c6a

Browse files
committed
[llvm] clang-format changes to IR library
1 parent 83922e9 commit 4b70c6a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1512
-1244
lines changed

llvm/include/llvm/IR/AbstractCallSite.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
#ifndef LLVM_IR_ABSTRACTCALLSITE_H
1515
#define LLVM_IR_ABSTRACTCALLSITE_H
1616

17-
#include "llvm/Support/Compiler.h"
1817
#include "llvm/IR/Constants.h"
1918
#include "llvm/IR/Function.h"
2019
#include "llvm/IR/InstrTypes.h"
2120
#include "llvm/IR/Value.h"
21+
#include "llvm/Support/Compiler.h"
2222
#include <cassert>
2323

2424
namespace llvm {
@@ -103,8 +103,9 @@ class AbstractCallSite {
103103
///
104104
/// All uses added to \p CallbackUses can be used to create abstract call
105105
/// sites for which AbstractCallSite::isCallbackCall() will return true.
106-
LLVM_ABI static void getCallbackUses(const CallBase &CB,
107-
SmallVectorImpl<const Use *> &CallbackUses);
106+
LLVM_ABI static void
107+
getCallbackUses(const CallBase &CB,
108+
SmallVectorImpl<const Use *> &CallbackUses);
108109

109110
/// Conversion operator to conveniently check for a valid/initialized ACS.
110111
explicit operator bool() const { return CB != nullptr; }

llvm/include/llvm/IR/Analysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
#ifndef LLVM_IR_ANALYSIS_H
1313
#define LLVM_IR_ANALYSIS_H
1414

15-
#include "llvm/Support/Compiler.h"
1615
#include "llvm/ADT/SmallPtrSet.h"
16+
#include "llvm/Support/Compiler.h"
1717

1818
namespace llvm {
1919

llvm/include/llvm/IR/Argument.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
#ifndef LLVM_IR_ARGUMENT_H
1414
#define LLVM_IR_ARGUMENT_H
1515

16-
#include "llvm/Support/Compiler.h"
1716
#include "llvm/ADT/Twine.h"
1817
#include "llvm/IR/Attributes.h"
1918
#include "llvm/IR/Value.h"
19+
#include "llvm/Support/Compiler.h"
2020
#include <optional>
2121

2222
namespace llvm {
@@ -38,8 +38,8 @@ class Argument final : public Value {
3838

3939
public:
4040
/// Argument constructor.
41-
LLVM_ABI explicit Argument(Type *Ty, const Twine &Name = "", Function *F = nullptr,
42-
unsigned ArgNo = 0);
41+
LLVM_ABI explicit Argument(Type *Ty, const Twine &Name = "",
42+
Function *F = nullptr, unsigned ArgNo = 0);
4343

4444
inline const Function *getParent() const { return Parent; }
4545
inline Function *getParent() { return Parent; }
@@ -108,8 +108,8 @@ class Argument final : public Value {
108108
/// If this is a byval or inalloca argument, return its alignment.
109109
/// FIXME: Remove this function once transition to Align is over.
110110
/// Use getParamAlign() instead.
111-
LLVM_ABI LLVM_DEPRECATED("Use getParamAlign() instead", "getParamAlign")
112-
uint64_t getParamAlignment() const;
111+
LLVM_ABI LLVM_DEPRECATED("Use getParamAlign() instead",
112+
"getParamAlign") uint64_t getParamAlignment() const;
113113

114114
/// If this is a byval or inalloca argument, return its alignment.
115115
LLVM_ABI MaybeAlign getParamAlign() const;

llvm/include/llvm/IR/Assumptions.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
#ifndef LLVM_IR_ASSUMPTIONS_H
1616
#define LLVM_IR_ASSUMPTIONS_H
1717

18-
#include "llvm/Support/Compiler.h"
1918
#include "llvm/ADT/DenseSet.h"
2019
#include "llvm/ADT/StringRef.h"
2120
#include "llvm/ADT/StringSet.h"
21+
#include "llvm/Support/Compiler.h"
2222

2323
namespace llvm {
2424

@@ -51,12 +51,12 @@ struct KnownAssumptionString {
5151

5252
/// Return true if \p F has the assumption \p AssumptionStr attached.
5353
LLVM_ABI bool hasAssumption(const Function &F,
54-
const KnownAssumptionString &AssumptionStr);
54+
const KnownAssumptionString &AssumptionStr);
5555

5656
/// Return true if \p CB or the callee has the assumption \p AssumptionStr
5757
/// attached.
5858
LLVM_ABI bool hasAssumption(const CallBase &CB,
59-
const KnownAssumptionString &AssumptionStr);
59+
const KnownAssumptionString &AssumptionStr);
6060

6161
/// Return the set of all assumptions for the function \p F.
6262
LLVM_ABI DenseSet<StringRef> getAssumptions(const Function &F);
@@ -65,10 +65,12 @@ LLVM_ABI DenseSet<StringRef> getAssumptions(const Function &F);
6565
LLVM_ABI DenseSet<StringRef> getAssumptions(const CallBase &CB);
6666

6767
/// Appends the set of assumptions \p Assumptions to \F.
68-
LLVM_ABI bool addAssumptions(Function &F, const DenseSet<StringRef> &Assumptions);
68+
LLVM_ABI bool addAssumptions(Function &F,
69+
const DenseSet<StringRef> &Assumptions);
6970

7071
/// Appends the set of assumptions \p Assumptions to \CB.
71-
LLVM_ABI bool addAssumptions(CallBase &CB, const DenseSet<StringRef> &Assumptions);
72+
LLVM_ABI bool addAssumptions(CallBase &CB,
73+
const DenseSet<StringRef> &Assumptions);
7274

7375
} // namespace llvm
7476

llvm/include/llvm/IR/Attributes.h

Lines changed: 105 additions & 91 deletions
Large diffs are not rendered by default.

llvm/include/llvm/IR/AutoUpgrade.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#ifndef LLVM_IR_AUTOUPGRADE_H
1414
#define LLVM_IR_AUTOUPGRADE_H
1515

16-
#include "llvm/Support/Compiler.h"
1716
#include "llvm/ADT/StringRef.h"
17+
#include "llvm/Support/Compiler.h"
1818
#include <vector>
1919

2020
namespace llvm {
@@ -37,8 +37,9 @@ namespace llvm {
3737
/// for upgrading, and returns true if it requires upgrading. It may return
3838
/// null in NewFn if the all calls to the original intrinsic function
3939
/// should be transformed to non-function-call instructions.
40-
LLVM_ABI bool UpgradeIntrinsicFunction(Function *F, Function *&NewFn,
41-
bool CanUpgradeDebugIntrinsicsToRecords = true);
40+
LLVM_ABI bool
41+
UpgradeIntrinsicFunction(Function *F, Function *&NewFn,
42+
bool CanUpgradeDebugIntrinsicsToRecords = true);
4243

4344
/// This is the complement to the above, replacing a specific call to an
4445
/// intrinsic function with a call to the specified new function.
@@ -52,7 +53,7 @@ namespace llvm {
5253
/// which need to have both the function updated as well as all calls updated
5354
/// to the new function. This should only be run in a post-processing fashion
5455
/// so that it can update all calls to the old function.
55-
LLVM_ABI void UpgradeCallsToIntrinsic(Function* F);
56+
LLVM_ABI void UpgradeCallsToIntrinsic(Function *F);
5657

5758
/// This checks for global variables which should be upgraded. If it requires
5859
/// upgrading, returns a pointer to the upgraded variable.
@@ -83,12 +84,13 @@ namespace llvm {
8384
/// This is an auto-upgrade for bitcast between pointers with different
8485
/// address spaces: the instruction is replaced by a pair ptrtoint+inttoptr.
8586
LLVM_ABI Instruction *UpgradeBitCastInst(unsigned Opc, Value *V, Type *DestTy,
86-
Instruction *&Temp);
87+
Instruction *&Temp);
8788

8889
/// This is an auto-upgrade for bitcast constant expression between pointers
8990
/// with different address spaces: the instruction is replaced by a pair
9091
/// ptrtoint+inttoptr.
91-
LLVM_ABI Constant *UpgradeBitCastExpr(unsigned Opc, Constant *C, Type *DestTy);
92+
LLVM_ABI Constant *UpgradeBitCastExpr(unsigned Opc, Constant *C,
93+
Type *DestTy);
9294

9395
/// Check the debug info version number, if it is out-dated, drop the debug
9496
/// info. Return true if module is modified.
@@ -110,7 +112,8 @@ namespace llvm {
110112
LLVM_ABI void UpgradeAttributes(AttrBuilder &B);
111113

112114
/// Upgrade operand bundles (without knowing about their user instruction).
113-
LLVM_ABI void UpgradeOperandBundles(std::vector<OperandBundleDef> &OperandBundles);
115+
LLVM_ABI void
116+
UpgradeOperandBundles(std::vector<OperandBundleDef> &OperandBundles);
114117

115118
} // End llvm namespace
116119

llvm/include/llvm/IR/BasicBlock.h

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
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"
@@ -25,6 +24,7 @@
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

157159
private:
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

169171
public:
170172
BasicBlock(const BasicBlock &) = delete;
@@ -228,16 +230,16 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
228230
LLVM_ABI const Module *getModule() const;
229231
Module *getModule() {
230232
return const_cast<Module *>(
231-
static_cast<const BasicBlock *>(this)->getModule());
233+
static_cast<const BasicBlock *>(this)->getModule());
232234
}
233235

234236
/// Get the data layout of the module this basic block belongs to.
235237
///
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;
@@ -284,11 +286,11 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
284286
///
285287
/// Deprecated in favour of getFirstNonPHIIt, which returns an iterator that
286288
/// preserves some debugging information.
287-
LLVM_ABI LLVM_DEPRECATED("Use iterators as instruction positions", "getFirstNonPHIIt")
288-
const Instruction *getFirstNonPHI() const;
289+
LLVM_ABI LLVM_DEPRECATED("Use iterators as instruction positions",
290+
"getFirstNonPHIIt") const
291+
Instruction *getFirstNonPHI() const;
289292
LLVM_ABI LLVM_DEPRECATED("Use iterators as instruction positions instead",
290-
"getFirstNonPHIIt")
291-
Instruction *getFirstNonPHI();
293+
"getFirstNonPHIIt") Instruction *getFirstNonPHI();
292294

293295
/// Returns an iterator to the first instruction in this block that is not a
294296
/// PHINode instruction.
@@ -352,7 +354,7 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
352354
/// Returns the first potential AsynchEH faulty instruction
353355
/// currently it checks for loads/stores (which may dereference a null
354356
/// pointer) and calls/invokes (which may propagate exceptions)
355-
LLVM_ABI const Instruction* getFirstMayFaultInst() const;
357+
LLVM_ABI const Instruction *getFirstMayFaultInst() const;
356358
Instruction* getFirstMayFaultInst() {
357359
return const_cast<Instruction*>(
358360
static_cast<const BasicBlock*>(this)->getFirstMayFaultInst());
@@ -361,7 +363,8 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
361363
/// Return a const iterator range over the instructions in the block, skipping
362364
/// any debug instructions. Skip any pseudo operations as well if \c
363365
/// SkipPseudoOp is true.
364-
LLVM_ABI iterator_range<filter_iterator<BasicBlock::const_iterator,
366+
LLVM_ABI
367+
iterator_range<filter_iterator<BasicBlock::const_iterator,
365368
std::function<bool(const Instruction &)>>>
366369
instructionsWithoutDebug(bool SkipPseudoOp = true) const;
367370

@@ -373,7 +376,8 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
373376
instructionsWithoutDebug(bool SkipPseudoOp = true);
374377

375378
/// Return the size of the basic block ignoring debug instructions
376-
LLVM_ABI filter_iterator<BasicBlock::const_iterator,
379+
LLVM_ABI
380+
filter_iterator<BasicBlock::const_iterator,
377381
std::function<bool(const Instruction &)>>::difference_type
378382
sizeWithoutDebug() const;
379383

@@ -402,7 +406,8 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
402406
/// provided, inserts before that basic block, otherwise inserts at the end.
403407
///
404408
/// \pre \a getParent() is \c nullptr.
405-
LLVM_ABI void insertInto(Function *Parent, BasicBlock *InsertBefore = nullptr);
409+
LLVM_ABI void insertInto(Function *Parent,
410+
BasicBlock *InsertBefore = nullptr);
406411

407412
/// Return the predecessor of this block if it has a single predecessor
408413
/// block. Otherwise return a null pointer.
@@ -453,8 +458,8 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
453458
/// Print the basic block to an output stream with an optional
454459
/// AssemblyAnnotationWriter.
455460
LLVM_ABI void print(raw_ostream &OS, AssemblyAnnotationWriter *AAW = nullptr,
456-
bool ShouldPreserveUseListOrder = false,
457-
bool IsForDebug = false) const;
461+
bool ShouldPreserveUseListOrder = false,
462+
bool IsForDebug = false) const;
458463

459464
//===--------------------------------------------------------------------===//
460465
/// Instruction iterator methods
@@ -608,7 +613,8 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
608613
/// If \p KeepOneInputPHIs is true then don't remove PHIs that are left with
609614
/// zero or one incoming values, and don't simplify PHIs with all incoming
610615
/// values the same.
611-
LLVM_ABI void removePredecessor(BasicBlock *Pred, bool KeepOneInputPHIs = false);
616+
LLVM_ABI void removePredecessor(BasicBlock *Pred,
617+
bool KeepOneInputPHIs = false);
612618

613619
LLVM_ABI bool canSplitPredecessors() const;
614620

@@ -631,7 +637,7 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
631637
/// Also note that this doesn't preserve any passes. To split blocks while
632638
/// keeping loop information consistent, use the SplitBlock utility function.
633639
LLVM_ABI BasicBlock *splitBasicBlock(iterator I, const Twine &BBName = "",
634-
bool Before = false);
640+
bool Before = false);
635641
BasicBlock *splitBasicBlock(Instruction *I, const Twine &BBName = "",
636642
bool Before = false) {
637643
return splitBasicBlock(I->getIterator(), BBName, Before);
@@ -654,7 +660,8 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
654660
/// Also note that this doesn't preserve any passes. To split blocks while
655661
/// keeping loop information consistent, use the SplitBlockBefore utility
656662
/// function.
657-
LLVM_ABI BasicBlock *splitBasicBlockBefore(iterator I, const Twine &BBName = "");
663+
LLVM_ABI BasicBlock *splitBasicBlockBefore(iterator I,
664+
const Twine &BBName = "");
658665
BasicBlock *splitBasicBlockBefore(Instruction *I, const Twine &BBName = "") {
659666
return splitBasicBlockBefore(I->getIterator(), BBName);
660667
}
@@ -678,12 +685,13 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
678685
/// Transfer a range of instructions that belong to \p FromBB from \p
679686
/// FromBeginIt to \p FromEndIt, to this basic block at \p ToIt.
680687
LLVM_ABI void splice(BasicBlock::iterator ToIt, BasicBlock *FromBB,
681-
BasicBlock::iterator FromBeginIt,
682-
BasicBlock::iterator FromEndIt);
688+
BasicBlock::iterator FromBeginIt,
689+
BasicBlock::iterator FromEndIt);
683690

684691
/// Erases a range of instructions from \p FromIt to (not including) \p ToIt.
685692
/// \Returns \p ToIt.
686-
LLVM_ABI BasicBlock::iterator erase(BasicBlock::iterator FromIt, BasicBlock::iterator ToIt);
693+
LLVM_ABI BasicBlock::iterator erase(BasicBlock::iterator FromIt,
694+
BasicBlock::iterator ToIt);
687695

688696
/// Returns true if there are any uses of this basic block other than
689697
/// direct branches, switches, etc. to it.

llvm/include/llvm/IR/CmpPredicate.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#ifndef LLVM_IR_CMPPREDICATE_H
1414
#define LLVM_IR_CMPPREDICATE_H
1515

16-
#include "llvm/Support/Compiler.h"
1716
#include "llvm/IR/InstrTypes.h"
17+
#include "llvm/Support/Compiler.h"
1818

1919
namespace llvm {
2020
/// An abstraction over a floating-point predicate, and a pack of an integer
@@ -56,7 +56,7 @@ class CmpPredicate {
5656
/// ult + ult -> ult
5757
/// ult + slt -> std::nullopt
5858
LLVM_ABI static std::optional<CmpPredicate> getMatching(CmpPredicate A,
59-
CmpPredicate B);
59+
CmpPredicate B);
6060

6161
/// Attempts to return a signed CmpInst::Predicate from the CmpPredicate. If
6262
/// the CmpPredicate has samesign, return ICmpInst::getSignedPredicate,

llvm/include/llvm/IR/Comdat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
#ifndef LLVM_IR_COMDAT_H
1616
#define LLVM_IR_COMDAT_H
1717

18-
#include "llvm/Support/Compiler.h"
1918
#include "llvm-c/Types.h"
2019
#include "llvm/ADT/SmallPtrSet.h"
2120
#include "llvm/Support/CBindingWrapping.h"
21+
#include "llvm/Support/Compiler.h"
2222

2323
namespace llvm {
2424

0 commit comments

Comments
 (0)