Commit Graph

3613 Commits

Author SHA1 Message Date
Hans Wennborg 8f80ccc635 sanitizer_atomic_msvc.h: add atomic_fetch_{add,sub} overloads for uintptr_t
This should hopefully unbreak the MSVC build after r206178.

llvm-svn: 206200
2014-04-14 17:43:49 +00:00
Hans Wennborg ec77f619bb sanitizer_deadlock_detector.h: MSVC 2012 doesn't like compound literals
llvm-svn: 206199
2014-04-14 17:43:45 +00:00
Evgeniy Stepanov 9ce9a6cdf6 [msan] Intercept wcsftime().
llvm-svn: 206179
2014-04-14 14:59:42 +00:00
Kostya Serebryany bcfbea6d4e [asan] added internal flag mmap_limit_mb
llvm-svn: 206178
2014-04-14 14:51:01 +00:00
Kostya Serebryany 90527cb324 [asan] don't use bool in public interface, make sure the interface headers are usable in plain C
llvm-svn: 206160
2014-04-14 11:16:53 +00:00
Kostya Serebryany f694ab1f18 [asan] provide better reports for cases where memcpy/etc get negative size parameter. Also fix a typo found by Tetsuo Kiso
llvm-svn: 206158
2014-04-14 09:50:52 +00:00
Dmitry Vyukov 51f5b5fd73 tsan: serialize report printing in standalone deadlock detector
otherwise reports get intermixed

llvm-svn: 206043
2014-04-11 17:54:27 +00:00
Dmitry Vyukov b5eb8f0212 tsan: fix vector clocks
the new optimizations break when thread ids gets reused (clocks go backwards)
add the necessary tests as well

llvm-svn: 206035
2014-04-11 15:38:03 +00:00
Dmitry Vyukov fa1d56c31f tsan: ignore interceptors from symbolizer
ocassionally we see races coming from symbolizer interceptors (e.g. memcmp)
reproducible only only on large complex programs

llvm-svn: 206034
2014-04-11 15:36:54 +00:00
Evgeniy Stepanov 652cbd7c15 [tsan] Fix false positive on xdr*_create.
llvm-svn: 206030
2014-04-11 12:29:24 +00:00
Evgeniy Stepanov d326c81117 [msan] mprotect() more memory to detect user code outside of application range.
llvm-svn: 206028
2014-04-11 12:04:29 +00:00
Viktor Kutuzov 7004b8c07c Enable building of sanitizers on FreeBSD
llvm-svn: 205919
2014-04-09 18:45:12 +00:00
Viktor Kutuzov 82185a2088 Declare _DYNAMIC and dl_phdr_info in asan_linux.cc on FreeBSD
llvm-svn: 205852
2014-04-09 13:37:19 +00:00
Evgeniy Stepanov 24c8d92fec [sanitizer] Intercept a subset of sunrpc interface (xdr_*).
llvm-svn: 205627
2014-04-04 14:51:23 +00:00
Evgeniy Stepanov f653cda269 [msan] Introduce MsanThread. Move thread-local allocator cache out of TLS.
This reduces .tbss from 109K down to almost nothing.

llvm-svn: 205618
2014-04-04 09:47:41 +00:00
Kostya Serebryany 9f20c9b17c [asan] fix a leak in __tls_get_addr handler; introduce a run-time flag to disable this handler completely; remove a workaround for a bug fixed in glibc
llvm-svn: 205617
2014-04-04 09:10:58 +00:00
Alexey Samsonov 425314a65f [TSan] Fix a rare deadlock on multithreaded fork.
If a multi-threaded program calls fork(), TSan ignores all memory accesses
in the child to prevent deadlocks in TSan runtime. This is OK, as child is
probably going to call exec() as soon as possible. However, a rare deadlocks
could be caused by ThreadIgnoreBegin() function itself.

ThreadIgnoreBegin() remembers the current stack trace and puts it into the
StackDepot to report a warning later if a thread exited with ignores enabled.
Using StackDepotPut in a child process is dangerous: it locks a mutex on
a slow path, which could be already locked in a parent process.

