In Release modes, Visual Studio complains that the Operator destructor in User.cpp
authorYaron Keren <yaron.keren@gmail.com>
Mon, 24 Mar 2014 19:48:13 +0000 (19:48 +0000)
committerYaron Keren <yaron.keren@gmail.com>
Mon, 24 Mar 2014 19:48:13 +0000 (19:48 +0000)
commitd816eda3c794b940f9d9f539456e21c2031868b6
tree6b11ee09dbbdf59446f0ad4f1fb0b031d435fd5e
parent6c199d8212e9048076d13d2df81a7dc0c97d9c68
In Release modes, Visual Studio complains that the Operator destructor in User.cpp
never returns, which is true by design.

Initially assumed that the reason is llvm_unreachable being dependent on NDEBUG.

However, even if llvm_unreachable is replaced by __assume(false), VC still warns in
Release modes but not in Debug modes...

The real reason turned out to be optimization flags.
With /Od in Debug modes the warning is not issued whereas with /O1 it is.

I could not find any documentation to this effect, but it is reproducable:

Try compiling http://msdn.microsoft.com/en-us/library/khwfyc5d(v=vs.90).aspx
with /O1 and then with /Od.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204659 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/User.cpp