OpenVDB: CompilerOptions.h Source File

OpenVDB 8.1.0

CompilerOptions.h
Go to the documentation of this file.
1 // Copyright Contributors to the OpenVDB Project
2 // SPDX-License-Identifier: MPL-2.0
3
10
11 #ifndef OPENVDB_AX_COMPILER_COMPILER_OPTIONS_HAS_BEEN_INCLUDED
12 #define OPENVDB_AX_COMPILER_COMPILER_OPTIONS_HAS_BEEN_INCLUDED
13
14 #include <openvdb/openvdb.h>
15 #include <openvdb/version.h>
16
17 namespace openvdb {
18 OPENVDB_USE_VERSION_NAMESPACE
19 namespace OPENVDB_VERSION_NAME {
20
21 namespace ax {
22
24 struct FunctionOptions
25 {
36 bool mConstantFoldCBindings = true;
39 bool mPrioritiseIR = true;
43 bool mLazyFunctions = true;
44 };
45
47 struct CompilerOptions
48 {
50 enum class OptLevel
51 {
52 NONE, // Do not run any optimization passes
53 O0, // Optimization level 0. Similar to clang -O0
54 O1, // Optimization level 1. Similar to clang -O1
55 O2, // Optimization level 2. Similar to clang -O2
56 Os, // Like -O2 with extra optimizations for size. Similar to clang -Os
57 Oz, // Like -Os but reduces code size further. Similar to clang -Oz
58 O3 // Optimization level 3. Similar to clang -O3
59 };
60
61 OptLevel mOptLevel = OptLevel::O3;
62
65 bool mVerify = true;
67 FunctionOptions mFunctionOptions = FunctionOptions();
68 };
69
70 } // namespace ax
71 } // namespace OPENVDB_VERSION_NAME
72 } // namespace openvdb
73
74 #endif // OPENVDB_AX_COMPILER_FUNCTION_REGISTRY_OPTIONS_HAS_BEEN_INCLUDED
75
openvdb::v8_1::points::index::NONE
@ NONE
Definition: IndexIterator.h:42
openvdb
Definition: openvdb/Exceptions.h:13
openvdb.h
openvdb::v8_1::ax::CompilerOptions
Settings which control how a Compiler class object behaves.
Definition: CompilerOptions.h:48
openvdb::v8_1::ax::CompilerOptions::OptLevel
OptLevel
Controls the llvm compiler optimization level.
Definition: CompilerOptions.h:51
openvdb::v8_1::ax::FunctionOptions
Options that control how functions behave.
Definition: CompilerOptions.h:25
OPENVDB_VERSION_NAME
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h.in:116
OPENVDB_USE_VERSION_NAMESPACE
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h.in:178