The fix is simple: just don't put current stack traces to StackDepot in
ThreadIgnoreBegin() and ThreadIgnoreSyncBegin() functions if we're
running after a multithreaded fork. We will not report any
"thread exited with ignores enabled" errors in this case anyway.

Submitting this without a testcase, as I believe the standalone reproducer
is pretty hard to construct.

llvm-svn: 205534
2014-04-03 12:51:26 +00:00
Alexey Samsonov b4525218d4 [TSan] Fix a typo ThreadIgnoreSyncEnd. Found by inspection
llvm-svn: 205531
2014-04-03 12:28:16 +00:00
Alexey Samsonov 11ff0a26a4 [ASan] Fix incompatible runtimes check: don't iterate /proc/self/maps on every call to __asan_init
llvm-svn: 205418
2014-04-02 13:09:22 +00:00
Evgeniy Stepanov 2dcb5c0a2c [msan] Kill __msan_print_param_shadow.
It does not do what it's name says, and what it actually does is hard to
describe, and is not useful at all.

llvm-svn: 205415
2014-04-02 11:55:24 +00:00
Evgeniy Stepanov 80cb930c09 [msan] Add __msan_check_mem_is_initialized.
An assert()-like function that checks that a memory range is fully initialized.

llvm-svn: 205413
2014-04-02 11:50:42 +00:00
Evgeniy Stepanov a55fcd35e9 [msan] Precise origin handling in __unaligned_(load|store)*.
llvm-svn: 205412
2014-04-02 11:06:35 +00:00
Alexey Samsonov 2c66a22e56 [ASan] One more attempt to fix Android build
llvm-svn: 205411
2014-04-02 09:36:36 +00:00
Evgeniy Stepanov 8dbf3faa16 [msan] clang-format several unit tests
llvm-svn: 205410
2014-04-02 09:17:55 +00:00
Joerg Sonnenberger a350ba4883 Move __addsf3 and __adddf3 into the corresponding blocks that define
fp_t.

llvm-svn: 205344
2014-04-01 18:39:58 +00:00
Alexander Potapenko f3e92a9e71 [tsan] Remove an accidentally committed debug print.
llvm-svn: 205316
2014-04-01 15:07:09 +00:00
Joerg Sonnenberger 6530149704 Add support for IEEE754 quad precision comparison functions.
From GuanHong Liu.

Differential Revision: http://llvm-reviews.chandlerc.com/D2797

llvm-svn: 205312
2014-04-01 13:42:56 +00:00
Alexey Samsonov 107e4abfd0 [ASan] Fix Android build
llvm-svn: 205311
2014-04-01 13:42:16 +00:00
Alexey Samsonov 56b6ee9833 [ASan] Optional support for dynamic ASan runtime on Linux.
Based on http://llvm-reviews.chandlerc.com/D3042 by Yuri Gribov!

llvm-svn: 205308
2014-04-01 13:16:30 +00:00
Viktor Kutuzov 7fedc179d2 Add FreeBSD support to sanitizers' procmaps facilities
llvm-svn: 205291
2014-04-01 10:34:21 +00:00
Viktor Kutuzov 3ece65b894 Fix definition of the __sanitizer_passwd structure on FreeBSD
llvm-svn: 205290
2014-04-01 10:29:42 +00:00
Duncan P. N. Exon Smith ae2f0bbcf1 InstrProf: Add simple compiler-rt test
Add the test infrastructure for testing lib/profile and a single test.
This initial commit only enables the tests on Darwin, but they'll be
enabled on Linux soon after.

<rdar://problem/16458307>

llvm-svn: 205256
2014-03-31 22:45:37 +00:00
Evgeniy Stepanov 3c95744de8 [msan] Remove an extra top frame from track-origins=2 reports.
llvm-svn: 205192
2014-03-31 14:18:55 +00:00
Alexey Samsonov 78a8435fd6 [CMake] Rename add_compiler_rt_static_runtime to add_compiler_rt_runtime.
Soon there will be an option to build compiler-rt parts as shared libraries
on Linux. Extracted from http://llvm-reviews.chandlerc.com/D3042
by Yuri Gribov.

