Skip to content

Commit 93561a8

Browse files
committed
[llvm] clang-format
1 parent 6e4f165 commit 93561a8

Some content is hidden

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

76 files changed

+1363
-1135
lines changed

llvm/include/llvm/Analysis/AliasAnalysis.h

Lines changed: 61 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@
3737
#ifndef LLVM_ANALYSIS_ALIASANALYSIS_H
3838
#define LLVM_ANALYSIS_ALIASANALYSIS_H
3939

40-
#include "llvm/Support/Compiler.h"
4140
#include "llvm/ADT/DenseMap.h"
4241
#include "llvm/ADT/SmallVector.h"
4342
#include "llvm/Analysis/MemoryLocation.h"
4443
#include "llvm/IR/Function.h"
4544
#include "llvm/IR/PassManager.h"
4645
#include "llvm/Pass.h"
46+
#include "llvm/Support/Compiler.h"
4747
#include "llvm/Support/ModRef.h"
4848
#include <cstdint>
4949
#include <functional>
@@ -165,7 +165,7 @@ class SimpleCaptureAnalysis final : public CaptureAnalysis {
165165

166166
public:
167167
LLVM_ABI bool isNotCapturedBefore(const Value *Object, const Instruction *I,
168-
bool OrAt) override;
168+
bool OrAt) override;
169169
};
170170

171171
/// Context-sensitive CaptureAnalysis provider, which computes and caches the
@@ -190,7 +190,7 @@ class EarliestEscapeAnalysis final : public CaptureAnalysis {
190190
: DT(DT), LI(LI) {}
191191

192192
LLVM_ABI bool isNotCapturedBefore(const Value *Object, const Instruction *I,
193-
bool OrAt) override;
193+
bool OrAt) override;
194194

195195
LLVM_ABI void removeInstruction(Instruction *I);
196196
};
@@ -340,7 +340,7 @@ class AAResults {
340340
/// The aggregation is invalidated if any of the underlying analyses is
341341
/// invalidated.
342342
LLVM_ABI bool invalidate(Function &F, const PreservedAnalyses &PA,
343-
FunctionAnalysisManager::Invalidator &Inv);
343+
FunctionAnalysisManager::Invalidator &Inv);
344344

345345
//===--------------------------------------------------------------------===//
346346
/// \name Alias Queries
@@ -350,7 +350,8 @@ class AAResults {
350350
/// Returns an AliasResult indicating whether the two pointers are aliased to
351351
/// each other. This is the interface that must be implemented by specific
352352
/// alias analysis implementations.
353-
LLVM_ABI AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB);
353+
LLVM_ABI AliasResult alias(const MemoryLocation &LocA,
354+
const MemoryLocation &LocB);
354355

