Skip to content

Commit 851d9f4

Browse files
committed
[Gardening] Minor cleanup to Projection.h.
Replaced some namespace qualified references to ArrayRef and Optional with the unqualified type. Reordered the includes per clang-format. Excerpted from @GottesM's #16756.
1 parent 27fe849 commit 851d9f4

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

include/swift/SIL/Projection.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@
2222
#ifndef SWIFT_SIL_PROJECTION_H
2323
#define SWIFT_SIL_PROJECTION_H
2424

25+
#include "swift/AST/TypeAlignments.h"
2526
#include "swift/Basic/NullablePtr.h"
2627
#include "swift/Basic/PointerIntEnum.h"
27-
#include "swift/AST/TypeAlignments.h"
28-
#include "swift/SIL/SILValue.h"
28+
#include "swift/Basic/STLExtras.h"
2929
#include "swift/SIL/SILInstruction.h"
30+
#include "swift/SIL/SILValue.h"
3031
#include "swift/SILOptimizer/Analysis/ARCAnalysis.h"
3132
#include "swift/SILOptimizer/Analysis/RCIdentityAnalysis.h"
3233
#include "llvm/ADT/Hashing.h"
@@ -751,18 +752,18 @@ class ProjectionTreeNode {
751752
~ProjectionTreeNode() = default;
752753
ProjectionTreeNode(const ProjectionTreeNode &) = default;
753754

754-
llvm::ArrayRef<unsigned> getChildProjections() {
755-
return llvm::makeArrayRef(ChildProjections);
755+
bool isLeaf() const { return ChildProjections.empty(); }
756+
757+
ArrayRef<unsigned> getChildProjections() const {
758+
return llvm::makeArrayRef(ChildProjections);
756759
}
757760

758-
llvm::Optional<Projection> &getProjection() { return Proj; }
761+
Optional<Projection> &getProjection() { return Proj; }
759762

760763
const ArrayRef<Operand *> getNonProjUsers() const {
761764
return llvm::makeArrayRef(NonProjUsers);
762765
}
763766

764-
bool isLeaf() const { return ChildProjections.empty(); }
765-
766767
SILType getType() const { return NodeType; }
767768

768769
bool isRoot() const {

0 commit comments

Comments
 (0)