llvm-svn: 205183
2014-03-31 13:45:36 +00:00
Alexander Potapenko 0426176940 [TSan] Replace several Printf() calls with Report() to ease debugging.
llvm-svn: 205175
2014-03-31 10:46:07 +00:00
Kostya Serebryany 683d55f50e [sanitizer] speed up the bitvector-based deadlock detector by ~15% (iterate over the currently held locks using the array, not the bitvector. Bitvector is not the best data structure to iterate over)
llvm-svn: 205168
2014-03-31 07:23:50 +00:00
Evgeniy Stepanov 6f34082590 [sanitizer] Fix Mac build.
llvm-svn: 205006
2014-03-28 14:01:40 +00:00
Evgeniy Stepanov 86a4d2c32b [sanitizer] Intercept fgetpwent / fgetgrent.
These interceptors require deep unpoisoning of return values.
While at it, we do the same for all other pw/gr interceptors to
reduce dependency on libc implementation details.

llvm-svn: 205004
2014-03-28 13:03:55 +00:00
Evgeniy Stepanov 163ee4efb5 [sanitizer] Intercept setpwent/endpwent.
It's hard to write a reliable test for this code because they
work with unpredictable memory locations. But this change should
fix current failures in getpwent() tests on the sanitizer bots.

llvm-svn: 205002
2014-03-28 11:46:35 +00:00
Evgeniy Stepanov 92bee36b3e [sanitizer] Intercept rand_r.
llvm-svn: 205001
2014-03-28 11:21:45 +00:00
Evgeniy Stepanov 74e77756ef [sanitizer] Intercept getpwent/getgrent.
llvm-svn: 205000
2014-03-28 10:56:07 +00:00
Joerg Sonnenberger ea1f8fb775 Add instrastructure for IEEE quad precision.
Based on patch from GuanHong Liu.

Differential Revision: http://llvm-reviews.chandlerc.com/D2796

llvm-svn: 204999
2014-03-28 10:29:31 +00:00
Evgeniy Stepanov 2e972f63b5 [sanitizer] Intercept mktime.
llvm-svn: 204994
2014-03-28 09:02:57 +00:00
Evgeniy Stepanov 7b44e1ad42 [sanitizer] Intercept ftime.
llvm-svn: 204991
2014-03-28 08:33:32 +00:00
Evgeniy Stepanov a6eb1bb59e [sanitizer] Intercept __bzero on Mac.
This should make memset_test pass on Mac.

llvm-svn: 204929
2014-03-27 14:20:34 +00:00
Evgeniy Stepanov 1189734413 [sanitizer] Fix Android build.
llvm-svn: 204927
2014-03-27 14:06:15 +00:00
Evgeniy Stepanov 89602651e8 [msan] Implement __msan_set_death_callback.
llvm-svn: 204926
2014-03-27 14:04:58 +00:00
Timur Iskhodzhanov e6303d1224 Add support for _expand[_dbg] so we don't crash when _aligned_* allocation functions are used
llvm-svn: 204925
2014-03-27 14:01:11 +00:00
Evgeniy Stepanov 9dcd5a353a [msan] Intercept several malloc-related functions.
llvm-svn: 204923
2014-03-27 13:29:29 +00:00
Kostya Serebryany 88d0eac412 [asan] Do not sanitize kernel area on 32-bit targets, patch by Yuri Gribov
llvm-svn: 204897
2014-03-27 07:36:26 +00:00
Peter Collingbourne 5d167dae7d Add function to get the number of DFSan labels allocated.
Expose the number of DFSan labels allocated by adding function dfsan_get_label_count().

Patch by Sam Kerner!

Differential Revision: http://llvm-reviews.chandlerc.com/D3109

llvm-svn: 204854
2014-03-26 21:09:53 +00:00
Rafael Espindola 5e46070516 Avoid aliases to weak aliases in interceptors.
The interceptors had code that after macro expansion ended up looking like

extern "C" void memalign()
    __attribute__((weak, alias("__interceptor_memalign")));
extern "C" void __interceptor_memalign() {}
extern "C" void __interceptor___libc_memalign()
    __attribute__((alias("memalign")));

