-
-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows: optimize binary size; don't embed translations hash table
The MSVC toolchain is embedding translation_table_const_hash_table into the .exe file. (Other toolchains seem to not embed the table into the final executable.) The whole point of translation_table_const_hash_table is that it should not be embedded. Tweak translation_table_const_hash_table to be declared in a consteval function. This forces the compiler to evaluate it at compile time only. This seems to remove the table from the Windows .exe, shrinking the .exe significantly. This commit should not change behavior.
- Loading branch information
Showing
7 changed files
with
2,136 additions
and
2,075 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (C) 2020 Matthew "strager" Glazar | ||
// See end of file for extended copyright information. | ||
|
||
#ifndef QUICK_LINT_JS_CONSTEVAL_H | ||
#define QUICK_LINT_JS_CONSTEVAL_H | ||
|
||
#include <quick-lint-js/have.h> | ||
|
||
#if QLJS_HAVE_CONSTEVAL | ||
#define QLJS_CONSTEVAL consteval | ||
#else | ||
#define QLJS_CONSTEVAL constexpr | ||
#endif | ||
|
||
#endif | ||
|
||
// quick-lint-js finds bugs in JavaScript programs. | ||
// Copyright (C) 2020 Matthew "strager" Glazar | ||
// | ||
// This file is part of quick-lint-js. | ||
// | ||
// quick-lint-js is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// quick-lint-js is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with quick-lint-js. If not, see <https://www.gnu.org/licenses/>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.