OSDN Git Service

IR: Make stripDebugInfo robust against (invalid) empty basic blocks
authorJustin Bogner <mail@justinbogner.com>
Fri, 18 Aug 2017 21:38:03 +0000 (21:38 +0000)
committerJustin Bogner <mail@justinbogner.com>
Fri, 18 Aug 2017 21:38:03 +0000 (21:38 +0000)
commitb251a7588a5447aa29263fe8c0a6435ef805e820
treeee391de4af811a48773235978dc7e7777ed97648
parent15ccbc58e59c50baf1e5f611373f69c9c267b86c
IR: Make stripDebugInfo robust against (invalid) empty basic blocks

Since stripDebugInfo runs before the verifier when reading IR, we can
end up in a situation where we read some invalid IR but don't know its
invalid yet. Before this patch we would crash in stripDebugInfo when
given IR with a completely empty basic block, and after we get a nice
error from the verifier instead.

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