OSDN Git Service

[ADT] Split optional to only include copy mechanics and dtor for non-trivial types.
authorBenjamin Kramer <benny.kra@googlemail.com>
Thu, 18 Jan 2018 11:26:24 +0000 (11:26 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Thu, 18 Jan 2018 11:26:24 +0000 (11:26 +0000)
commitbe058281ec7f3cc5f9e42317522843fb811da132
tree55b5a600cda623dfda6bfe190310b1daf00910b3
parentb43fe4d6c762fd678f601e725c38201216ce1447
[ADT] Split optional to only include copy mechanics and dtor for non-trivial types.

This makes uses of Optional more transparent to the compiler (and
clang-tidy) and generates slightly smaller code.

This is a re-land of r317019, which had issues with GCC 4.8 back then.
Those issues don't reproduce anymore, but I'll watch the buildbots
closely in case anything goes wrong.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322838 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/Optional.h
unittests/ADT/OptionalTest.cpp