PGO: Fix obviously wrong typedefs for MS

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204267 91177308-0d34-0410-b5e6-96231b3b80d8
PGO: Splitting implementation files; no functionality change

Split implementation files along a uses-libc/shouldn't-use-libc
boundary.

  - InstrProfiling.h is a shared header.

  - InstrProfiling.c provides an API to extract profiling data from the
    runtime, but avoids the use of libc.  Currently this is a lie:
    __llvm_pgo_write_buffer() uses `FILE*` and related functions.  It
    will be updated soon to write to a `char*` buffer instead.

  - InstrProfilingExtras.c provides a more convenient API for
    interfacing with the profiling runtime, but has logic that does (and
    will continue to) use libc.

<rdar://problem/15943240>

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204268 91177308-0d34-0410-b5e6-96231b3b80d8
PGO: Appease buildbots after r204268

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204276 91177308-0d34-0410-b5e6-96231b3b80d8
PGO: Use past-the-end semantics for pointer range

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204278 91177308-0d34-0410-b5e6-96231b3b80d8
PGO: Constify references to instrumentation data

<rdar://problem/15943240>

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204298 91177308-0d34-0410-b5e6-96231b3b80d8
PGO: Split out initialization of section bounds

Currently we register instrumentation data at runtime to determine the
bounds of the sections where the data lives.  Soon we'll implement
platform-specific linker magic to determine this at link time.

Move this logic to a separate file, so that our build system can choose
the correct platform-specific code.

No functionality change intended.

<rdar://problem/15943240>

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204299 91177308-0d34-0410-b5e6-96231b3b80d8
PGO: Implement Darwin linker magic for instrumentation

Use Darwin linker magic to find bounds of instrumentation data sections
at link time instead of runtime.

<rdar://problem/15943240>

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204302 91177308-0d34-0410-b5e6-96231b3b80d8
Mark this test as 64-bit specific

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204319 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: remove unused declaration


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204324 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: use stack depot for goroutine creation stacks (as C++ threads do)



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204326 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: deobfuscate global ctx variable



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204327 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: remove unused function declarations


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204328 91177308-0d34-0410-b5e6-96231b3b80d8
[libsanitizer] Introduce flag descriptions.
Extend ParseFlag to accept the |description| parameter, add dummy values for all existing flags.
As the flags are parsed their descriptions are stored in a global linked list.
The tool can later call __sanitizer::PrintFlagDescriptions() to dump all the flag names and their descriptions.
Add the 'help' flag and make ASan, TSan and MSan print the flags if 'help' is set to 1.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204339 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: deflake test


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204340 91177308-0d34-0410-b5e6-96231b3b80d8
[libsanitizer] Implement IntrusiveList<T>::Iterator, use IntrusiveList in sanitizer_flags.cc


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204342 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] Use new -fsanitize-memory-track-origins= flag in MSan tests.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204347 91177308-0d34-0410-b5e6-96231b3b80d8
PGO: Moving files for clarity

<rdar://problem/15943240>

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204373 91177308-0d34-0410-b5e6-96231b3b80d8
PGO: Add explicit static initialization

Instead of relying on explicit static initialization from translation
units, create a new file, InstrProfilingRuntime.cc, with an
__llvm_pgo_runtime variable.  After this commit (and its pair in clang),
the driver will create a use of this variable.  Unless the user defines
their own version, the new object file will get pulled in, including
that C++ static initialization that calls
__llvm_pgo_register_write_atexit.

The result is that, at least on Darwin, static initialization typically
consists of a single function call, which registers a writeout functino
atexit.  Furthermore, users can skip even this behaviour by defining
their own __llvm_pgo_runtime.

<rdar://problem/15943240>

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204380 91177308-0d34-0410-b5e6-96231b3b80d8
PGO: Update interface for writing instrumentation data to file

__llvm_pgo_write_default_file() was a bad name, since it checked the
environment (it wasn't just a default file).

  - Change __llvm_pgo_write_file() to __llvm_pgo_write_file_with_name()
    and make it static.

  - Rename __llvm_pgo_write_default_file() to __llvm_pgo_write_file().

  - Add __llvm_pgo_set_filename(), which sets the filename for
    subsequent calls to __llvm_pgo_write_file().

<rdar://problem/15943240>

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204381 91177308-0d34-0410-b5e6-96231b3b80d8
PGO: Add missing file...

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204384 91177308-0d34-0410-b5e6-96231b3b80d8