Skip to content

Commit bf7f91b

Browse files
committed
[Misc] NFC: Fix -Wdefaulted-function-deleted warnings
1 parent af13914 commit bf7f91b

File tree

8 files changed

+27
-14
lines changed

8 files changed

+27
-14
lines changed

include/swift/AST/RawComment.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ struct SingleRawComment {
2626
BlockDoc, ///< \code /** stuff */ \endcode
2727
};
2828

29-
const CharSourceRange Range;
30-
const StringRef RawText;
29+
CharSourceRange Range;
30+
StringRef RawText;
3131

3232
unsigned Kind : 8;
3333
unsigned StartColumn : 16;

include/swift/Basic/SourceLoc.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ class CharSourceRange {
130130

131131
public:
132132
/// \brief Constructs an invalid range.
133-
CharSourceRange() {}
133+
CharSourceRange() = default;
134+
135+
CharSourceRange &operator=(const CharSourceRange &) = default;
134136

135137
CharSourceRange(SourceLoc Start, unsigned ByteLength)
136138
: Start(Start), ByteLength(ByteLength) {}

include/swift/Basic/TreeScopedHashTable.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ template <typename K, typename V> class TreeScopedHashTableVal {
3737
TreeScopedHashTableVal(const K &Key, const V &Val) : Key(Key), Val(Val) {}
3838

3939
public:
40+
TreeScopedHashTableVal(const TreeScopedHashTableVal &) = delete;
41+
TreeScopedHashTableVal(TreeScopedHashTableVal &&) = delete;
42+
TreeScopedHashTableVal &operator=(const TreeScopedHashTableVal &) = delete;
43+
TreeScopedHashTableVal &operator=(TreeScopedHashTableVal &&) = delete;
44+
4045
const K &getKey() const { return Key; }
4146
const V &getValue() const { return Val; }
4247
V &getValue() { return Val; }
@@ -144,6 +149,11 @@ class TreeScopedHashTableDetachedScope {
144149
const ImplTy *getImpl() { return DetachedImpl; }
145150

146151
public:
152+
TreeScopedHashTableDetachedScope &operator=(
153+
const TreeScopedHashTableDetachedScope &) = default;
154+
TreeScopedHashTableDetachedScope &operator=(
155+
TreeScopedHashTableDetachedScope &&) = default;
156+
147157
TreeScopedHashTableDetachedScope() : DetachedImpl(0) {}
148158

149159
TreeScopedHashTableDetachedScope(TreeScopedHashTableDetachedScope &&Other)

include/swift/SIL/Projection.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -835,10 +835,10 @@ class ProjectionTreeNode {
835835
class ProjectionTree {
836836
friend class ProjectionTreeNode;
837837

838-
SILModule &Mod;
838+
SILModule *Mod;
839839

840840
/// The allocator we use to allocate ProjectionTreeNodes in the tree.
841-
llvm::SpecificBumpPtrAllocator<ProjectionTreeNode> &Allocator;
841+
llvm::SpecificBumpPtrAllocator<ProjectionTreeNode> *Allocator;
842842

843843
// A common pattern is a 3 field struct.
844844
llvm::SmallVector<ProjectionTreeNode *, 4> ProjectionTreeNodes;
@@ -854,7 +854,7 @@ class ProjectionTree {
854854
/// initialized by initializeWithExistingTree.
855855
ProjectionTree(SILModule &Mod,
856856
llvm::SpecificBumpPtrAllocator<ProjectionTreeNode> &Allocator)
857-
: Mod(Mod), Allocator(Allocator) {}
857+
: Mod(&Mod), Allocator(&Allocator) {}
858858
~ProjectionTree();
859859
ProjectionTree(const ProjectionTree &) = delete;
860860
ProjectionTree(ProjectionTree &&) = default;
@@ -876,7 +876,7 @@ class ProjectionTree {
876876
LeafValueMapTy &LeafValues);
877877

878878
/// Return the module associated with this tree.
879-
SILModule &getModule() const { return Mod; }
879+
SILModule &getModule() const { return *Mod; }
880880

881881
llvm::ArrayRef<ProjectionTreeNode *> getProjectionTreeNodes() {
882882
return llvm::makeArrayRef(ProjectionTreeNodes);
@@ -960,16 +960,16 @@ class ProjectionTree {
960960
void createRoot(SILType BaseTy) {
961961
assert(ProjectionTreeNodes.empty() &&
962962
"Should only create root when ProjectionTreeNodes is empty");
963-
auto *Node = new (Allocator.Allocate()) ProjectionTreeNode(BaseTy);
963+
auto *Node = new (Allocator->Allocate()) ProjectionTreeNode(BaseTy);
964964
ProjectionTreeNodes.push_back(Node);
965965
}
966966

967967
ProjectionTreeNode *createChild(ProjectionTreeNode *Parent,
968968
SILType BaseTy,
969969
const Projection &P) {
970970
unsigned Index = ProjectionTreeNodes.size();
971-
auto *Node = new (Allocator.Allocate()) ProjectionTreeNode(Parent, Index,
972-
BaseTy, P);
971+
auto *Node = new (Allocator->Allocate()) ProjectionTreeNode(Parent, Index,
972+
BaseTy, P);
973973
ProjectionTreeNodes.push_back(Node);
974974
return ProjectionTreeNodes[Index];
975975
}

lib/SIL/Projection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ class NewAggregateBuilderMap {
11271127
ProjectionTree::ProjectionTree(
11281128
SILModule &Mod, SILType BaseTy,
11291129
llvm::SpecificBumpPtrAllocator<ProjectionTreeNode> &Allocator)
1130-
: Mod(Mod), Allocator(Allocator) {
1130+
: Mod(&Mod), Allocator(&Allocator) {
11311131
LLVM_DEBUG(llvm::dbgs() << "Constructing Projection Tree For : " << BaseTy
11321132
<< "\n");
11331133

lib/SILGen/LValue.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,6 @@ struct LLVM_LIBRARY_VISIBILITY ExclusiveBorrowFormalAccess : FormalAccess {
524524
ExclusiveBorrowFormalAccess &
525525
operator=(ExclusiveBorrowFormalAccess &&) = default;
526526

527-
ExclusiveBorrowFormalAccess() = default;
528527
ExclusiveBorrowFormalAccess(SILLocation loc,
529528
std::unique_ptr<LogicalPathComponent> &&comp,
530529
ManagedValue base,

lib/SILGen/SILGenApply.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ class Callee {
283283
DynamicMethod,
284284
};
285285

286-
const Kind kind;
286+
Kind kind;
287287

288288
// Move, don't copy.
289289
Callee(const Callee &) = delete;

lib/SILOptimizer/Transforms/RedundantLoadElimination.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,9 @@ class RLEContext {
494494
EpilogueARCFunctionInfo *EAFI, bool disableArrayLoads);
495495

496496
RLEContext(const RLEContext &) = delete;
497-
RLEContext(RLEContext &&) = default;
497+
RLEContext(RLEContext &&) = delete;
498+
RLEContext &operator=(const RLEContext &) = delete;
499+
RLEContext &operator=(RLEContext &&) = delete;
498500
~RLEContext() = default;
499501

500502
/// Entry point to redundant load elimination.

0 commit comments

Comments
 (0)