Commit Graph

75 Commits

Author SHA1 Message Date
NAKAMURA Takumi
d63e7bf556 PathProfiling.c: Get rid of using "inline". We may expect compiler shall optimize out "static" scope w/o "inline".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144080 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-08 12:03:14 +00:00
NAKAMURA Takumi
d66d5718a4 runtime/libprofile/PathProfiling.c: Use __inline__ to appease clang -std=gnu89 -pedantic.
FIXME: Should configure detect one?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144070 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-08 03:54:40 +00:00
Benjamin Kramer
70b582ab9c Include direct.h for _mkdir on mingw32 too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141495 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-08 15:49:19 +00:00
Galina Kistanova
6bbba3cab4 Fix for warnings: ignoring return value of ‘write’, declared with attribute warn_unused_result.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140314 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-22 17:33:24 +00:00
Bill Wendling
ad759c5a07 Use version 402 for the GCDA files when compiling for Apple.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136369 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-28 18:12:20 +00:00
Bill Wendling
c8dad112b4 Build and install the archive when building the Apple way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135538 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-19 23:33:42 +00:00
Eli Friedman
aeebc35886 Fix build for (some versions of?) MinGW. Patch by Ruben Van Boxem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133741 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 18:24:27 +00:00
Bill Wendling
31bfd9bc45 Remove the LTO stuff from the profile_rt library's Makefile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133042 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-15 04:56:13 +00:00
Bill Wendling
1922a11907 Add compatibility version when compiling the Apple way.
<rdar://problem/9600408>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132929 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-13 20:14:37 +00:00
Francois Pichet
97938081f3 Fix MSVC warning regarding mkdir function usage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132109 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-26 04:55:20 +00:00
Francois Pichet
0b5bb3b2b4 Fix 3 MSVC warnings:
'void (__cdecl *)()' differs in parameter lists from 'void (__cdecl *)(void)'

atexit really expects a "void f(void)" function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132061 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-25 16:32:33 +00:00
Nick Lewycky
d363ff334d The computation of string length is not that complicated. Fix it, again. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130967 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 23:52:18 +00:00
Nick Lewycky
5409a18832 Update the gcov version used slightly, to make it stop causing modern gcov's to
crash.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130911 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 02:46:38 +00:00
Nick Lewycky
5e436b3b0e Create the parent directories to place the .gcda files in if they don't exist.
That's kinda weird because the .gcno files are supposed to already be there,
but libgcov does this and somehow Google has managed to depend on it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130879 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 22:34:29 +00:00
Nick Lewycky
d006ddc195 Fix crash when not setting GCOV_PREFIX.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130834 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 03:58:45 +00:00
NAKAMURA Takumi
4f5558e676 runtime/libprofile/PathProfiling.c: Don't use // comment in C source.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130589 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 03:53:56 +00:00
Daniel Dunbar
8ddf6f2952 win32: Include DataTypes.h instead of stdint.h to try and fix a Win32 build
issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130530 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 18:58:57 +00:00
Daniel Dunbar
c69c4a839f Cleanup some DOS newlines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130529 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 18:58:55 +00:00
Francois Pichet
b89e699b74 Unbreak the MSVC build:
- unistd.h doesn't exist with MSVC
  - inline must be __inline in Microsoft C
  - atexit cannot take a function declared as void f(), must be void f(void).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130490 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 08:56:07 +00:00
Nick Lewycky
bcffb1fbb8 Rename profile_rt.so to libprofile_rt.so under configure+make (it already was
under cmake).

Add libprofile_rt.a so that we can tell clang to link against it in --coverage
mode. Also turn it on by default in cmake builds.

Oscar, this touches a change you made for EXCLUDE_FROM_ALL support -- I think
I've done the right thing, but please let me know (or fix and commit) if not!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130470 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 02:12:06 +00:00
Nick Lewycky
7a2ba2fbe4 Only read *predecessor once so as to fix a theoretical issue where it changes
between two reads (threading).

Fix an off-by-one in the indirect counter table that I meant to revert after an
earlier experiment. Whoops!

Implement GCOV_PREFIX. Doesn't handle GCOV_PREFIX_STRIP yet.

Fix an off-by-one in string emission. Extra whoops!

Tolerate DISubprograms that have null Function*'s attached to them. I don't yet
understand what this means, but it happens when you have a global static with
a non-trivial constructor/destructor.

Fix a crash on switch statements with a single successor (default-only).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130443 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 21:35:49 +00:00
Nick Lewycky
3f5c832909 Use static inline to do the right thing when built in C99 mode. Of course,
C89 doesn't have an inline keyword.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130279 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 03:22:17 +00:00
Nick Lewycky
e88c724ff0 Add cmakefiles to build profile_rt.so!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130191 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 05:48:41 +00:00
Nick Lewycky
1790c9cbb6 Rename everything to follow LLVM style ... I think.
Add support for switch and indirectbr edges. This works by densely numbering
all blocks which have such terminators, and then separately numbering the
possible successors. The predecessors write down a number, the successor knows
its own number (as a ConstantInt) and sends that and the pointer to the number
the predecessor wrote down to the runtime, who looks up the counter in a
per-function table.

