diff options
| author | gingerBill <bill@gingerbill.org> | 2023-07-31 11:09:19 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-07-31 11:09:19 +0100 |
| commit | 60e509b1e066da14461b3832307065726e651153 (patch) | |
| tree | 24e90b4646dc7a70e24c00ab7154d6bcfc494fe5 /src/build_settings.cpp | |
| parent | 551c379f1bc6fa81f36b0d054eb7a190a27e2c60 (diff) | |
Add separate `-vet` flags; `-vet-using-*` flags; `//+vet` file flags
Diffstat (limited to 'src/build_settings.cpp')
| -rw-r--r-- | src/build_settings.cpp | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/src/build_settings.cpp b/src/build_settings.cpp index 866631f9a..f234ff2ce 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -216,6 +216,37 @@ enum BuildPath : u8 { BuildPathCOUNT, }; +enum VetFlags : u64 { + VetFlag_NONE = 0, + VetFlag_Unused = 1u<<0, + VetFlag_Shadowing = 1u<<1, + VetFlag_UsingStmt = 1u<<2, + VetFlag_UsingParam = 1u<<3, + + VetFlag_Extra = 1u<<16, + + VetFlag_All = VetFlag_Unused|VetFlag_Shadowing|VetFlag_UsingStmt, // excluding extra + + VetFlag_Using = VetFlag_UsingStmt|VetFlag_UsingParam, +}; + +u64 get_vet_flag_from_name(String const &name) { + if (name == "unused") { + return VetFlag_Unused; + } else if (name == "shadowing") { + return VetFlag_Shadowing; + } else if (name == "using-stmt") { + return VetFlag_UsingStmt; + } else if (name == "using-param") { + return VetFlag_UsingParam; + } else if (name == "extra") { + return VetFlag_Extra; + } + return VetFlag_NONE; +} + + + // This stores the information for the specify architecture of this build struct BuildContext { // Constants @@ -255,6 +286,8 @@ struct BuildContext { String resource_filepath; String pdb_filepath; + u64 vet_flags; + bool has_resource; String link_flags; String extra_linker_flags; @@ -280,8 +313,6 @@ struct BuildContext { bool no_entry_point; bool no_thread_local; bool use_lld; - bool vet; - bool vet_extra; bool cross_compiling; bool different_os; bool keep_object_files; |