355356
/// A convenience wrapper around the primary \c alias interface.
356357
AliasResult alias(const Value *V1, LocationSize V1Size, const Value *V2,
@@ -419,7 +420,7 @@ class AAResults {
419420
/// If IgnoreLocals is true, then this method returns NoModRef for memory
420421
/// that points to a local alloca.
421422
LLVM_ABI ModRefInfo getModRefInfoMask(const MemoryLocation &Loc,
422-
bool IgnoreLocals = false);
423+
bool IgnoreLocals = false);
423424

424425
/// A convenience wrapper around the primary \c getModRefInfoMask
425426
/// interface.
@@ -524,7 +525,8 @@ class AAResults {
524525

525526
/// Return information about whether two instructions may refer to the same
526527
/// memory locations.
527-
LLVM_ABI ModRefInfo getModRefInfo(const Instruction *I1, const Instruction *I2);
528+
LLVM_ABI ModRefInfo getModRefInfo(const Instruction *I1,
529+
const Instruction *I2);
528530

529531
/// Return information about whether a particular call site modifies
530532
/// or reads the specified memory location \p MemLoc before instruction \p I
@@ -549,7 +551,8 @@ class AAResults {
549551

550552
/// Check if it is possible for execution of the specified basic block to
551553
/// modify the location Loc.
552-
LLVM_ABI bool canBasicBlockModify(const BasicBlock &BB, const MemoryLocation &Loc);
554+
LLVM_ABI bool canBasicBlockModify(const BasicBlock &BB,
555+
const MemoryLocation &Loc);
553556

554557
/// A convenience wrapper synthesizing a memory location.
555558
bool canBasicBlockModify(const BasicBlock &BB, const Value *P,
@@ -562,9 +565,10 @@ class AAResults {
562565
///
563566
/// The instructions to consider are all of the instructions in the range of
564567
/// [I1,I2] INCLUSIVE. I1 and I2 must be in the same basic block.
565-
LLVM_ABI bool canInstructionRangeModRef(const Instruction &I1, const Instruction &I2,
566-
const MemoryLocation &Loc,
567-
const ModRefInfo Mode);
568+
LLVM_ABI bool canInstructionRangeModRef(const Instruction &I1,
569+
const Instruction &I2,
570+
const MemoryLocation &Loc,
571+
const ModRefInfo Mode);
568572

569573
/// A convenience wrapper synthesizing a memory location.
570574
bool canInstructionRangeModRef(const Instruction &I1, const Instruction &I2,
@@ -575,42 +579,54 @@ class AAResults {
575579

576580
// CtxI can be nullptr, in which case the query is whether or not the aliasing
577581
// relationship holds through the entire function.
578-
LLVM_ABI AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB,
579-
AAQueryInfo &AAQI, const Instruction *CtxI = nullptr);
582+
LLVM_ABI AliasResult alias(const MemoryLocation &LocA,
583+
const MemoryLocation &LocB, AAQueryInfo &AAQI,
584+
const Instruction *CtxI = nullptr);
580585

581-
LLVM_ABI ModRefInfo getModRefInfoMask(const MemoryLocation &Loc, AAQueryInfo &AAQI,
582-
bool IgnoreLocals = false);
586+
LLVM_ABI ModRefInfo getModRefInfoMask(const MemoryLocation &Loc,
587+
AAQueryInfo &AAQI,
588+
bool IgnoreLocals = false);
583589
LLVM_ABI ModRefInfo getModRefInfo(const Instruction *I, const CallBase *Call2,
584-
AAQueryInfo &AAQIP);
585-
LLVM_ABI ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc,
586-
AAQueryInfo &AAQI);
587-
LLVM_ABI ModRefInfo getModRefInfo(const CallBase *Call1, const CallBase *Call2,
588-
AAQueryInfo &AAQI);
589-
LLVM_ABI ModRefInfo getModRefInfo(const VAArgInst *V, const MemoryLocation &Loc,
590-
AAQueryInfo &AAQI);
591-
LLVM_ABI ModRefInfo getModRefInfo(const LoadInst *L, const MemoryLocation &Loc,
592-
AAQueryInfo &AAQI);
593-
LLVM_ABI ModRefInfo getModRefInfo(const StoreInst *S, const MemoryLocation &Loc,
594-
AAQueryInfo &AAQI);
595-
LLVM_ABI ModRefInfo getModRefInfo(const FenceInst *S, const MemoryLocation &Loc,
596-
AAQueryInfo &AAQI);
590+
AAQueryInfo &AAQIP);
591+
LLVM_ABI ModRefInfo getModRefInfo(const CallBase *Call,
592+
const MemoryLocation &Loc,
593+
AAQueryInfo &AAQI);
594+
LLVM_ABI ModRefInfo getModRefInfo(const CallBase *Call1,
595+
const CallBase *Call2, AAQueryInfo &AAQI);
596+
LLVM_ABI ModRefInfo getModRefInfo(const VAArgInst *V,
597+
const MemoryLocation &Loc,
598+
AAQueryInfo &AAQI);
599+
LLVM_ABI ModRefInfo getModRefInfo(const LoadInst *L,
600+
const MemoryLocation &Loc,
601+
AAQueryInfo &AAQI);
602+
LLVM_ABI ModRefInfo getModRefInfo(const StoreInst *S,
603+
const MemoryLocation &Loc,
604+
AAQueryInfo &AAQI);
605+
LLVM_ABI ModRefInfo getModRefInfo(const FenceInst *S,
606+
const MemoryLocation &Loc,
607+
AAQueryInfo &AAQI);
597608
LLVM_ABI ModRefInfo getModRefInfo(const AtomicCmpXchgInst *CX,
598-
const MemoryLocation &Loc, AAQueryInfo &AAQI);
599-
LLVM_ABI ModRefInfo getModRefInfo(const AtomicRMWInst *RMW, const MemoryLocation &Loc,
600-
AAQueryInfo &AAQI);
601-
LLVM_ABI ModRefInfo getModRefInfo(const CatchPadInst *I, const MemoryLocation &Loc,
602-
AAQueryInfo &AAQI);
603-
LLVM_ABI ModRefInfo getModRefInfo(const CatchReturnInst *I, const MemoryLocation &Loc,
604-
AAQueryInfo &AAQI);
609+
const MemoryLocation &Loc,
610+
AAQueryInfo &AAQI);
611+
LLVM_ABI ModRefInfo getModRefInfo(const AtomicRMWInst *RMW,
612+
const MemoryLocation &Loc,
613+
AAQueryInfo &AAQI);
614+
LLVM_ABI ModRefInfo getModRefInfo(const CatchPadInst *I,
615+
const MemoryLocation &Loc,
616+
AAQueryInfo &AAQI);
617+
LLVM_ABI ModRefInfo getModRefInfo(const CatchReturnInst *I,
618+
const MemoryLocation &Loc,
619+
AAQueryInfo &AAQI);
605620
LLVM_ABI ModRefInfo getModRefInfo(const Instruction *I,
606-
const std::optional<MemoryLocation> &OptLoc,
607-
AAQueryInfo &AAQIP);
608-
LLVM_ABI ModRefInfo getModRefInfo(const Instruction *I1, const Instruction *I2,
609-
AAQueryInfo &AAQI);
621+
const std::optional<MemoryLocation> &OptLoc,
622+
AAQueryInfo &AAQIP);
623+
LLVM_ABI ModRefInfo getModRefInfo(const Instruction *I1,
624+
const Instruction *I2, AAQueryInfo &AAQI);
610625
LLVM_ABI ModRefInfo callCapturesBefore(const Instruction *I,
611-
const MemoryLocation &MemLoc, DominatorTree *DT,
612-
AAQueryInfo &AAQIP);
613-
LLVM_ABI MemoryEffects getMemoryEffects(const CallBase *Call, AAQueryInfo &AAQI);
626+
const MemoryLocation &MemLoc,
627+
DominatorTree *DT, AAQueryInfo &AAQIP);
628+
LLVM_ABI MemoryEffects getMemoryEffects(const CallBase *Call,
629+
AAQueryInfo &AAQI);
614630

615631
private:
616632
class Concept;
@@ -905,7 +921,7 @@ LLVM_ABI bool isEscapeSource(const Value *V);
905921
/// to true, then the memory is only not visible if the object has not been
906922
/// captured prior to the unwind. Otherwise it is not visible even if captured.
907923
LLVM_ABI bool isNotVisibleOnUnwind(const Value *Object,
908-
bool &RequiresNoCaptureBeforeUnwind);
924+
bool &RequiresNoCaptureBeforeUnwind);
909925

