|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Move functions around to prepare for some other changes.
  - Merge InstrProfilingExtras.h with InstrProfiling.h.  There's no
    benefit to having these split.
  - Rename InstrProfilingExtras.c to InstrProfilingFile.c.
  - Split actual buffer writing code out of InstrProfiling.c into
    InstrProfilingBuffer.c.
  - Drive-by corrections of a couple of header comments.
<rdar://problem/15943240>
llvm-svn: 204497 | 
| | 
| 
| 
| 
| 
| | Return 0 for success, non-0 for failure.
llvm-svn: 204415 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Add logic to do a printf-style substitution of %p for the process pid in
the filename.
It's getting increasingly awkward to work on lib/profile without test
infrastructure.  This needs to be fixed!
<rdar://problem/16383358>
llvm-svn: 204414 | 
| | 
| 
| 
| 
| 
| 
| 
| | It turns out this is C code.  Specify foo(void).
<rdar://problem/15943240>
llvm-svn: 204396 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | These functions are in the profile runtime.  PGO comes later.
Unfortunately, there's only room for 16 characters in a Darwin section,
so use __llvm_prf_ instead of __llvm_profile_ for section names.
<rdar://problem/15943240>
llvm-svn: 204391 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | __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>
llvm-svn: 204381 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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>
llvm-svn: 204380 | 
|  | 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>
llvm-svn: 204268 |