InstrProf: Fix handling of profile counters in the body of range based for
authorJustin Bogner <mail@justinbogner.com>
Thu, 30 Apr 2015 22:58:28 +0000 (22:58 +0000)
committerJustin Bogner <mail@justinbogner.com>
Thu, 30 Apr 2015 22:58:28 +0000 (22:58 +0000)
commit2e5d484597ff0ab232f8db03c5e2bb2933cdb88e
tree2c5a5832045319c4b4caa472ad618269b0d7d84a
parent9dd1fbdca6548b401ae224c608e69a1fe909cbcf
InstrProf: Fix handling of profile counters in the body of range based for

We were assigning the counter for the body of the loop to the loop
variable initialization for some reason here, but our tests completely
lacked coverage for range-for loops. This fixes that and makes the
logic generally more similar to the logic for a regular for.

llvm-svn: 236277
clang/lib/CodeGen/CodeGenPGO.cpp
clang/test/Profile/Inputs/cxx-rangefor.proftext [new file with mode: 0644]
clang/test/Profile/cxx-rangefor.cpp [new file with mode: 0644]