文章目录
-
- `Apple Clang`
-
- `Apple Clang - Address Sanitizer` 清扫
- `Apple Clang - Code Generation` 产生
-
- `Debug Information Level` (CLANG_DEBUG_INFORMATION_LEVEL)
- `Enable Additional Vector Extensions`
- `Enable Code Coverage Support`
- `Enforce Strict Aliasing`
- `Generate Debug Symbols`
- `Generate Legacy Test Coverage Files`
- `Generate Position-Dependent Code`
- `Inline Methods Hidden`
- `Instrument Program Flow`
- `Kernel Development Mode`
- `Link-Time Optimization`
- `Make Strings Read-Only`
- `No Common Blocks`
- `Optimization Level`
- `Optimization Profile File`
- `Apple Clang - Custom Compiler Flags`
- `Apple Clang - Language`
-
- `char Type Is Unsigned`
- `Allow asm, inline, typeof`
- `C Language Dialect`
- `Code Warrior/MS-style Inline Assembly`
- `Compile Sources As`
- `Enable Linking With Shared Libraries`
- `Enable Trigraphs`
- `Generate Floating Point Library Calls`
- `Increase Sharing of Precompiled Headers`
- `Precompile Prefix Header`
- `Prefix Header`
- `Recognize Builtin Functions`
- `Recognize Pascal Strings`
- `Short Enumeration Constants`
- `Use Standard System Header Directory Searching`
- `Apple Clang - Language C++`
- `Apple Clang - Language - Modules`
- `Apple Clang - Language - Objective-C`
- `Apple Clang - Preprocessing`
- Enable Strict Checking of objc_msgSend Calls (ENABLE_STRICT_OBJC_MSGSEND)
- `Apple Clang - Undefined Behavior Sanitizer`
Apple Clang
Apple Clang - Address Sanitizer
清扫
Summary
Check for C++ container overflow when Address Sanitizer is enabled. This check requires the entire application to be built with Address Sanitizer. If not, it may report false positives.
Declaration
CLANG_ADDRESS_SANITIZER_CONTAINER_OVERFLOW
Value Type
Boolean
Apple Clang - Code Generation
产生
Debug Information Level
(CLANG_DEBUG_INFORMATION_LEVEL)
Summary
Toggles the amount of debug information emitted when debug symbols are enabled. This can impact the size of the generated debug information, which may matter in some cases for large projects, such as when using LTO.
Declaration
CLANG_DEBUG_INFORMATION_LEVEL
Value Type
Enumeration (String)
Enable Additional Vector Extensions
Summary
Enables the use of extended vector instructions. Only used when targeting Intel architectures.
Declaration
CLANG_X86_VECTOR_INSTRUCTIONS
Value Type
Enumeration (String)
Enable Code Coverage Support
Summary
Enables building with code coverage instrumentation. This is only used when the build has code coverage enabled, which is typically done via the Xcode scheme settings.
Declaration
CLANG_ENABLE_CODE_COVERAGE
Value Type
Boolean
Enforce Strict Aliasing
Summary
Optimize code by making more aggressive assumptions about whether pointers can point to the same objects as other pointers. Programs that use pointers a lot may benefit from this, but programs that don't strictly follow the ISO C rules about the type with which an object may be accessed may behave unexpectedly.
Declaration
GCC_STRICT_ALIASING
Value Type
Boolean
Generate Debug Symbols
是否生成 Debug
符号文件,生成的时候可以设置 DEBUG_INFORMATION_FORMAT
Summary
Enables or disables generation of debug symbols. When debug symbols are enabled, the level of detail can be controlled by the `DEBUG_INFORMATION_FORMAT` setting.
Declaration
GCC_GENERATE_DEBUGGING_SYMBOLS
Value Type
Boolean
Generate Legacy Test Coverage Files
Summary
Activating this setting causes a `notes` file to be produced that the `gcov` code-coverage utility can use to show program coverage.
Declaration
GCC_GENERATE_TEST_COVERAGE_FILES
Value Type
Boolean
Generate Position-Dependent Code
Summary
Faster function calls for applications. Not appropriate for shared libraries, which need to be position-independent.
Declaration
GCC_DYNAMIC_NO_PIC
Value Type
Boolean
Inline Methods Hidden
Summary
When enabled, out-of-line copies of inline methods are declared `private extern`.
Declaration
GCC_INLINES_ARE_PRIVATE_EXTERN
Value Type
Boolean
Instrument Program Flow
Summary
Activating this setting indicates that code should be added so program flow arcs are instrumented.
Declaration
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS
Value Type
Boolean
Kernel Development Mode
Summary
Activating this setting enables kernel development mode.
Declaration
GCC_ENABLE_KERNEL_DEVELOPMENT
Value Type
Boolean
Link-Time Optimization
Summary
Enabling this setting allows optimization across file boundaries during linking. * *No:* Disabled. Do not use link-time optimization. * *Monolithic Link-Time Optimization:* This mode performs monolithic link-time optimization of binaries, combining all executable code into a single unit and running aggressive compiler optimizations. * *Incremental Link-Time Optimization:* This mode performs partitioned link-time optimization of binaries, inlining between compilation units and running aggressive compiler optimizations on each unit in parallel. This enables fast incremental builds and uses less memory than Monolithic LTO.
Declaration
LLVM_LTO
Value Type
Enumeration (String)
Make Strings Read-Only
字符串常量重复使用,也就是在mach-o中字符串常量是在同一个区域内,使用的时候通过指针查找
Summary
Reuse string literals.
Declaration
GCC_REUSE_STRINGS
Value Type
Boolean
No Common Blocks
Summary
In C, allocate even uninitialized global variables in the data section of the object file, rather than generating them as common blocks. This has the effect that if the same variable is declared (without `extern`) in two different compilations, you will get an error when you link them.
Declaration
GCC_NO_COMMON_BLOCKS
Value Type
Boolean
例子
GCC_NO_COMMON_BLOCKS=YES
Optimization Level
Summary
Specifies the degree to which the generated code is optimized for speed and binary size. * *None:* Do not optimize. [-O0] With this setting, the compiler's goal is to reduce the cost of compilation and to make debugging produce the expected results. Statements are independent—if you stop the program with a breakpoint between statements, you can then assign a new value to any variable or change the program counter to any other statement in the function and get exactly the results you would expect from the source code. * *Fast:* Optimizing compilation takes somewhat more time, and a lot more memory for a large function. [-O1] With this setting, the compiler tries to reduce code size and execution time, without performing any optimizations that take a great deal of compilation time. In Apple's compiler, strict aliasing, block reordering, and inter-block scheduling are disabled by default when optimizing. * *Faster:* The compiler performs nearly all supported optimizations that do not involve a space-speed tradeoff. [-O2] With this setting, the compiler does not perform loop unrolling or function inlining, or register renaming. As compared to the `Fast` setting, this setting increases both compilation time and the performance of the generated code. * *Fastest:* Turns on all optimizations specified by the `Faster` setting and also turns on function inlining and register renaming options. This setting may result in a larger binary. [-O3] * *Fastest, Smallest:* Optimize for size. This setting enables all `Faster` optimizations t