Bug Summary

File:projects/compiler-rt/lib/dfsan/../sanitizer_common/sanitizer_flags.h
Warning:line 21, column 8
Excessive padding in 'struct __sanitizer::CommonFlags' (40 padding bytes, where 0 is optimal). Optimal fields order: external_symbolizer_path, strip_path_prefix, log_path, clear_shadow_mmap_threshold, color, mmap_limit_mb, hard_rss_limit_mb, soft_rss_limit_mb, coverage_dir, stack_trace_format, sancov_path, malloc_context_size, verbosity, print_module_map, allocator_release_to_os_interval_ms, dedup_token_length, exitcode, symbolize, allow_addr2line, fast_unwind_on_check, fast_unwind_on_fatal, fast_unwind_on_malloc, handle_ioctl, log_exe_name, log_to_syslog, detect_leaks, leak_check_at_exit, allocator_may_return_null, print_summary, check_printf, handle_segv, handle_sigbus, handle_abort, handle_sigill, handle_sigfpe, allow_user_segv_handler, use_sigaltstack, detect_deadlocks, legacy_pthread_cond, intercept_tls_get_addr, help, heap_profile, can_use_proc_maps_statm, coverage, coverage_pcs, coverage_order_pcs, coverage_bitset, coverage_counters, coverage_direct, full_address_space, print_suppressions, disable_coredump, use_madv_dontdump, symbolize_inline_frames, symbolize_vs_style, no_huge_pages_for_shadow, strict_string_checks, intercept_strstr, intercept_strspn, intercept_strpbrk, intercept_strlen, intercept_strchr, intercept_memcmp, strict_memcmp, intercept_memmem, intercept_intrin, intercept_stat, intercept_send, decorate_proc_maps, abort_on_error, suppress_equal_pcs, print_cmdline, html_cov_report, consider reordering the fields or adding explicit padding members

Annotated Source Code

1//===-- sanitizer_flags.h ---------------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file is a part of ThreadSanitizer/AddressSanitizer runtime.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef SANITIZER_FLAGS_H
15#define SANITIZER_FLAGS_H
16
17#include "sanitizer_internal_defs.h"
18
19namespace __sanitizer {
20
21struct CommonFlags {
Excessive padding in 'struct __sanitizer::CommonFlags' (40 padding bytes, where 0 is optimal). Optimal fields order: external_symbolizer_path, strip_path_prefix, log_path, clear_shadow_mmap_threshold, color, mmap_limit_mb, hard_rss_limit_mb, soft_rss_limit_mb, coverage_dir, stack_trace_format, sancov_path, malloc_context_size, verbosity, print_module_map, allocator_release_to_os_interval_ms, dedup_token_length, exitcode, symbolize, allow_addr2line, fast_unwind_on_check, fast_unwind_on_fatal, fast_unwind_on_malloc, handle_ioctl, log_exe_name, log_to_syslog, detect_leaks, leak_check_at_exit, allocator_may_return_null, print_summary, check_printf, handle_segv, handle_sigbus, handle_abort, handle_sigill, handle_sigfpe, allow_user_segv_handler, use_sigaltstack, detect_deadlocks, legacy_pthread_cond, intercept_tls_get_addr, help, heap_profile, can_use_proc_maps_statm, coverage, coverage_pcs, coverage_order_pcs, coverage_bitset, coverage_counters, coverage_direct, full_address_space, print_suppressions, disable_coredump, use_madv_dontdump, symbolize_inline_frames, symbolize_vs_style, no_huge_pages_for_shadow, strict_string_checks, intercept_strstr, intercept_strspn, intercept_strpbrk, intercept_strlen, intercept_strchr, intercept_memcmp, strict_memcmp, intercept_memmem, intercept_intrin, intercept_stat, intercept_send, decorate_proc_maps, abort_on_error, suppress_equal_pcs, print_cmdline, html_cov_report, consider reordering the fields or adding explicit padding members
22#define COMMON_FLAG(Type, Name, DefaultValue, Description) Type Name;
23#include "sanitizer_flags.inc"
24#undef COMMON_FLAG
25
26 void SetDefaults();
27 void CopyFrom(const CommonFlags &other);
28};
29
30// Functions to get/set global CommonFlags shared by all sanitizer runtimes:
31extern CommonFlags common_flags_dont_use;
32inline const CommonFlags *common_flags() {
33 return &common_flags_dont_use;
34}
35
36inline void SetCommonFlagsDefaults() {
37 common_flags_dont_use.SetDefaults();
38}
39
40// This function can only be used to setup tool-specific overrides for
41// CommonFlags defaults. Generally, it should only be used right after
42// SetCommonFlagsDefaults(), but before ParseCommonFlagsFromString(), and
43// only during the flags initialization (i.e. before they are used for
44// the first time).
45inline void OverrideCommonFlags(const CommonFlags &cf) {
46 common_flags_dont_use.CopyFrom(cf);
47}
48
49void SubstituteForFlagValue(const char *s, char *out, uptr out_size);
50
51class FlagParser;
52void RegisterCommonFlags(FlagParser *parser,
53 CommonFlags *cf = &common_flags_dont_use);
54void RegisterIncludeFlags(FlagParser *parser, CommonFlags *cf);
55
56// Should be called after parsing all flags. Sets up common flag values
57// and perform initializations common to all sanitizers (e.g. setting
58// verbosity).
59void InitializeCommonFlags(CommonFlags *cf = &common_flags_dont_use);
60} // namespace __sanitizer
61
62#endif // SANITIZER_FLAGS_H