Coverage data should now be functional, but I haven't tested it on anything
other than my 2-file synthetic test program for coverage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130186 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 03:54:16 +00:00
Benjamin Kramer
571c0e95fa Write out uint64_t as i{0..32},i{33..64} instead of i{0..32},0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129638 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-16 10:25:32 +00:00
Nick Lewycky
ece78a30bd Don't use C++ comments in C code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129637 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-16 04:25:36 +00:00
Nick Lewycky
b192870420 Rename LineProfiling to GCOVProfiling to more accurately represent what it
does. Also mostly implement it. Still a work-in-progress, but generates legal
output on crafted test cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129630 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-16 01:20:23 +00:00
Chris Lattner
7a2bdde0a0 Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129558 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-15 05:18:47 +00:00
Benjamin Kramer
8b505739f4 Fix format string warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129467 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-13 20:41:43 +00:00
Nick Lewycky
8a7f4ecbc1 Use %ull here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129423 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-13 01:05:45 +00:00
Nick Lewycky
e9e7ffa10d Print our uint64_t with the more portable (C99 and C++0x) %PRIu64 format
specifier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129384 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-12 20:06:50 +00:00
Nick Lewycky
c6d8853dff The counters are unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129380 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-12 19:35:45 +00:00
Nick Lewycky
93b68b20d4 Add support for line profiling. Very work-in-progress.
Use debug info in the IR to find the directory/file:line:col. Each time that location changes, bump a counter.

Unlike the existing profiling system, we don't try to look at argv[], and thusly don't require main() to be present in the IR. This matches GCC's technique where you specify the profiling flag when producing each .o file.

The runtime library is minimal, currently just calling printf at program shutdown time. The API is designed to make it possible to emit GCOV data later on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129340 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-12 01:06:09 +00:00
Andrew Trick
04317cc618 Implementation of path profiling.
Modified patch by Adam Preuss.

This builds on the existing framework for block tracing, edge profiling and optimal edge profiling.
See -help-hidden for new flags.
For documentation, see the technical report "Implementation of Path Profiling..." in llvm.org/pubs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124515 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-29 01:09:53 +00:00
Mikhail Glushenkov
a7236d3a92 Rename 'libprofile/exported_symbols.lst' to 'libprofile/libprofile.exports'.
Makefile.rules assumes that all EXPORTED_SYMBOL_FILEs have the .exports
extension.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112964 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 15:42:45 +00:00
Dan Gohman
630b58bb5a Delete a blank line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101459 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 13:32:55 +00:00
Dan Gohman
7c52f2ee06 Make the export files absolute paths, and change Makefile.rules
to expect them this way, to fix srcdir!=objdir builds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101414 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15 23:08:00 +00:00
Daniel Dunbar
51faa37b4e Don't use absolute path for EXPORTED_SYMBOL_FILE, this breaks under the new
system.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101404 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15 21:57:43 +00:00
Daniel Dunbar
7cfbe2576d Switch .bc/.ll Makefile rules to use LLVM{CC,CXX} instead of LLVMG{CC,XX}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96936 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 10:28:06 +00:00
Chris Lattner
5fadf17709 remove the random sampling framework, which is not maintained anymore.
If there is interest, it can be resurrected from SVN.  PR4912.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92422 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-02 20:07:03 +00:00
Andreas Neustifter
f771dae69a OptimalEdgeProfiling: Creation of profiles.
This adds the instrumentation and runtime part of OptimalEdgeProfiling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80712 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 19:03:44 +00:00
Andreas Neustifter
1c29357c52 Read Makefile.config before using LLVMGCC.
See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090824/085828.html


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80372 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 16:13:45 +00:00
Andreas Neustifter
ade1a22522 Add llvm_start_edge_profiling to exported symbols for libprofile_rt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79944 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 21:41:37 +00:00
Daniel Dunbar
a4b62c4518 Don't try to build .bc version of libprofile if LLVMGCC isn't available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79514 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 05:12:55 +00:00
Daniel Dunbar
7dadba34d7 Remove cruft for installing runtime/ libraries directly into the LLVMGCCDIR;
that is totally bogus.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79512 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 05:02:41 +00:00
Chris Lattner
234d529e58 remove attribution from a variety of miscellaneous files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45425 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 22:59:10 +00:00
Chris Lattner
57360d1f1c remove attributions from the rest of the llvm makefiles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45416 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 20:11:13 +00:00
Reid Spencer
8b2e1419cf Undo removal of the runtime libraries. While this may have been a bit
premature, these libraries will be going away for the 2.0 release. Other
arrangements for profiling, gc, etc. should be made in the next few months.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31807 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-17 03:32:33 +00:00
Reid Spencer
ac90d5e50b In LLVM 2.0 we won't use the runtime libraries as llvm-gcc3 support will
be dropped. This patch pertains to removing the runtime directory from LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31793 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-16 23:17:27 +00:00
Reid Spencer
162e20934b Remove unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31404 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-03 01:58:30 +00:00