[cfe-commits] r65331 - /cfe/trunk/lib/AST/DeclBase.cpp

Chris Lattner sabre at nondot.org
Mon Feb 23 10:17:44 PST 2009


Author: lattner
Date: Mon Feb 23 12:17:44 2009
New Revision: 65331

URL: http://llvm.org/viewvc/llvm-project?rev=65331&view=rev
Log:
Add copy assignment operator, caught by doug.

Modified:
    cfe/trunk/lib/AST/DeclBase.cpp

Modified: cfe/trunk/lib/AST/DeclBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=65331&r1=65330&r2=65331&view=diff

==============================================================================
--- cfe/trunk/lib/AST/DeclBase.cpp (original)
+++ cfe/trunk/lib/AST/DeclBase.cpp Mon Feb 23 12:17:44 2009
@@ -290,6 +290,15 @@
       delete &getVector();
   }
   
+  StoredDeclsList &operator=(const StoredDeclsList &RHS) {
+    if (isVector())
+      delete &getVector();
+    Data = RHS.Data;
+    if (isVector())
+      Data.setPointer(new VectorTy(getVector()));
+    return *this;
+  }
+  
   bool isVector() const { return Data.getInt() != 0; }
   bool isInline() const { return Data.getInt() == 0; }
   bool isNull() const { return Data.getPointer() == 0; }





More information about the cfe-commits mailing list