Disallow implicit conversions from None to integer types
authorJustin Bogner <mail@justinbogner.com>
Fri, 20 Feb 2015 07:28:28 +0000 (07:28 +0000)
committerJustin Bogner <mail@justinbogner.com>
Fri, 20 Feb 2015 07:28:28 +0000 (07:28 +0000)
commitc4f5a5e8637543f16d4b3b191b1aba32c650f1f3
tree9e49a56f9743cbfc952676d3d0287023ca4c6b02
parentb73c0410050aabeefd44249d6e1d458d75c68055
Disallow implicit conversions from None to integer types

This fixes an error introduced in r228934 where None was converted to
an int instead of the int being converted to an Optional as intended.
We make that sort of mistake a compile error by changing NoneType into
a scoped enum.

Finally, provide a static NoneType called None to avoid forcing all
users to spell it NoneType::None.

llvm-svn: 229980
llvm/include/llvm/ADT/None.h
llvm/lib/ProfileData/CoverageMapping.cpp