That is,
* __interceptor_memalign is a function
* memalign is a weak alias to __interceptor_memalign
* __interceptor___libc_memalign is an alias to memalign

Both gcc and clang produce assembly that look like

__interceptor_memalign:
...
        .weak   memalign
memalign = __interceptor_memalign
        .globl  __interceptor___libc_memalign
__interceptor___libc_memalign = memalign

What it means in the end is that we have 3 symbols pointing to the
same position in the file, one of which is weak:

     8: 0000000000000000     1 FUNC    GLOBAL DEFAULT    1
__interceptor_memalign
     9: 0000000000000000     1 FUNC    WEAK   DEFAULT    1 memalign
    10: 0000000000000000     1 FUNC    GLOBAL DEFAULT    1
__interceptor___libc_memalign

In particular, note that __interceptor___libc_memalign will always
point to __interceptor_memalign, even if we do link in a strong symbol
for memalign. In fact, the above code produces exactly the same binary
as

extern "C" void memalign()
    __attribute__((weak, alias("__interceptor_memalign")));
extern "C" void __interceptor_memalign() {}
extern "C" void __interceptor___libc_memalign()
    __attribute__((alias("__interceptor_memalign")));

If nothing else, this patch makes it more obvious what is going on.

llvm-svn: 204823
2014-03-26 15:48:59 +00:00
Dmitry Vyukov 5da31e03bf tsan: fix deadlock during fork
ReportRace takes the two mutexes in the opposite order

llvm-svn: 204809
2014-03-26 14:13:31 +00:00
Dmitry Vyukov b979a55607 tsan: fix another compiler-injected memset
newer gcc inserts memset here

llvm-svn: 204808
2014-03-26 14:13:00 +00:00
Evgeniy Stepanov 16d89fc356 [sanitizer] Intercept __aeabi_mem(set|cpy|move).
llvm-svn: 204800
2014-03-26 12:14:34 +00:00
Viktor Kutuzov 9068dfa6a7 Define uintptr_t in the profiling sources on x86_64 FreeBSD in 32-bit mode
llvm-svn: 204799
2014-03-26 12:00:44 +00:00
Alexander Potapenko 7caa0b9e36 [ASan] Fix a thinko spotted by Evgeniy Stepanov: use REAL(memcpy) on non-OSX systems.
llvm-svn: 204794
2014-03-26 11:18:25 +00:00
Evgeniy Stepanov 1382fabd97 [msan] Enable SelectPartial test.
Fixed in r204716.

llvm-svn: 204717
2014-03-25 13:09:14 +00:00
Evgeniy Stepanov 1611ed8879 [tsan] Fix more warnings in TSan tests.
llvm-svn: 204715
2014-03-25 13:01:32 +00:00
Evgeniy Stepanov 0f08043aeb [tsan] Fix compiler warnings in TSan tests.
llvm-svn: 204712
2014-03-25 11:17:14 +00:00
Evgeniy Stepanov 517ff05ffb [msan] Fix compiler warning in msan_test.cc.
llvm-svn: 204708
2014-03-25 10:03:39 +00:00
Evgeniy Stepanov 90384ad60e [msan] A disabled test for inexact "select" instrumentation.
llvm-svn: 204707
2014-03-25 09:36:15 +00:00
Duncan P. N. Exon Smith 21b98a6c83 InstrProf: Change the extension of the default profile
Change the name of the default profile dumped by compiler-rt to
default.profraw.  This distinguishes it more clearly from the
(incompatible) format output by llvm-profdata that is read by clang
-fprofile-instr-use.

llvm-svn: 204676
2014-03-24 21:53:42 +00:00
Dmitry Vyukov d23118c3b2 tsan: optimize vector clock operations
Make vector clock operations O(1) for several important classes of use cases.
See comments for details.
Below are stats from a large server app, 77% of all clock operations are handled as O(1).

Clock acquire                     :         25983645
  empty clock                     :          6288080
  fast from release-store         :         14917504
  contains my tid                 :          4515743
  repeated (fast)                 :          2141428
  full (slow)                     :          2636633
  acquired something              :          1426863
