Re-commit rL353927, patch included

Make llvm::Optional<T> trivially copyable when T is trivially copyable

This is an ever-recurring issue (see and
but I believe that thanks to we can now ship a decent implementation of this.

Basically the fact that llvm::is_trivially_copyable has a consistent behavior across compilers should prevent any ABI issue,
and using in-place new instead of memcpy should keep compiler bugs away.

This patch is slightly different from the original revision but achieves the same goal. It just avoids
going through std::conditional which may the code more explicit.

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed