• Home
  • Raw
  • Download

Lines Matching +full:- +full:fno +full:- +full:sanitize +full:- +full:recover

16 if (CMAKE_LINKER MATCHES "lld-link.exe")
27 add_definitions( -D_DEBUG )
29 # On non-Debug builds cmake automatically defines NDEBUG, so we
32 add_definitions( -UNDEBUG )
41 string (REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " "
48 add_definitions(-DEXPENSIVE_CHECKS)
49 add_definitions(-D_GLIBCXX_DEBUG)
99 # Darwin-specific linker flags for loadable modules.
100 …set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-flat_namespace -Wl,-undefined -Wl…
103 # Pass -Wl,-z,defs. This makes sure all symbols are defined. Otherwise a DSO
109 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs")
128 check_c_compiler_flag("-Werror ${flag}" "C_SUPPORTS_${name}")
130 check_cxx_compiler_flag("-Werror ${flag}" "CXX_SUPPORTS_${name}")
135 check_c_compiler_flag("-Werror ${flag}" "C_SUPPORTS_${name}")
136 check_cxx_compiler_flag("-Werror ${flag}" "CXX_SUPPORTS_${name}")
149 # Xcode has -mdynamic-no-pic on by default, which overrides -fPIC. I don't
151 message(WARNING "-fPIC not supported with Xcode.")
153 # On Windows all code is PIC. MinGW warns if -fPIC is used.
155 add_flag_or_print_warning("-fPIC" FPIC)
160 # MinGW warns if -fvisibility-inlines-hidden is used.
161 check_cxx_compiler_flag("-fvisibility-inlines-hidden" SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG)
162 append_if(SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG "-fvisibility-inlines-hidden" CMAKE_CXX_FLAGS)
169 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
170 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
171 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32")
172 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32")
173 set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -m32")
178 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
225 add_llvm_definitions("-D_DEBUG_POINTER_IMPL=")
238 add_llvm_definitions(-D_VARIADIC_MAX=10)
244 -D_CRT_SECURE_NO_DEPRECATE
245 -D_CRT_SECURE_NO_WARNINGS
246 -D_CRT_NONSTDC_NO_DEPRECATE
247 -D_CRT_NONSTDC_NO_WARNINGS
248 -D_SCL_SECURE_NO_DEPRECATE
249 -D_SCL_SECURE_NO_WARNINGS
254 -DUNICODE
255 -D_UNICODE
260-wd4141 # Suppress ''modifier' : used more than once' (because of __forceinline combined with inli…
261 -wd4146 # Suppress 'unary minus operator applied to unsigned type, result still unsigned'
262 -wd4180 # Suppress 'qualifier applied to function type has no meaning; ignored'
263 -wd4244 # Suppress ''argument' : conversion from 'type1' to 'type2', possible loss of data'
264-wd4258 # Suppress ''var' : definition from the for loop is ignored; the definition from the enclo…
265 -wd4267 # Suppress ''var' : conversion from 'size_t' to 'type', possible loss of data'
266-wd4291 # Suppress ''declaration' : no matching operator delete found; memory will not be freed if…
267-wd4345 # Suppress 'behavior change: an object of POD type constructed with an initializer of the …
268 -wd4351 # Suppress 'new behavior: elements of array 'array' will be default initialized'
269 -wd4355 # Suppress ''this' : used in base member initializer list'
270 -wd4456 # Suppress 'declaration of 'var' hides local variable'
271 -wd4457 # Suppress 'declaration of 'var' hides function parameter'
272 -wd4458 # Suppress 'declaration of 'var' hides class member'
273 -wd4459 # Suppress 'declaration of 'var' hides global declaration'
274 -wd4503 # Suppress ''identifier' : decorated name length exceeded, name was truncated'
275-wd4624 # Suppress ''derived class' : destructor could not be generated because a base class destr…
276 -wd4722 # Suppress 'function' : destructor never returns, potential memory leak
277 -wd4800 # Suppress ''type' : forcing value to bool 'true' or 'false' (performance warning)'
278 -wd4100 # Suppress 'unreferenced formal parameter'
279 -wd4127 # Suppress 'conditional expression is constant'
280 -wd4512 # Suppress 'assignment operator could not be generated'
281 -wd4505 # Suppress 'unreferenced local function has been removed'
282 -wd4610 # Suppress '<class> can never be instantiated'
283 -wd4510 # Suppress 'default constructor could not be generated'
284 -wd4702 # Suppress 'unreachable code'
285 -wd4245 # Suppress 'signed/unsigned mismatch'
286 -wd4706 # Suppress 'assignment within conditional expression'
287 -wd4310 # Suppress 'cast truncates constant value'
288 -wd4701 # Suppress 'potentially uninitialized local variable'
289 -wd4703 # Suppress 'potentially uninitialized local pointer variable'
290 -wd4389 # Suppress 'signed/unsigned mismatch'
291 -wd4611 # Suppress 'interaction between '_setjmp' and C++ object destruction is non-portable'
292 -wd4805 # Suppress 'unsafe mix of type <type> and type <type> in operation'
293 -wd4204 # Suppress 'nonstandard extension used : non-constant aggregate initializer'
294-wd4577 # Suppress 'noexcept used with no exception handling mode specified; termination on except…
295 -wd4091 # Suppress 'typedef: ignored on left of '' when no variable is declared'
297 # Update 1. Re-evaluate the usefulness of this diagnostic with Update 2.
298 -wd4592 # Suppress ''var': symbol will be dynamically initialized (implementation limitation)
299 -wd4319 # Suppress ''operator' : zero extending 'type' to 'type' of greater size'
306 # specifier (MSVC 2015?) this warning can be re-enabled.
307 -wd4324 # Suppress 'structure was padded due to __declspec(align())'
310 -w14062 # Promote 'enumerator in switch of enum is not handled' to level 1 warning.
313 -we4238 # Promote 'nonstandard extension used : class rvalue used as lvalue' to error.
318 # Put /W4 in front of all the -we flags. cl.exe doesn't care, but for
319 # clang-cl having /W4 after the -we flags will re-enable the warnings
320 # disabled by -we.
326 string(REGEX REPLACE " /W[0-4]" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
327 string(REGEX REPLACE " /W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
348 # Disable string literal const->non-const type conversion.
349 # "When specified, the compiler requires strict const-qualification
361 # clang-cl and cl by default produce non-deterministic binaries because
362 # link.exe /incremental requires a timestamp in the .obj file. clang-cl
379 if (${linker_flag_idx} GREATER -1)
380 …message(WARNING "/Brepro not compatible with /INCREMENTAL linking - builds will be non-determinist…
389 check_c_compiler_flag("/WX /Zc:sizedDealloc-" SUPPORTS_SIZED_DEALLOC)
390 append_if(SUPPORTS_SIZED_DEALLOC "/Zc:sizedDealloc-" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
394 append("-Wall -W -Wno-unused-parameter -Wwrite-strings" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
395 append("-Wcast-qual" CMAKE_CXX_FLAGS)
400 …check_cxx_compiler_flag("-Wmissing-field-initializers" CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLA…
403 append("-Wno-missing-field-initializers" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
405 append("-Wmissing-field-initializers" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
409 append_if(LLVM_ENABLE_PEDANTIC "-pedantic" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
410 append_if(LLVM_ENABLE_PEDANTIC "-Wno-long-long" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
411 add_flag_if_supported("-Wcovered-switch-default" COVERED_SWITCH_DEFAULT_FLAG)
412 append_if(USE_NO_UNINITIALIZED "-Wno-uninitialized" CMAKE_CXX_FLAGS)
413 append_if(USE_NO_MAYBE_UNINITIALIZED "-Wno-maybe-uninitialized" CMAKE_CXX_FLAGS)
415 # Check if -Wnon-virtual-dtor warns even though the class is marked final.
417 # This also catches cases when -Wnon-virtual-dtor isn't supported by
419 # incorrectly identify a protected non-virtual base when there is a friend
423 set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=c++11 -Werror=non-virtual-dtor")
430 "-Wnon-virtual-dtor" CMAKE_CXX_FLAGS)
433 # Enable -Wdelete-non-virtual-dtor if available.
434 add_flag_if_supported("-Wdelete-non-virtual-dtor" DELETE_NON_VIRTUAL_DTOR_FLAG)
436 # Check if -Wcomment is OK with an // comment ending with '\' if the next
439 set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror -Wcomment")
444 append("-Wno-comment" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
447 append_if(LLVM_ENABLE_WERROR "-Werror" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
448 add_flag_if_supported("-Werror=date-time" WERROR_DATE_TIME)
450 check_cxx_compiler_flag("-std=c++1y" CXX_SUPPORTS_CXX1Y)
451 append_if(CXX_SUPPORTS_CXX1Y "-std=c++1y" CMAKE_CXX_FLAGS)
453 check_cxx_compiler_flag("-std=c++11" CXX_SUPPORTS_CXX11)
458 append("-std=gnu++11" CMAKE_CXX_FLAGS)
460 append("-std=c++11" CMAKE_CXX_FLAGS)
463 message(FATAL_ERROR "LLVM requires C++11 support but the '-std=c++11' flag isn't supported.")
468 set(module_flags "-fmodules -fmodules-cache-path=module.cache")
470 # On Darwin -fmodules does not imply -fcxx-modules.
471 set(module_flags "${module_flags} -fcxx-modules")
474 set(module_flags "${module_flags} -Xclang -fmodules-local-submodule-visibility")
479 set(module_flags "${module_flags} -gmodules")
502 # Append -fno-omit-frame-pointer and turn on debug info to get better
504 add_flag_if_supported("-fno-omit-frame-pointer" FNO_OMIT_FRAME_POINTER)
507 add_flag_if_supported("-gline-tables-only" GLINE_TABLES_ONLY)
509 # Use -O1 even in debug mode, otherwise sanitizers slowdown is too large.
511 add_flag_if_supported("-O1" O1)
515 append("/Oy-" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
516 if (CMAKE_LINKER MATCHES "lld-link.exe")
518 append("-gdwarf" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
524 append("-debug" CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
533 append("-fsanitize=address" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
536 append("-fsanitize=memory" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
538 append("-fsanitize-memory-track-origins" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
542 append("-fsanitize=undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all"
546 append("-fsanitize=thread" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
550 append("-fsanitize=address,undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all"
558 append("-fsanitize=address" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
566 …append("-fsanitize-coverage=edge,indirect-calls,8bit-counters,trace-cmp" CMAKE_C_FLAGS CMAKE_CXX_F…
570 # Turn on -gsplit-dwarf if requested
572 add_definitions("-gsplit-dwarf")
575 add_llvm_definitions( -D__STDC_CONSTANT_MACROS )
576 add_llvm_definitions( -D__STDC_FORMAT_MACROS )
577 add_llvm_definitions( -D__STDC_LIMIT_MACROS )
583 append("-fcolor-diagnostics" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
593 check_c_compiler_flag("-Werror -fno-function-sections" C_SUPPORTS_FNO_FUNCTION_SECTIONS)
595 # Don't add -ffunction-section if it can be disabled with -fno-function-sections.
597 add_flag_if_supported("-ffunction-sections" FFUNCTION_SECTIONS)
599 add_flag_if_supported("-fdata-sections" FDATA_SECTIONS)
607 # CL.EXE complains to override flags like "/GR /GR-".
608 string(REGEX REPLACE "(^| ) */EH[-cs]+ *( |$)" "\\1 \\2" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
609 string(REGEX REPLACE "(^| ) */GR-? *( |$)" "\\1 \\2" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
621 append_if(LLVM_BUILD_INSTRUMENTED "-fprofile-instr-generate='${LLVM_PROFILE_FILE_PATTERN}'"
629 …ppend_if(LLVM_BUILD_INSTRUMENTED_COVERAGE "-fprofile-instr-generate='${LLVM_PROFILE_FILE_PATTERN}'…
638 append("-flto=thin" CMAKE_CXX_FLAGS CMAKE_C_FLAGS
641 append("-flto=full" CMAKE_CXX_FLAGS CMAKE_C_FLAGS
644 append("-flto" CMAKE_CXX_FLAGS CMAKE_C_FLAGS