Clock release                     :          2544216
  resize                          :             6241
  fast1                           :           197693
  fast2                           :          1016293
  fast3                           :             2007
  full (slow)                     :          1797488
  was acquired                    :           709227
  clear tail                      :                1
  last overflow                   :                0
Clock release store               :          3446946
  resize                          :           200516
  fast                            :           469265
  slow                            :          2977681
  clear tail                      :                0
Clock acquire-release             :           820028

llvm-svn: 204656
2014-03-24 18:54:20 +00:00
Dmitry Vyukov f49921ba53 tsan: reorder SyncVar members to reduce contention
llvm-svn: 204655
2014-03-24 18:51:37 +00:00
Dmitry Vyukov 781eca5f71 tsan: use read lock instead of write in atomic operations when possible
llvm-svn: 204654
2014-03-24 18:51:13 +00:00
Alexey Samsonov c41ca6d31a [CMake] Rename the variable
llvm-svn: 204602
2014-03-24 13:29:20 +00:00
Timur Iskhodzhanov 59ce9e07a4 Fix a VS compile-time warning
warning C4345: behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized

llvm-svn: 204597
2014-03-24 10:47:37 +00:00
Viktor Kutuzov 276fefb8d9 A fix for sanitizers' TLS support on FreeBSD
llvm-svn: 204595
2014-03-24 10:01:54 +00:00
Alexey Samsonov 1847401332 [CMake] Respect CMAKE_CXX_FLAGS in custom clang_compile commands
llvm-svn: 204593
2014-03-24 09:42:12 +00:00
Alexey Samsonov 8c956460d3 Make MSan unittest -Werror=sign-compare clean
llvm-svn: 204592
2014-03-24 09:41:11 +00:00
Evgeniy Stepanov ce002ad3b2 [asan] Disable setjmp/sigsetjmp tests.
Failing due to PR19207.

llvm-svn: 204590
2014-03-24 08:30:59 +00:00
Evgeniy Stepanov d7f06ee3c7 [asan] Fix a comment.
llvm-svn: 204589
2014-03-24 08:27:31 +00:00
Duncan P. N. Exon Smith 96cf6c3892 InstrProf: Indicate pointer size in raw profile
Since the profile can come from 32-bit machines, the reader needs to
check the pointer size.  Change the magic number to facilitate this.

<rdar://problem/16400648>

llvm-svn: 204556
2014-03-23 03:38:05 +00:00
David Blaikie 089b5c9174 Avoid GCC's "cast from pointer to integer of different size" warning.
This is a bit of a stab in the dark as I'm not sure I've got these
source files compiling correctly locally. (and the warning only
reproduces on a 32bit build anyway)

llvm-svn: 204521
2014-03-21 21:45:49 +00:00
Duncan P. N. Exon Smith 8d02a2ac21 InstrProf: Remove MSVC-specific logic
Apparently, MSVC has stdint.h now?  Let's see if the buildbots complain.
I'm not convinced that the build system is even set up for MSVC to build
this file, but...

llvm-svn: 204515
2014-03-21 20:59:08 +00:00
Duncan P. N. Exon Smith a128956243 InstrProf: Change magic number to have non-text characters
Include non-text characters in the magic number so that text files can't
match.

<rdar://problem/15950346>

llvm-svn: 204514
2014-03-21 20:42:40 +00:00
Duncan P. N. Exon Smith f1c9361326 InstrProf: __ => _ in header guards
llvm-svn: 204502
2014-03-21 18:47:23 +00:00
Duncan P. N. Exon Smith 812dcae09c InstrProf: Unify logic in two profile writers
<rdar://problem/15943240>

llvm-svn: 204500
2014-03-21 18:29:24 +00:00
Duncan P. N. Exon Smith 117cf2bd1f InstrProf: Write the __llvm_profile_write_buffer()
Write __llvm_profile_write_buffer(), which uses the same logic as
__llvm_profile_write_file(), but writes directly to a provided `char*`
buffer instead.

<rdar://problem/15943240>

llvm-svn: 204499
2014-03-21 18:29:22 +00:00
Duncan P. N. Exon Smith cf4bb960bd InstrProf: If libc is available, use it; no functionality change
It was misguided to plan to rely on __llvm_profile_write_buffer() in
__llvm_profile_write_file().  It's less complex to duplicate the writing
logic than to mmap the file.

Since it's here to stay, move `FILE*`-based writing logic into
InstrProfilingFile.c.

<rdar://problem/15943240>

llvm-svn: 204498
2014-03-21 18:29:19 +00:00
Duncan P. N. Exon Smith be0a5e176b InstrProf: Reorganize files; no functionality change
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
2014-03-21 18:29:15 +00:00
Duncan P. N. Exon Smith 76e8731b09 InstrProf: Write raw binary profile from runtime
Write a raw binary profile from the runtime.

<rdar://problem/15950346>

llvm-svn: 204495
2014-03-21 18:25:56 +00:00
Alexander Potapenko 25e204e194 [libsanitizer] Add descriptions for the common flags.
Use new(allocator_for_flags) instead of allocator_for_flags.Allocate()
Fix the description output format a bit.

llvm-svn: 204484
2014-03-21 17:28:12 +00:00
Kostya Serebryany 3df5d87da4 [sanitizer] print threads in deadlock report
llvm-svn: 204461
2014-03-21 13:00:18 +00:00
Kostya Serebryany 7317d9499b [sanitizer] more human-readable deadlock reports
llvm-svn: 204454
2014-03-21 11:37:43 +00:00
Sergey Matveev fa76f3b3a5 [MSan] Add __msan_unpoison_string() to the public interface.
Using __msan_unpoison() on null-terminated strings is awkward because
strlen() can't be called on a poisoned string. This case warrants a special
interface function.

llvm-svn: 204448
2014-03-21 10:12:17 +00:00
Alexander Potapenko c6afaace15 [ASan] Move the flag descriptions from comments to ParseFlag arguments.
llvm-svn: 204440
2014-03-21 08:37:59 +00:00
Greg Fitzgerald 8288afb5fe fixed check_lint.sh in standalone build
Change-Id: I30d340bbe6b2028cc0f831399b62521912dcac60
llvm-svn: 204419
2014-03-21 00:45:21 +00:00
Duncan P. N. Exon Smith 4543aac96e PGO: Indicate errors in profile runtime API
Return 0 for success, non-0 for failure.

llvm-svn: 204415
2014-03-21 00:27:50 +00:00
Duncan P. N. Exon Smith e5edc8869b PGO: Substitute pid for %p in filename
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
2014-03-21 00:27:48 +00:00
Duncan P. N. Exon Smith 71704754d6 PGO: Declare zero-argument C functions as foo(void)
It turns out this is C code.  Specify foo(void).

<rdar://problem/15943240>

llvm-svn: 204396
2014-03-20 20:55:00 +00:00
Duncan P. N. Exon Smith 9edbae0f16 PGO: Change runtime prefix from pgo to profile
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
2014-03-20 20:00:44 +00:00
Duncan P. N. Exon Smith f1212176ac PGO: Add function to reset counters at runtime
Adding __llvm_pgo_reset_counters(), which sets all the counters to 0.

<rdar://problem/15943240>

llvm-svn: 204386
2014-03-20 19:44:31 +00:00
Duncan P. N. Exon Smith c962cda1db PGO: Add missing file...
llvm-svn: 204384
2014-03-20 19:39:01 +00:00
Duncan P. N. Exon Smith 54cc0e2d81 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>

llvm-svn: 204381
2014-03-20 19:23:55 +00:00
Duncan P. N. Exon Smith 775c178a90 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>

llvm-svn: 204380
2014-03-20 19:23:53 +00:00
Duncan P. N. Exon Smith 9cee5e0e92 PGO: Moving files for clarity
<rdar://problem/15943240>

llvm-svn: 204373
2014-03-20 18:43:09 +00:00
Alexander Potapenko d23359c3e3 [libsanitizer] Implement IntrusiveList<T>::Iterator, use IntrusiveList in sanitizer_flags.cc
llvm-svn: 204342
2014-03-20 13:49:21 +00:00
Alexander Potapenko 1296436cbf [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.

llvm-svn: 204339
2014-03-20 12:52:52 +00:00