Remove the explicit SDNodeIterator::operator= in favor of the implicit default
authorDavid Blaikie <dblaikie@gmail.com>
Tue, 3 Mar 2015 21:17:08 +0000 (21:17 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Tue, 3 Mar 2015 21:17:08 +0000 (21:17 +0000)
There doesn't seem to be any need to assert that iterator assignment is
between iterators over the same node - if you want to reuse an iterator
variable to iterate another node, that's perfectly acceptable. Just
don't mix comparisons between iterators into disjoint sequences, as
usual.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231135 91177308-0d34-0410-b5e6-96231b3b80d8

23 files changed:
include/llvm/Analysis/CallGraph.h
include/llvm/Analysis/IntervalIterator.h
include/llvm/Analysis/RegionIterator.h
include/llvm/CodeGen/LiveInterval.h
include/llvm/CodeGen/SelectionDAGNodes.h
include/llvm/IR/CFG.h
include/llvm/IR/ValueHandle.h
include/llvm/MC/MCContext.h
include/llvm/Support/CommandLine.h
include/llvm/Support/Format.h
include/llvm/Support/YAMLParser.h
lib/Analysis/CFLAliasAnalysis.cpp
lib/AsmParser/LLParser.cpp
lib/AsmParser/LLParser.h
lib/CodeGen/LiveInterval.cpp
lib/CodeGen/LiveStackAnalysis.cpp
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/Target/AArch64/AArch64PBQPRegAlloc.cpp
lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
tools/llvm-diff/DiffLog.h
unittests/ADT/DenseMapTest.cpp
unittests/ADT/ilistTest.cpp
utils/TableGen/AsmMatcherEmitter.cpp

index 64d288a2bb5d13ce93eec5db838f20f2c7fef1f3..19bcf8e23e022cbc1996cfd097fbe62f3b5785eb 100644 (file)
@@ -104,6 +104,12 @@ class CallGraph {
 
 public:
   CallGraph(Module &M);
+  // Copyable for syntax's sake, but rely on RVO such that this is never called.
+  // Should really make this type legitimately movable instead, possibly my
+  // making FunctionMap values and the CallsExternalCode member unique_ptrs,
+  // then adding some internal helper objects that can call
+  // "allReferencesDropped" on those elements before their final destruction.
+  CallGraph(const CallGraph&); 
   ~CallGraph();
 
   void print(raw_ostream &OS) const;
index ab70ad91b841cde220c6ccbc9ebd2c871d08fa44..125195dde023179493cdf697e8f7e6447a75c36b 100644 (file)
@@ -104,6 +104,8 @@ public:
       llvm_unreachable("ProcessInterval should never fail for first interval!");
     }
   }
+  // Declare but don't define, rely on RVO to optimize this away.
+  IntervalIterator(const IntervalIterator&);
 
   IntervalIterator(IntervalPartition &IP, bool OwnMemory) : IOwnMem(OwnMemory) {
     OrigContainer = &IP;
index 0daff58475dd8baa2afeb0560df9486c635593eb..220c60355680807dd3e28a4f413f96ba9bdc70dd 100644 (file)
@@ -146,6 +146,8 @@ public:
     return tmp;
   }
 
