[profile] use GetComputerNameExW instead of gethostname on Windows
authorBob Haarman <llvm@inglorion.net>
Tue, 29 Nov 2016 15:24:00 +0000 (15:24 +0000)
committerBob Haarman <llvm@inglorion.net>
Tue, 29 Nov 2016 15:24:00 +0000 (15:24 +0000)
commit9ee65aca3daf67f9b32e58fafcde866b317f3a57
treef92eac5099b571e4f75830815bede344a6b28158
parentb2a346d5e40e9cbd344c6389a27709205a560159
[profile] use GetComputerNameExW instead of gethostname on Windows

Summary: In profile data paths, we replace "%h" with the hostname of the machine the program is running on. On Windows, we used gethostname() to obtain the hostname. This requires linking with ws2_32. With this change, we instead get the hostname from GetComputerNameExW(), which does not require ws2_32.

Reviewers: rnk, vsk, amccarth

Subscribers: zturner, ruiu, hans

Differential Revision: https://reviews.llvm.org/D27178

llvm-svn: 288146
compiler-rt/lib/profile/InstrProfilingFile.c
compiler-rt/lib/profile/InstrProfilingPort.h
compiler-rt/lib/profile/InstrProfilingUtil.c