910926
/// Return true if the Object is writable, in the sense that any location based
911927
/// on this pointer that can be loaded can also be stored to without trapping.
@@ -918,7 +934,8 @@ LLVM_ABI bool isNotVisibleOnUnwind(const Value *Object,
918934
/// using the dereferenceable(N) attribute. It does not necessarily hold for
919935
/// parts that are only known to be dereferenceable due to the presence of
920936
/// loads.
921-
LLVM_ABI bool isWritableObject(const Value *Object, bool &ExplicitlyDereferenceableOnly);
937+
LLVM_ABI bool isWritableObject(const Value *Object,
938+
bool &ExplicitlyDereferenceableOnly);
922939

923940
/// A manager for alias analyses.
924941
///

llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#ifndef LLVM_ANALYSIS_ALIASANALYSISEVALUATOR_H
2525
#define LLVM_ANALYSIS_ALIASANALYSISEVALUATOR_H
2626

27-
#include "llvm/Support/Compiler.h"
2827
#include "llvm/IR/PassManager.h"
28+
#include "llvm/Support/Compiler.h"
2929

3030
namespace llvm {
3131
class AAResults;

llvm/include/llvm/Analysis/AliasSetTracker.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
#ifndef LLVM_ANALYSIS_ALIASSETTRACKER_H
1919
#define LLVM_ANALYSIS_ALIASSETTRACKER_H
2020

21-
#include "llvm/Support/Compiler.h"
2221
#include "llvm/ADT/DenseMap.h"
2322
#include "llvm/ADT/SmallVector.h"
2423
#include "llvm/ADT/ilist.h"
2524
#include "llvm/ADT/ilist_node.h"
2625
#include "llvm/Analysis/MemoryLocation.h"
2726
#include "llvm/IR/PassManager.h"
2827
#include "llvm/IR/ValueHandle.h"
28+
#include "llvm/Support/Compiler.h"
2929
#include <cassert>
3030
#include <vector>
3131

@@ -114,7 +114,8 @@ class AliasSet : public ilist_node<AliasSet> {
114114
bool isForwardingAliasSet() const { return Forward; }
115115

116116
/// Merge the specified alias set into this alias set.
117-
LLVM_ABI void mergeSetIn(AliasSet &AS, AliasSetTracker &AST, BatchAAResults &BatchAA);
117+
LLVM_ABI void mergeSetIn(AliasSet &AS, AliasSetTracker &AST,
118+
BatchAAResults &BatchAA);
118119

119120
// Alias Set iteration - Allow access to all of the memory locations which are
120121
// part of this alias set.
@@ -148,10 +149,10 @@ class AliasSet : public ilist_node<AliasSet> {
148149
/// If the specified memory location "may" (or must) alias one of the members
149150
/// in the set return the appropriate AliasResult. Otherwise return NoAlias.
150151
LLVM_ABI AliasResult aliasesMemoryLocation(const MemoryLocation &MemLoc,
151-
BatchAAResults &AA) const;
152+
BatchAAResults &AA) const;
152153

153154
LLVM_ABI ModRefInfo aliasesUnknownInst(const Instruction *Inst,
154-
BatchAAResults &AA) const;
155+
BatchAAResults &AA) const;
155156
};
156157

157158
inline raw_ostream& operator<<(raw_ostream &OS, const AliasSet &AS) {
@@ -190,9 +191,11 @@ class AliasSetTracker {
190191
LLVM_ABI void add(VAArgInst *VAAI);
191192
LLVM_ABI void add(AnyMemSetInst *MSI);
192193
LLVM_ABI void add(AnyMemTransferInst *MTI);
193-
LLVM_ABI void add(Instruction *I); // Dispatch to one of the other add methods...
194-
LLVM_ABI void add(BasicBlock &BB); // Add all instructions in basic block
195-
LLVM_ABI void add(const AliasSetTracker &AST); // Add alias relations from another AST
194+
LLVM_ABI void
195+
add(Instruction *I); // Dispatch to one of the other add methods...
196+
LLVM_ABI void add(BasicBlock &BB); // Add all instructions in basic block
197+
LLVM_ABI void
198+
add(const AliasSetTracker &AST); // Add alias relations from another AST
196199
LLVM_ABI void addUnknown(Instruction *I);
197200

198201
LLVM_ABI void clear();

llvm/include/llvm/Analysis/AssumeBundleQueries.h

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
#ifndef LLVM_ANALYSIS_ASSUMEBUNDLEQUERIES_H
1515
#define LLVM_ANALYSIS_ASSUMEBUNDLEQUERIES_H
1616

17-
#include "llvm/Support/Compiler.h"
1817
#include "llvm/ADT/DenseMap.h"
1918
#include "llvm/IR/IntrinsicInst.h"
19+
#include "llvm/Support/Compiler.h"
2020

2121
namespace llvm {
2222
class AssumptionCache;
@@ -39,8 +39,9 @@ enum AssumeBundleArg {
3939
///
4040
/// Return true iff the queried attribute was found.
4141
/// If ArgVal is set. the argument will be stored to ArgVal.
42-
LLVM_ABI bool hasAttributeInAssume(AssumeInst &Assume, Value *IsOn, StringRef AttrName,
43-
uint64_t *ArgVal = nullptr);
42+
LLVM_ABI bool hasAttributeInAssume(AssumeInst &Assume, Value *IsOn,
43+
StringRef AttrName,
44+
uint64_t *ArgVal = nullptr);
4445
inline bool hasAttributeInAssume(AssumeInst &Assume, Value *IsOn,
4546
Attribute::AttrKind Kind,
4647
uint64_t *ArgVal = nullptr) {
@@ -87,7 +88,8 @@ using RetainedKnowledgeMap =
8788
/// many queries are going to be made on the same llvm.assume.
8889
/// String attributes are not inserted in the map.
8990
/// If the IR changes the map will be outdated.
90-
LLVM_ABI void fillMapFromAssume(AssumeInst &Assume, RetainedKnowledgeMap &Result);
91+
LLVM_ABI void fillMapFromAssume(AssumeInst &Assume,
92+
RetainedKnowledgeMap &Result);
9193

9294
/// Represent one information held inside an operand bundle of an llvm.assume.
9395
/// AttrKind is the property that holds.
@@ -122,7 +124,7 @@ struct RetainedKnowledge {
122124
/// Retreive the information help by Assume on the operand at index Idx.
123125
/// Assume should be an llvm.assume and Idx should be in the operand bundle.
124126
LLVM_ABI RetainedKnowledge getKnowledgeFromOperandInAssume(AssumeInst &Assume,
125-
unsigned Idx);
127+
unsigned Idx);
126128

127129
/// Retreive the information help by the Use U of an llvm.assume. the use should
128130
/// be in the operand bundle.
@@ -146,16 +148,16 @@ LLVM_ABI bool isAssumeWithEmptyBundle(const AssumeInst &Assume);
146148

147149
/// Return a valid Knowledge associated to the Use U if its Attribute kind is
148150
/// in AttrKinds.
149-
LLVM_ABI RetainedKnowledge getKnowledgeFromUse(const Use *U,
150-
ArrayRef<Attribute::AttrKind> AttrKinds);
151+
LLVM_ABI RetainedKnowledge
152+
getKnowledgeFromUse(const Use *U, ArrayRef<Attribute::AttrKind> AttrKinds);
151153

152154
/// Return a valid Knowledge associated to the Value V if its Attribute kind is
153155
/// in AttrKinds and it matches the Filter.
154156
LLVM_ABI RetainedKnowledge getKnowledgeForValue(
155157
const Value *V, ArrayRef<Attribute::AttrKind> AttrKinds,
156158
AssumptionCache *AC = nullptr,
157159
function_ref<bool(RetainedKnowledge, Instruction *,
158-
const CallBase::BundleOpInfo *)>
160+
const CallBase::BundleOpInfo *)>
159161
Filter = [](auto...) { return true; });
160162

161163
/// Return a valid Knowledge associated to the Value V if its Attribute kind is
@@ -168,8 +170,8 @@ LLVM_ABI RetainedKnowledge getKnowledgeValidInContext(
168170

169171
/// This extracts the Knowledge from an element of an operand bundle.
170172
/// This is mostly for use in the assume builder.
171-
LLVM_ABI RetainedKnowledge getKnowledgeFromBundle(AssumeInst &Assume,
172-
const CallBase::BundleOpInfo &BOI);
173+
LLVM_ABI RetainedKnowledge
174+
getKnowledgeFromBundle(AssumeInst &Assume, const CallBase::BundleOpInfo &BOI);
173175

174176
} // namespace llvm
175177

llvm/include/llvm/Analysis/AssumptionCache.h

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

18-
#include "llvm/Support/Compiler.h"
1918
#include "llvm/ADT/ArrayRef.h"
2019
#include "llvm/ADT/DenseMap.h"
2120
#include "llvm/ADT/DenseMapInfo.h"
2221
#include "llvm/ADT/SmallVector.h"
2322
#include "llvm/IR/PassManager.h"
2423
#include "llvm/IR/ValueHandle.h"
2524
#include "llvm/Pass.h"
25+
#include "llvm/Support/Compiler.h"
2626
#include <memory>
2727

2828
namespace llvm {

0 commit comments

Comments
 (0)