summaryrefslogtreecommitdiffstats
path: root/include/clang/AST/CommentSema.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/AST/CommentSema.h')
-rw-r--r--include/clang/AST/CommentSema.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/include/clang/AST/CommentSema.h b/include/clang/AST/CommentSema.h
index 9b05d39..6a80383 100644
--- a/include/clang/AST/CommentSema.h
+++ b/include/clang/AST/CommentSema.h
@@ -79,12 +79,8 @@ public:
/// Returns a copy of array, owned by Sema's allocator.
template<typename T>
ArrayRef<T> copyArray(ArrayRef<T> Source) {
- size_t Size = Source.size();
- if (Size != 0) {
- T *Mem = Allocator.Allocate<T>(Size);
- std::uninitialized_copy(Source.begin(), Source.end(), Mem);
- return llvm::makeArrayRef(Mem, Size);
- }
+ if (!Source.empty())
+ return Source.copy(Allocator);
return None;
}
OpenPOWER on IntegriCloud