[PGO] Fix profile var comdat generation problem with COFF
authorXinliang David Li <davidxl@google.com>
Mon, 21 Dec 2015 20:41:20 +0000 (20:41 +0000)
committerXinliang David Li <davidxl@google.com>
Mon, 21 Dec 2015 20:41:20 +0000 (20:41 +0000)
commite3e5614a18e04de516370be7ae55724d8592571b
treeed5d05578b2563a735922b1c6cdc171521f15f85
parent4c1d77039a5566842aaf9624c1c22a4bca968f41
[PGO] Fix profile var comdat generation problem with COFF

When targeting COFF, it is required that a comdat section to
have a global obj with the same name as the comdat (except for
comdats with select kind to be associative). This fix makes
sure that the comdat is keyed on the data variable for COFF.

Also improved test coverage for this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256193 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Instrumentation/InstrProfiling.cpp
test/Instrumentation/InstrProfiling/PR23499.ll