Commit Graph

22 Commits

Author SHA1 Message Date
Bill Wendling
6207cb519b Free the allocated filename. Found by clang static analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158513 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-15 09:11:47 +00:00
Bill Wendling
53caba6cc2 Small code cleanup. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157502 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-25 21:57:59 +00:00
Bill Wendling
e00c8fdcc1 Open in read/write mode, creating the file if it doesn't exist.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157501 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-25 21:55:06 +00:00
Bill Wendling
43a699a112 Early-continue.Reducing indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157451 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-25 00:57:21 +00:00
Bill Wendling
717f7fa12a Don't call exit from a runtime.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157450 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-25 00:55:38 +00:00
Bill Wendling
d4ec0547a2 Use the correct filename for the error message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153564 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-28 02:39:06 +00:00
Bill Wendling
7242a4fb86 Use Nakamura's suggestion of bypassing using 'filename' and just the pointers directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153558 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-28 01:30:51 +00:00
Francois Pichet
da942482a3 MSVC doesn't like the mixing of declarations and statements in a .c file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153549 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-27 23:52:22 +00:00
Bill Wendling
66e30f8db1 Try to use the CWD if the path to the GCDA output is not available (e.g., the
executable has been moved to another machine). If that's not available
(read-only or something), then exit gracefully.
<rdar://problem/11111686>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153538 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-27 21:17:04 +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
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
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
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
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
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
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