Fix a bug that caused SimplifyCFG to drop DebugLocs.
authorAdrian Prantl <aprantl@apple.com>
Thu, 20 Aug 2015 18:24:02 +0000 (18:24 +0000)
committerAdrian Prantl <aprantl@apple.com>
Thu, 20 Aug 2015 18:24:02 +0000 (18:24 +0000)
commit2c12b35c9597cc72aac00facd8a9f14262e26eb4
tree0e12519d59d61f3bb946a2d5d64fcffc0d5ac840
parent0f8344c168e59002843f4b124f4146f783d31cd7
Fix a bug that caused SimplifyCFG to drop DebugLocs.

Instruction::dropUnknownMetadata(KnownSet) is supposed to preserve all
metadata in KnownSet, but the condition for DebugLocs was inverted.

Most users of dropUnknownMetadata() actually worked around this by not
adding LLVMContext::MD_dbg to their list of KnowIDs.
This is now made explicit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245589 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/Metadata.cpp
lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
lib/Transforms/Scalar/GVN.cpp
lib/Transforms/Scalar/MemCpyOptimizer.cpp
lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
lib/Transforms/Utils/SimplifyCFG.cpp
lib/Transforms/Vectorize/BBVectorize.cpp
test/Transforms/SimplifyCFG/basictest.ll