+  RNSuccIterator(const RNSuccIterator&) = default;
+
   inline const Self &operator=(const Self &I) {
     if (this != &I) {
       assert(getNode()->getParent() == I.getNode()->getParent()
@@ -241,6 +243,8 @@ public:
     return tmp;
   }
 
+  RNSuccIterator(const RNSuccIterator&) = default;
+
   inline const Self &operator=(const Self &I) {
     if (this != &I) {
       assert(Node->getParent() == I.Node->getParent()
index 21634cbd1551584df88c2ab760832afa581e8c16..9b8b91c9b80e23ea7f00e08d168c6b5a8db1ce56 100644 (file)
@@ -199,7 +199,7 @@ namespace llvm {
     // of live ranges of physical registers in computeRegUnitRange.
     // After that the set is flushed to the segment vector and deleted.
     typedef std::set<Segment> SegmentSet;
-    SegmentSet *segmentSet;
+    std::unique_ptr<SegmentSet> segmentSet;
 
     typedef Segments::iterator iterator;
     iterator begin() { return segments.begin(); }
@@ -218,15 +218,13 @@ namespace llvm {
     const_vni_iterator vni_end() const   { return valnos.end(); }
 
     /// Constructs a new LiveRange object.
-    LiveRange(bool UseSegmentSet = false) : segmentSet(nullptr) {
-      if (UseSegmentSet)
-        segmentSet = new SegmentSet();
-    }
+    LiveRange(bool UseSegmentSet = false)
+        : segmentSet(UseSegmentSet ? llvm::make_unique<SegmentSet>()
+                                   : nullptr) {}
 
     /// Constructs a new LiveRange object by copying segments and valnos from
     /// another LiveRange.
-    LiveRange(const LiveRange &Other, BumpPtrAllocator &Allocator)
-        : segmentSet(nullptr) {
+    LiveRange(const LiveRange &Other, BumpPtrAllocator &Allocator) {
       assert(Other.segmentSet == nullptr &&
              "Copying of LiveRanges with active SegmentSets is not supported");
 
@@ -240,8 +238,6 @@ namespace llvm {
       }
     }
 
-    ~LiveRange() { delete segmentSet; }
-
     /// advanceTo - Advance the specified iterator to point to the Segment
     /// containing the specified position, or end() if the position is past the
     /// end of the range.  If no Segment contains this position, but the
@@ -745,8 +741,6 @@ namespace llvm {
 #endif
 
   private:
-    LiveInterval& operator=(const LiveInterval& rhs) = delete;
-
     /// Appends @p Range to SubRanges list.
     void appendSubRange(SubRange *Range) {
       Range->Next = SubRanges;
index 0b6240f790482f814ea3e2ca5f8757e8efed864c..5ceeb74dbb2f6992ff374e2af3458eb43af29893 100644 (file)
@@ -2063,12 +2063,6 @@ public:
   }
   bool operator!=(const SDNodeIterator& x) const { return !operator==(x); }
 
-  const SDNodeIterator &operator=(const SDNodeIterator &I) {
-    assert(I.Node == Node && "Cannot assign iterators to two different nodes!");
-    Operand = I.Operand;
-    return *this;
-  }
-
   pointer operator*() const {
     return Node->getOperand(Operand).getNode();
   }
index 847643176339c565874af73994382a74f8e56e6e..9d4ee83bc79d2092dbd543252924913fecb0b92d 100644 (file)
@@ -132,11 +132,13 @@ private:
   /// \brief Proxy object to allow write access in operator[]
   class SuccessorProxy {
     Self it;
+    friend class SuccIterator;
+    SuccessorProxy(const SuccessorProxy&) = default;
 
   public:
     explicit SuccessorProxy(const Self &it) : it(it) {}
 
-    SuccessorProxy &operator=(SuccessorProxy r) {
+    SuccessorProxy &operator=(const SuccessorProxy &r) {
       *this = reference(r);
       return *this;
     }
@@ -165,6 +167,8 @@ public:
       idx = 0;
   }
 
+  SuccIterator(const SuccIterator&) = default;
+
   inline const Self &operator=(const Self &I) {
     assert(Term == I.Term &&"Cannot assign iterators to two different blocks!");
     idx = I.idx;
index 355748e059770b46c86df92a643d309f36850f8f..e3c9d3e1e592d569f0103edf77fca87e28069f5c 100644 (file)
@@ -51,6 +51,7 @@ protected:
     Tracking,
     Weak
   };
+  ValueHandleBase(const ValueHandleBase&) = default;
 
 private:
   PointerIntPair<ValueHandleBase**, 2, HandleBaseKind> PrevPair;
@@ -58,7 +59,6 @@ private:
 
   Value* V;
 
-  ValueHandleBase(const ValueHandleBase&) = delete;
 public:
   explicit ValueHandleBase(HandleBaseKind Kind)
     : PrevPair(nullptr, Kind), Next(nullptr), V(nullptr) {}
@@ -144,6 +144,10 @@ public:
   WeakVH(Value *P) : ValueHandleBase(Weak, P) {}
   WeakVH(const WeakVH &RHS)
     : ValueHandleBase(Weak, RHS) {}
+  // Questionable - these are stored in a vector in AssumptionCache (perhaps
+  // other copies too) and need to be copied. When copied, how would they
+  // properly insert into the use list?
+  WeakVH&operator=(const WeakVH &RHS) = default;
 
   Value *operator=(Value *RHS) {
     return ValueHandleBase::operator=(RHS);
@@ -345,7 +349,8 @@ protected:
   CallbackVH(const CallbackVH &RHS)
     : ValueHandleBase(Callback, RHS) {}
 
-  virtual ~CallbackVH() {}
+  virtual ~CallbackVH() = default;
+  CallbackVH &operator=(const CallbackVH &) = default;
 
   void setValPtr(Value *P) {
     ValueHandleBase::operator=(P);
index 0a977445925964f830152bceda8404c89f9ed87a..13c6704d77c3b6f07d9a65b407f57c67ffad4875 100644 (file)
@@ -477,7 +477,7 @@ namespace llvm {
 ///                  allocator supports it).
 /// @return The allocated memory. Could be NULL.
 inline void *operator new(size_t Bytes, llvm::MCContext &C,
-                          size_t Alignment = 16) throw () {
+                          size_t Alignment = 16) LLVM_NOEXCEPT {
   return C.Allocate(Bytes, Alignment);
 }
 /// @brief Placement delete companion to the new above.
@@ -487,7 +487,7 @@ inline void *operator new(size_t Bytes, llvm::MCContext &C,
 /// is called implicitly by the compiler if a placement new expression using
 /// the MCContext throws in the object constructor.
 inline void operator delete(void *Ptr, llvm::MCContext &C, size_t)
-              throw () {
+              LLVM_NOEXCEPT {
   C.Deallocate(Ptr);
 }
 
@@ -511,7 +511,7 @@ inline void operator delete(void *Ptr, llvm::MCContext &C, size_t)
 ///                  allocator supports it).
 /// @return The allocated memory. Could be NULL.
 inline void *operator new[](size_t Bytes, llvm::MCContext& C,
-                            size_t Alignment = 16) throw () {
+                            size_t Alignment = 16) LLVM_NOEXCEPT {
   return C.Allocate(Bytes, Alignment);
 }
 
@@ -521,7 +521,7 @@ inline void *operator new[](size_t Bytes, llvm::MCContext& C,
 /// invoking it directly; see the new[] operator for more details. This operator
 /// is called implicitly by the compiler if a placement new[] expression using
 /// the MCContext throws in the object constructor.
-inline void operator delete[](void *Ptr, llvm::MCContext &C) throw () {
+inline void operator delete[](void *Ptr, llvm::MCContext &C) LLVM_NOEXCEPT {
   C.Deallocate(Ptr);
 }
 
index 64c5d963d2c9db6b0c7a37f4c64e6a92dbf038b5..797b30d33e3029f62e8f692626e2121c7969ccfa 100644 (file)
@@ -352,9 +352,13 @@ struct cat {
 
 // Support value comparison outside the template.
 struct GenericOptionValue {
-  virtual ~GenericOptionValue() {}
+  virtual ~GenericOptionValue() = default;
   virtual bool compare(const GenericOptionValue &V) const = 0;
 
+protected:
+  GenericOptionValue() = default;
+  GenericOptionValue(const GenericOptionValue&) = default;
+  GenericOptionValue &operator=(const GenericOptionValue &) = default;
 private:
   virtual void anchor();
 };
@@ -386,6 +390,9 @@ struct OptionValueBase : public GenericOptionValue {
 template <class DataType> class OptionValueCopy : public GenericOptionValue {
   DataType Value;
   bool Valid;
+protected:
+  OptionValueCopy(const OptionValueCopy&) = default;
+  OptionValueCopy &operator=(const OptionValueCopy&) = default;
 
 public:
   OptionValueCopy() : Valid(false) {}
@@ -417,6 +424,10 @@ public:
 template <class DataType>
 struct OptionValueBase<DataType, false> : OptionValueCopy<DataType> {
   typedef DataType WrapperType;
+protected:
+  OptionValueBase() = default;
+  OptionValueBase(const OptionValueBase&) = default;
+  OptionValueBase &operator=(const OptionValueBase&) = default;
 };
 
 // Top-level option class.
@@ -721,6 +732,8 @@ public:
   virtual void anchor();
 
 protected:
+  basic_parser_impl(const basic_parser_impl&) = default;
+
   // A helper for basic_parser::printOptionDiff.
   void printOptionName(const Option &O, size_t GlobalWidth) const;
 };
@@ -729,6 +742,9 @@ protected:
 // a typedef for the provided data type.
 //
 template <class DataType> class basic_parser : public basic_parser_impl {
+protected:
+  // Workaround PR22763
+  basic_parser(const basic_parser& RHS) : basic_parser_impl(RHS) {}
 public:
   basic_parser(Option &O) : basic_parser_impl(O) {}
   typedef DataType parser_data_type;
@@ -738,7 +754,7 @@ public:
 //--------------------------------------------------
 // parser<bool>
 //
-template <> class parser<bool> : public basic_parser<bool> {
+template <> class parser<bool> final : public basic_parser<bool> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -765,7 +781,7 @@ EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<bool>);
 
 //--------------------------------------------------
 // parser<boolOrDefault>
-template <> class parser<boolOrDefault> : public basic_parser<boolOrDefault> {
+template <> class parser<boolOrDefault> final : public basic_parser<boolOrDefault> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -791,7 +807,7 @@ EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<boolOrDefault>);
 //--------------------------------------------------
 // parser<int>
 //
-template <> class parser<int> : public basic_parser<int> {
+template <> class parser<int> final : public basic_parser<int> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -813,7 +829,7 @@ EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<int>);
 //--------------------------------------------------
 // parser<unsigned>
 //
-template <> class parser<unsigned> : public basic_parser<unsigned> {
+template <> class parser<unsigned> final : public basic_parser<unsigned> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -836,7 +852,7 @@ EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<unsigned>);
 // parser<unsigned long long>
 //
 template <>
-class parser<unsigned long long> : public basic_parser<unsigned long long> {
+class parser<unsigned long long> final : public basic_parser<unsigned long long> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -859,7 +875,7 @@ EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<unsigned long long>);
 //--------------------------------------------------
 // parser<double>
 //
-template <> class parser<double> : public basic_parser<double> {
+template <> class parser<double> final : public basic_parser<double> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -881,7 +897,7 @@ EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<double>);
 //--------------------------------------------------
 // parser<float>
 //
-template <> class parser<float> : public basic_parser<float> {
+template <> class parser<float> final : public basic_parser<float> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -903,7 +919,7 @@ EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<float>);
 //--------------------------------------------------
 // parser<std::string>
 //
-template <> class parser<std::string> : public basic_parser<std::string> {
+template <> class parser<std::string> final : public basic_parser<std::string> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -928,7 +944,7 @@ EXTERN_TEMPLATE_INSTANTIATION(class basic_parser<std::string>);
 //--------------------------------------------------
 // parser<char>
 //
-template <> class parser<char> : public basic_parser<char> {
+template <> class parser<char> final : public basic_parser<char> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
index 682c5a99161470502425c354d769d1cc6f01ebb1..0bb8cbbc6e6074502b19e904819e03d133bac418 100644 (file)
@@ -38,6 +38,7 @@ class format_object_base {
 protected:
   const char *Fmt;
   ~format_object_base() {} // Disallow polymorphic deletion.
+  format_object_base(const format_object_base&) = default;
   virtual void home(); // Out of line virtual method.
 
   /// Call snprintf() for this object, on the given buffer and size.
index de6e6544e25b9f5022a459c805b9fa482c8d6e0c..019ec7b2446ac5a9ca276de09634dda64acec13b 100644 (file)
@@ -145,11 +145,11 @@ public:
   unsigned int getType() const { return TypeID; }
 
   void *operator new(size_t Size, BumpPtrAllocator &Alloc,
-                     size_t Alignment = 16) throw() {
+                     size_t Alignment = 16) LLVM_NOEXCEPT {
     return Alloc.Allocate(Size, Alignment);
   }
 
-  void operator delete(void *Ptr, BumpPtrAllocator &Alloc, size_t Size) throw() {
+  void operator delete(void *Ptr, BumpPtrAllocator &Alloc, size_t Size) LLVM_NOEXCEPT {
     Alloc.Deallocate(Ptr, Size);
   }
 
@@ -157,7 +157,7 @@ protected:
   std::unique_ptr<Document> &Doc;
   SMRange SourceRange;
 
-  void operator delete(void *) throw() {}
+  void operator delete(void *) LLVM_NOEXCEPT {}
 
   virtual ~Node() {}
 
index 82fbfe06aee931867945c081870b52747e98e884..cf92bfeca1098826f33a07995c9ee900673afd24 100644 (file)
@@ -151,15 +151,13 @@ struct FunctionInfo {
 
 struct CFLAliasAnalysis;
 
-struct FunctionHandle : public CallbackVH {
+struct FunctionHandle final : public CallbackVH {
   FunctionHandle(Function *Fn, CFLAliasAnalysis *CFLAA)
       : CallbackVH(Fn), CFLAA(CFLAA) {
     assert(Fn != nullptr);
     assert(CFLAA != nullptr);
   }
 
-  virtual ~FunctionHandle() {}
-
   void deleted() override { removeSelfFromCache(); }
   void allUsesReplacedWith(Value *) override { removeSelfFromCache(); }
 
index 925af4e17e13097a280fc45c79bc6a799ead89f3..eab00cbaaa46e8951778e3932bd78059760009cd 100644 (file)
@@ -2365,9 +2365,9 @@ bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) {
         ParseToken(lltok::rbrace, "expected end of struct constant"))
       return true;
 
-    ID.ConstantStructElts = new Constant*[Elts.size()];
+    ID.ConstantStructElts.reset(new Constant*[Elts.size()]);
     ID.UIntVal = Elts.size();
-    memcpy(ID.ConstantStructElts, Elts.data(), Elts.size()*sizeof(Elts[0]));
+    memcpy(ID.ConstantStructElts.get(), Elts.data(), Elts.size()*sizeof(Elts[0]));
     ID.Kind = ValID::t_ConstantStruct;
     return false;
   }
@@ -2386,8 +2386,8 @@ bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) {
       return true;
 
     if (isPackedStruct) {
-      ID.ConstantStructElts = new Constant*[Elts.size()];
-      memcpy(ID.ConstantStructElts, Elts.data(), Elts.size()*sizeof(Elts[0]));
+      ID.ConstantStructElts.reset(new Constant*[Elts.size()]);
+      memcpy(ID.ConstantStructElts.get(), Elts.data(), Elts.size()*sizeof(Elts[0]));
       ID.UIntVal = Elts.size();
       ID.Kind = ValID::t_PackedConstantStruct;
       return false;
@@ -2512,7 +2512,12 @@ bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) {
 
     if (!F) {
       // Make a global variable as a placeholder for this reference.
-      GlobalValue *&FwdRef = ForwardRefBlockAddresses[Fn][Label];
+      GlobalValue *&FwdRef =
+          ForwardRefBlockAddresses.insert(std::make_pair(
+                                              std::move(Fn),
+                                              std::map<ValID, GlobalValue *>()))
+              .first->second.insert(std::make_pair(std::move(Label), nullptr))
+              .first->second;
       if (!FwdRef)
         FwdRef = new GlobalVariable(*M, Type::getInt8Ty(Context), false,
                                     GlobalValue::InternalLinkage, nullptr, "");
@@ -3942,8 +3947,8 @@ bool LLParser::ConvertValIDToValue(Type *Ty, ValID &ID, Value *&V,
           return Error(ID.Loc, "element " + Twine(i) +
                     " of struct initializer doesn't match struct element type");
 
-      V = ConstantStruct::get(ST, makeArrayRef(ID.ConstantStructElts,
-                                               ID.UIntVal));
+      V = ConstantStruct::get(
+          ST, makeArrayRef(ID.ConstantStructElts.get(), ID.UIntVal));
     } else
       return Error(ID.Loc, "constant expression type mismatch");
     return false;
index 5e92e570e7267c5025d72d50bc7af98f2192c9db..3675d958323a9bb08fb00f9620fe4910bbe3d5cc 100644 (file)
@@ -62,13 +62,9 @@ namespace llvm {
     APSInt APSIntVal;
     APFloat APFloatVal;
     Constant *ConstantVal;
-    Constant **ConstantStructElts;
+    std::unique_ptr<Constant*[]> ConstantStructElts;
 
     ValID() : Kind(t_LocalID), APFloatVal(0.0) {}
-    ~ValID() {
-      if (Kind == t_ConstantStruct || Kind == t_PackedConstantStruct)
-        delete [] ConstantStructElts;
-    }
 
     bool operator<(const ValID &RHS) const {
       if (Kind == t_LocalID || Kind == t_GlobalID)
index d60b0b1a50409ff69f774b16376426131b568a41..e1aee4d898a5ade5f7666f4ced106265b42a02eb 100644 (file)
@@ -743,7 +743,6 @@ void LiveRange::flushSegmentSet() {
       segments.empty() &&
       "segment set can be used only initially before switching to the array");
   segments.append(segmentSet->begin(), segmentSet->end());
-  delete segmentSet;
   segmentSet = nullptr;
   verify();
 }
index 8a6ac251ab2d9da6cce9648c1c6d7a9b5377da99..5c9c679e97ba114a7a1c1c414ebb7f3e903dee0b 100644 (file)
@@ -61,8 +61,10 @@ LiveStacks::getOrCreateInterval(int Slot, const TargetRegisterClass *RC) {
   assert(Slot >= 0 && "Spill slot indice must be >= 0");
   SS2IntervalMap::iterator I = S2IMap.find(Slot);
   if (I == S2IMap.end()) {
-    I = S2IMap.insert(I, std::make_pair(Slot,
-            LiveInterval(TargetRegisterInfo::index2StackSlot(Slot), 0.0F)));
+    I = S2IMap.emplace(std::piecewise_construct, std::forward_as_tuple(Slot),
+                       std::forward_as_tuple(
+                           TargetRegisterInfo::index2StackSlot(Slot), 0.0F))
+            .first;
     S2RCMap.insert(std::make_pair(Slot, RC));
   } else {
     // Use the largest common subclass register class.
index 9e2b5afde1e6b7f90b8329e1b4be18c90492022b..c7a9df543a039e98105f4ff17378786a8db82c03 100644 (file)
@@ -9115,9 +9115,6 @@ struct LoadedSlice {
               unsigned Shift = 0, SelectionDAG *DAG = nullptr)
       : Inst(Inst), Origin(Origin), Shift(Shift), DAG(DAG) {}
 
-  LoadedSlice(const LoadedSlice &LS)
-      : Inst(LS.Inst), Origin(LS.Origin), Shift(LS.Shift), DAG(LS.DAG) {}
-
   /// \brief Get the bits used in a chunk of bits \p BitWidth large.
   /// \return Result is \p BitWidth and has used bits set to 1 and
   ///         not used bits set to 0.
index 4690177d02950c76ae29546b2428a60c684f0bf6..5394875a6bc12f96ef219bddf8f9fafe56dcea05 100644 (file)
@@ -319,7 +319,7 @@ void A57ChainingConstraint::addInterChainConstraint(PBQPRAGraph &G, unsigned Rd,
 
 static bool regJustKilledBefore(const LiveIntervals &LIs, unsigned reg,
                                 const MachineInstr &MI) {
-  LiveInterval LI = LIs.getInterval(reg);
+  const LiveInterval &LI = LIs.getInterval(reg);
   SlotIndex SI = LIs.getInstructionIndex(&MI);
   return LI.expiredAt(SI);
 }
index 15f09a5fe4aea76a68745bc6eb31d115255cdba0..7f2cdb02438d0b7f402b3a1929624d72e8e4d737 100644 (file)
@@ -548,6 +548,7 @@ public:
   }
   PhiState(Value *b) : status(Base), base(b) {}
   PhiState() : status(Unknown), base(nullptr) {}
+  PhiState &operator=(const PhiState &) = default;
   PhiState(const PhiState &other) : status(other.status), base(other.base) {
     assert(status != Base || base);
   }
index 8eb53ffffccf4c41bd7d2cca839af50e553bb1ed..cfdeec89d9ec6957bf5b76371bdfea10e4fa4ad0 100644 (file)
@@ -40,6 +40,8 @@ namespace llvm {
   public:
     LogBuilder(Consumer &c, StringRef Format)
       : consumer(c), Format(Format) {}
+    // Relying on RVO, not actually copyable.
+    LogBuilder(const LogBuilder&);
 
     LogBuilder &operator<<(Value *V) {
       Arguments.push_back(V);
index f4979839c78d5392631a20284d2de0ad91756ea5..97807771725d447064e90ba601f15e07afb13c08 100644 (file)
@@ -46,6 +46,7 @@ public:
   CtorTester(const CtorTester &Arg) : Value(Arg.Value) {
     EXPECT_TRUE(Constructed.insert(this).second);
   }
+  CtorTester &operator=(const CtorTester &) = default;
   ~CtorTester() {
     EXPECT_EQ(1u, Constructed.erase(this));
   }
index 44442ebf75adc69bf8c50dff8460a699f631dd0c..40b44ce3ca994caddef2a7b3cdb0ec70a99cf791 100644 (file)
@@ -21,7 +21,9 @@ struct Node : ilist_node<Node> {
   int Value;
 
   Node() {}
-  Node(int _Value) : Value(_Value) {}
+  Node(int Value) : Value(Value) {}
+  Node(const Node&) = default;
+  Node(Node &&RHS) : Value(RHS.Value) { RHS.Value = -1; }
   ~Node() { Value = -1; }
 };
 
index 909ecd4665f30952489bce1f7ed0984e0beeb424..12bb075eec9a4b17e839fb37a33ef201a37c4533 100644 (file)
@@ -441,6 +441,8 @@ struct MatchableInfo {
     : AsmVariantID(0), AsmString(Alias->AsmString), TheDef(Alias->TheDef), DefRec(Alias.release()) {
   }
 
+  MatchableInfo(const MatchableInfo&) = default;
+
   ~MatchableInfo() {
     delete DefRec.dyn_cast<const CodeGenInstAlias*>();
   }