]> granicus.if.org Git - clang/commitdiff
Fixing a FIXME -- no longer using std::memcpy, since that would fail for non-trivial...
authorAaron Ballman <aaron@aaronballman.com>
Thu, 1 May 2014 15:21:03 +0000 (15:21 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Thu, 1 May 2014 15:21:03 +0000 (15:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207766 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Attr.h
utils/TableGen/ClangAttrEmitter.cpp

index 655bcabcf356dfc95743a92939b77b362c3a6fb7..fc4881619bce6d97ff4f934b6328419c31041278 100644 (file)
@@ -26,8 +26,8 @@
 #include "llvm/ADT/StringSwitch.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/raw_ostream.h"
+#include <algorithm>
 #include <cassert>
-#include <cstring>
 
 namespace clang {
   class ASTContext;
index e03afe4eccf89dbc9ff4aba3dba7786eed6ca121..8e06b5132643a7b865bf573e5787672de1de826f 100644 (file)
@@ -537,9 +537,8 @@ namespace {
          << "A->" << getLowerName() << "_size()";
     }
     void writeCtorBody(raw_ostream &OS) const override {
-      // FIXME: memcpy is not safe on non-trivial types.
-      OS << "    std::memcpy(" << getLowerName() << ", " << getUpperName()
-         << ", " << getLowerName() << "Size * sizeof(" << getType() << "));\n";
+      OS << "    std::copy(" << getUpperName() << ", " << getUpperName()
+         << " + " << getLowerName() << "Size, " << getLowerName() << ");";
     }
     void writeCtorInitializers(raw_ostream &OS) const override {
       OS << getLowerName() << "Size(" << getUpperName() << "Size), "