Skip to content

Commit 2391a1a

Browse files
committed
clang format
1 parent 92e1937 commit 2391a1a

Some content is hidden

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

71 files changed

+1484
-1216
lines changed

llvm/include/llvm/Analysis/AliasAnalysis.h

Lines changed: 57 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class EarliestEscapeAnalysis final : public CaptureAnalysis {
194194
LLVM_ABI ~EarliestEscapeAnalysis() = default;
195195

196196
LLVM_ABI bool isNotCapturedBefore(const Value *Object, const Instruction *I,
197-
bool OrAt) override;
197+
bool OrAt) override;
198198

199199
LLVM_ABI void removeInstruction(Instruction *I);
200200
};
@@ -344,7 +344,7 @@ class AAResults {
344344
/// The aggregation is invalidated if any of the underlying analyses is
345345
/// invalidated.
346346
LLVM_ABI bool invalidate(Function &F, const PreservedAnalyses &PA,
347-
FunctionAnalysisManager::Invalidator &Inv);
347+
FunctionAnalysisManager::Invalidator &Inv);
348348

349349
//===--------------------------------------------------------------------===//
350350
/// \name Alias Queries
@@ -354,7 +354,8 @@ class AAResults {
354354
/// Returns an AliasResult indicating whether the two pointers are aliased to
355355
/// each other. This is the interface that must be implemented by specific
356356
/// alias analysis implementations.
357-
LLVM_ABI AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB);
357+
LLVM_ABI AliasResult alias(const MemoryLocation &LocA,
358+
const MemoryLocation &LocB);
358359

