Replace incorrect "#ifdef DEBUG" with "#ifndef NDEBUG".
authorJames Y Knight <jyknight@google.com>
Tue, 30 Aug 2016 03:16:16 +0000 (03:16 +0000)
committerJames Y Knight <jyknight@google.com>
Tue, 30 Aug 2016 03:16:16 +0000 (03:16 +0000)
commitd7d9e1069be675f40dd89e27143c0dc176ed498d
treee9841820a70e198799f8dd839bd6a3b5c0589983
parentc80f7b866e769427045212e4968d284fd4546b9a
Replace incorrect "#ifdef DEBUG" with "#ifndef NDEBUG".

The former is simply wrong -- the code will either never be used or will
always be used, rather than being dependent upon whether it's built with
debug assertions enabled.

The macro DEBUG isn't ever set by the llvm build system. But, the macro
DEBUG(X) is defined (unconditionally) if you happen to include
llvm/Support/Debug.h.

The code in Value.h which was erroneously protected by the #ifdef DEBUG
didn't even compile -- you can't cast<> from an LLVMOpaqueValue
directly. Fortunately, it was never invoked, as Core.cpp included
Value.h before Debug.h.

The conditionalized code in AArch64CollectLOH.cpp was previously always
used, as it includes Debug.h.

llvm-svn: 280056
llvm/include/llvm/IR/Value.h
llvm/lib/Target/AArch64/AArch64CollectLOH.cpp