]> granicus.if.org Git - clang/commit
InstrProf: Don't emit counter increments in dead code
authorJustin Bogner <mail@justinbogner.com>
Fri, 9 Jan 2015 01:46:40 +0000 (01:46 +0000)
committerJustin Bogner <mail@justinbogner.com>
Fri, 9 Jan 2015 01:46:40 +0000 (01:46 +0000)
commit659e92bcfa578a0bf2cd1f9f50bcaa16c782a41b
treeadf10311ff9d0b3850618698e59131ddb211f7c5
parent18811908dc026d90a8a1f319f7c576b2e2ee3a2c
InstrProf: Don't emit counter increments in dead code

We were previously emitting counter increments even if we didn't have
an insertion point, which would result in a CallInst with no
parent. This leads to a crash, as in pr22166, if we try to do
GlobalDCE.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225495 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CodeGenPGO.cpp
test/Profile/c-unreachable-after-switch.c [new file with mode: 0644]