359360
/// A convenience wrapper around the primary \c alias interface.
360361
AliasResult alias(const Value *V1, LocationSize V1Size, const Value *V2,
@@ -423,7 +424,7 @@ class AAResults {
423424
/// If IgnoreLocals is true, then this method returns NoModRef for memory
424425
/// that points to a local alloca.
425426
LLVM_ABI ModRefInfo getModRefInfoMask(const MemoryLocation &Loc,
426-
bool IgnoreLocals = false);
427+
bool IgnoreLocals = false);
427428

428429
/// A convenience wrapper around the primary \c getModRefInfoMask
429430
/// interface.
@@ -553,7 +554,8 @@ class AAResults {
553554

554555
/// Check if it is possible for execution of the specified basic block to
555556
/// modify the location Loc.
556-
LLVM_ABI bool canBasicBlockModify(const BasicBlock &BB, const MemoryLocation &Loc);
557+
LLVM_ABI bool canBasicBlockModify(const BasicBlock &BB,
558+
const MemoryLocation &Loc);
557559

558560
/// A convenience wrapper synthesizing a memory location.
559561
bool canBasicBlockModify(const BasicBlock &BB, const Value *P,
@@ -566,9 +568,10 @@ class AAResults {
566568
///
567569
/// The instructions to consider are all of the instructions in the range of
568570
/// [I1,I2] INCLUSIVE. I1 and I2 must be in the same basic block.
569-
LLVM_ABI bool canInstructionRangeModRef(const Instruction &I1, const Instruction &I2,
570-
const MemoryLocation &Loc,
571-
const ModRefInfo Mode);
571+
LLVM_ABI bool canInstructionRangeModRef(const Instruction &I1,
572+
const Instruction &I2,
573+
const MemoryLocation &Loc,
574+
const ModRefInfo Mode);
572575

573576
/// A convenience wrapper synthesizing a memory location.
574577
bool canInstructionRangeModRef(const Instruction &I1, const Instruction &I2,
@@ -579,42 +582,54 @@ class AAResults {
579582

580583
// CtxI can be nullptr, in which case the query is whether or not the aliasing
581584
// relationship holds through the entire function.
582-
LLVM_ABI AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB,
583-
AAQueryInfo &AAQI, const Instruction *CtxI = nullptr);
585+
LLVM_ABI AliasResult alias(const MemoryLocation &LocA,
586+
const MemoryLocation &LocB, AAQueryInfo &AAQI,
587+
const Instruction *CtxI = nullptr);
584588

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

619634
private:
620635
class Concept;
@@ -909,7 +924,7 @@ LLVM_ABI bool isEscapeSource(const Value *V);
909924
/// to true, then the memory is only not visible if the object has not been
910925
/// captured prior to the unwind. Otherwise it is not visible even if captured.
911926
LLVM_ABI bool isNotVisibleOnUnwind(const Value *Object,
912-
bool &RequiresNoCaptureBeforeUnwind);
927+
bool &RequiresNoCaptureBeforeUnwind);
913928

914929
/// Return true if the Object is writable, in the sense that any location based
915930
/// on this pointer that can be loaded can also be stored to without trapping.
@@ -922,7 +937,8 @@ LLVM_ABI bool isNotVisibleOnUnwind(const Value *Object,
922937
/// using the dereferenceable(N) attribute. It does not necessarily hold for
923938
/// parts that are only known to be dereferenceable due to the presence of
924939
/// loads.
925-
LLVM_ABI bool isWritableObject(const Value *Object, bool &ExplicitlyDereferenceableOnly);
940+
LLVM_ABI bool isWritableObject(const Value *Object,
941+
bool &ExplicitlyDereferenceableOnly);
926942

927943
/// A manager for alias analyses.
928944
///

llvm/include/llvm/Analysis/AliasSetTracker.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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/BasicAliasAnalysis.h

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,18 @@ class BasicAAResult : public AAResultBase {
6767

6868
/// Handle invalidation events in the new pass manager.
6969
LLVM_ABI bool invalidate(Function &Fn, const PreservedAnalyses &PA,
70-
FunctionAnalysisManager::Invalidator &Inv);
70+
FunctionAnalysisManager::Invalidator &Inv);
7171

72-
LLVM_ABI AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB,
73-
AAQueryInfo &AAQI, const Instruction *CtxI);
72+
LLVM_ABI AliasResult alias(const MemoryLocation &LocA,
73+
const MemoryLocation &LocB, AAQueryInfo &AAQI,
74+
const Instruction *CtxI);
7475

75-
LLVM_ABI ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc,
76-
AAQueryInfo &AAQI);
76+
LLVM_ABI ModRefInfo getModRefInfo(const CallBase *Call,
77+
const MemoryLocation &Loc,
78+
AAQueryInfo &AAQI);
7779

78-
LLVM_ABI ModRefInfo getModRefInfo(const CallBase *Call1, const CallBase *Call2,
79-
AAQueryInfo &AAQI);
80+
LLVM_ABI ModRefInfo getModRefInfo(const CallBase *Call1,
81+
const CallBase *Call2, AAQueryInfo &AAQI);
8082

8183
/// Returns a bitmask that should be unconditionally applied to the ModRef
8284
/// info of a memory location. This allows us to eliminate Mod and/or Ref
@@ -85,14 +87,16 @@ class BasicAAResult : public AAResultBase {
8587
///
8688
/// If IgnoreLocals is true, then this method returns NoModRef for memory
8789
/// that points to a local alloca.
88-
LLVM_ABI ModRefInfo getModRefInfoMask(const MemoryLocation &Loc, AAQueryInfo &AAQI,
89-
bool IgnoreLocals = false);
90+
LLVM_ABI ModRefInfo getModRefInfoMask(const MemoryLocation &Loc,
91+
AAQueryInfo &AAQI,
92+
bool IgnoreLocals = false);
9093

9194
/// Get the location associated with a pointer argument of a callsite.
9295
LLVM_ABI ModRefInfo getArgModRefInfo(const CallBase *Call, unsigned ArgIdx);
9396

9497
/// Returns the behavior when calling the given call site.
95-
LLVM_ABI MemoryEffects getMemoryEffects(const CallBase *Call, AAQueryInfo &AAQI);
98+
LLVM_ABI MemoryEffects getMemoryEffects(const CallBase *Call,
99+
AAQueryInfo &AAQI);
96100

97101
/// Returns the behavior when calling the given function. For use when the
98102
/// call site is not known.

0 commit comments

Comments
 (0)