diff options
-rw-r--r-- | clang/include/clang/AST/TypeLoc.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/include/clang/AST/TypeLoc.h b/clang/include/clang/AST/TypeLoc.h index 674fffb8fa2..26feda5d766 100644 --- a/clang/include/clang/AST/TypeLoc.h +++ b/clang/include/clang/AST/TypeLoc.h @@ -170,19 +170,18 @@ public: /// \brief Initializes this by copying its information from another /// TypeLoc of the same type. - void initializeFullCopy(TypeLoc Other) const { + void initializeFullCopy(TypeLoc Other) { assert(getType() == Other.getType()); - size_t Size = getFullDataSize(); - memcpy(getOpaqueData(), Other.getOpaqueData(), Size); + copy(Other); } /// \brief Initializes this by copying its information from another /// TypeLoc of the same type. The given size must be the full data /// size. - void initializeFullCopy(TypeLoc Other, unsigned Size) const { + void initializeFullCopy(TypeLoc Other, unsigned Size) { assert(getType() == Other.getType()); assert(getFullDataSize() == Size); - memcpy(getOpaqueData(), Other.getOpaqueData(), Size); + copy(Other); } /// Copies the other type loc into this one. |