8000 GH-131278: Add option to build with computed gotos on Windows with cl… · python/cpython@468a7aa · GitHub
[go: up one dir, main page]

Skip to content

Commit 468a7aa

Browse files
authored
GH-131278: Add option to build with computed gotos on Windows with clang-cl (GH-131279)
1 parent 94f4d87 commit 468a7aa

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add optimizing flag ``WITH_COMPUTED_GOTOS`` to Windows builds for when
2+
using a compiler that supports it (currently clang-cl). Patch by Chris Eibl.

PCbuild/pythoncore.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
<PreprocessorDefinitions Condition="'$(UseJIT)' == 'true'">_Py_JIT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
108108
<PreprocessorDefinitions Condition="'$(UseTIER2)' != '' and '$(UseTIER2)' != '0'">_Py_TIER2=$(UseTIER2);%(PreprocessorDefinitions)</PreprocessorDefinitions>
109109
<PreprocessorDefinitions Condition="'$(UseTailCallInterp)' == 'true'">Py_TAIL_CALL_INTERP=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
110+
<PreprocessorDefinitions Condition="'$(WITH_COMPUTED_GOTOS)' != ''">HAVE_COMPUTED_GOTOS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
110111
</ClCompile>
111112
<Link>
112113
<AdditionalDependencies>version.lib;ws2_32.lib;pathcch.lib;bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>

PCbuild/readme.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,27 @@ See
310310
for more on this topic.
311311

312312

313+
Optimization flags
314+
------------------
315+
316+
You can set optimization flags either via
317+
318+
* environment variables, for example:
319+
320+
set WITH_COMPUTED_GOTOS=true
321+
322+
* or pass them as parameters to `build.bat`, for example:
323+
324+
build.bat "/p:WITH_COMPUTED_GOTOS=true"
325+
326+
* or put them in `msbuild.rsp` in the `PCbuild` directory, one flag per line.
327+
328+
Supported flags are:
329+
330+
* WITH_COMPUTED_GOTOS: build the interpreter using "computed gotos".
331+
Currently only supported by clang-cl.
332+
333+
313334
Static library
314335
--------------
315336

0 commit comments

Comments
 (0)
0