Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
d4365f30
Commit
d4365f30
authored
Jan 05, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X debug_trace_code_generation
parent
6eab2742
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
7 deletions
+75
-7
Cython/Compiler/DebugFlags.py
Cython/Compiler/DebugFlags.py
+1
-1
t/sum.c
t/sum.c
+74
-6
No files found.
Cython/Compiler/DebugFlags.py
View file @
d4365f30
...
...
@@ -9,7 +9,7 @@ debug_coercion = 0
debug_temp_code_comments
=
0
# Write a call trace of the code generation phase into the C code.
debug_trace_code_generation
=
0
debug_trace_code_generation
=
1
# Do not replace exceptions with user-friendly error messages.
debug_no_exception_intercept
=
0
...
...
t/sum.c
View file @
d4365f30
...
...
@@ -8,6 +8,7 @@
#error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_25_2"
/* -> ModuleNode._put_setup_code (1, 0) */
#include <stddef.h>
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
...
...
@@ -372,6 +373,8 @@
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
/* <- ModuleNode._put_setup_code (1, 0) */
/* -> ModuleNode._put_setup_code (1, 0) */
#ifndef CYTHON_INLINE
#if defined(__clang__)
#define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
...
...
@@ -386,6 +389,8 @@
#endif
#endif
/* <- ModuleNode._put_setup_code (1, 0) */
/* -> ModuleNode._put_setup_code (1, 0) */
#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
...
...
@@ -405,6 +410,7 @@ static CYTHON_INLINE float __PYX_NAN() {
#define __Pyx_truncl truncl
#endif
/* <- ModuleNode._put_setup_code (1, 0) */
#define __PYX_ERR(f_index, lineno, Ln_error) \
{ \
...
...
@@ -419,6 +425,7 @@ static CYTHON_INLINE float __PYX_NAN() {
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
#endif
/* -> ModuleNode.generate_extern_c_macro_definition (1, 0) */
#ifndef __PYX_EXTERN_C
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
...
...
@@ -426,6 +433,7 @@ static CYTHON_INLINE float __PYX_NAN() {
#define __PYX_EXTERN_C extern
#endif
#endif
/* <- ModuleNode.generate_extern_c_macro_definition (1, 0) */
#define __PYX_HAVE__sum
#define __PYX_HAVE_API__sum
...
...
@@ -622,10 +630,12 @@ static int __pyx_clineno = 0;
static
const
char
*
__pyx_cfilenm
=
__FILE__
;
static
const
char
*
__pyx_filename
;
/* -> ModuleNode.generate_filename_table (1, 0) */
static
const
char
*
__pyx_f
[]
=
{
"sum.pyx"
,
};
/* <- ModuleNode.generate_filename_table (1, 0) */
/*--- Type declarations ---*/
...
...
@@ -777,7 +787,9 @@ static PyObject *__pyx_int_0;
*
*/
/* -> CFuncDefNode.generate_function_header (1, 5) */
static
int
__pyx_f_3sum_sumupto
(
int
__pyx_v_n
)
{
/* <- CFuncDefNode.generate_function_header (1, 5) */
PyObject
*
__pyx_v_res
=
0
;
int
__pyx_r
;
__Pyx_RefNannyDeclarations
...
...
@@ -786,6 +798,7 @@ static int __pyx_f_3sum_sumupto(int __pyx_v_n) {
PyObject
*
__pyx_t_3
=
NULL
;
int
__pyx_t_4
;
__Pyx_RefNannySetupContext
(
"sumupto"
,
0
);
/* -> StatListNode.generate_execution_code (2, 4) */
/* "sum.pyx":2
* cdef int sumupto(int n):
...
...
@@ -793,8 +806,14 @@ static int __pyx_f_3sum_sumupto(int __pyx_v_n) {
*
* while n > 0:
*/
/* -> SingleAssignmentNode.generate_execution_code (2, 9) */
/* -> SingleAssignmentNode.generate_assignment_code (2, 9) */
/* -> IntNode.make_owned_reference (2, 15) */
__Pyx_INCREF
(
__pyx_int_0
);
/* <- IntNode.make_owned_reference (2, 15) */
__pyx_v_res
=
__pyx_int_0
;
/* <- SingleAssignmentNode.generate_assignment_code (2, 9) */
/* <- SingleAssignmentNode.generate_execution_code (2, 9) */
/* "sum.pyx":4
* cdef res = 0
...
...
@@ -803,9 +822,15 @@ static int __pyx_f_3sum_sumupto(int __pyx_v_n) {
* res += n
* n -= 1
*/
/* -> WhileStatNode.generate_execution_code (4, 4) */
while
(
1
)
{
/* -> CoerceToTempNode.generate_evaluation_code (4, 12) */
/* -> CoerceToTempNode.generate_result_code (4, 12) */
__pyx_t_1
=
((
__pyx_v_n
>
0
)
!=
0
);
/* <- CoerceToTempNode.generate_result_code (4, 12) */
/* <- CoerceToTempNode.generate_evaluation_code (4, 12) */
if
(
!
__pyx_t_1
)
break
;
/* -> StatListNode.generate_execution_code (5, 8) */
/* "sum.pyx":5
*
...
...
@@ -814,13 +839,37 @@ static int __pyx_f_3sum_sumupto(int __pyx_v_n) {
* n -= 1
*
*/
/* -> SingleAssignmentNode.generate_execution_code (5, 12) */
/* -> SingleAssignmentNode.generate_rhs_evaluation_code (5, 12) */
/* -> AddNode.generate_evaluation_code (5, 12) */
/* -> AddNode.generate_evaluation_code (5, 12) */
/* -> AddNode.generate_subexpr_evaluation_code (5, 12) */
/* -> CoerceToPyTypeNode.generate_evaluation_code (5, 16) */
/* -> CoerceToPyTypeNode.generate_result_code (5, 16) */
__pyx_t_2
=
__Pyx_PyInt_From_int
(
__pyx_v_n
);
if
(
unlikely
(
!
__pyx_t_2
))
__PYX_ERR
(
0
,
5
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_2
);
/* <- CoerceToPyTypeNode.generate_result_code (5, 16) */
/* <- CoerceToPyTypeNode.generate_evaluation_code (5, 16) */
/* <- AddNode.generate_subexpr_evaluation_code (5, 12) */
/* -> AddNode.generate_result_code (5, 12) */
__pyx_t_3
=
PyNumber_InPlaceAdd
(
__pyx_v_res
,
__pyx_t_2
);
if
(
unlikely
(
!
__pyx_t_3
))
__PYX_ERR
(
0
,
5
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_3
);
/* <- AddNode.generate_result_code (5, 12) */
/* -> AddNode.generate_subexpr_disposal_code (5, 12) */
/* -> CoerceToPyTypeNode.generate_disposal_code (5, 16) */
__Pyx_DECREF
(
__pyx_t_2
);
__pyx_t_2
=
0
;
/* <- CoerceToPyTypeNode.generate_disposal_code (5, 16) */
/* <- AddNode.generate_subexpr_disposal_code (5, 12) */
/* <- AddNode.generate_evaluation_code (5, 12) */
/* <- AddNode.generate_evaluation_code (5, 12) */
/* <- SingleAssignmentNode.generate_rhs_evaluation_code (5, 12) */
/* -> SingleAssignmentNode.generate_assignment_code (5, 12) */
__Pyx_DECREF_SET
(
__pyx_v_res
,
__pyx_t_3
);
/* -> AddNode.generate_post_assignment_code (5, 12) */
__pyx_t_3
=
0
;
/* <- AddNode.generate_post_assignment_code (5, 12) */
/* <- SingleAssignmentNode.generate_assignment_code (5, 12) */
/* <- SingleAssignmentNode.generate_execution_code (5, 12) */
/* "sum.pyx":6
* while n > 0:
...
...
@@ -829,17 +878,30 @@ static int __pyx_f_3sum_sumupto(int __pyx_v_n) {
*
* return res
*/
/* -> SingleAssignmentNode.generate_execution_code (6, 10) */
/* -> SingleAssignmentNode.generate_assignment_code (6, 10) */
__pyx_v_n
=
(
__pyx_v_n
-
1
);
/* <- SingleAssignmentNode.generate_assignment_code (6, 10) */
/* <- SingleAssignmentNode.generate_execution_code (6, 10) */
/* <- StatListNode.generate_execution_code (5, 8) */
}
/* <- WhileStatNode.generate_execution_code (4, 4) */
/* "sum.pyx":8
* n -= 1
*
* return res # <<<<<<<<<<<<<<
*/
/* -> ReturnStatNode.generate_execution_code (8, 4) */
/* -> CoerceFromPyTypeNode.generate_evaluation_code (8, 14) */
/* -> CoerceFromPyTypeNode.generate_result_code (8, 14) */
__pyx_t_4
=
__Pyx_PyInt_As_int
(
__pyx_v_res
);
if
(
unlikely
((
__pyx_t_4
==
(
int
)
-
1
)
&&
PyErr_Occurred
()))
__PYX_ERR
(
0
,
8
,
__pyx_L1_error
)
/* <- CoerceFromPyTypeNode.generate_result_code (8, 14) */
/* <- CoerceFromPyTypeNode.generate_evaluation_code (8, 14) */
__pyx_r
=
__pyx_t_4
;
goto
__pyx_L0
;
/* <- ReturnStatNode.generate_execution_code (8, 4) */
/* <- StatListNode.generate_execution_code (2, 4) */
/* "sum.pyx":1
* cdef int sumupto(int n): # <<<<<<<<<<<<<<
...
...
@@ -996,16 +1058,22 @@ PyMODINIT_FUNC PyInit_sum(void)
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
if
(
__Pyx_patch_abc
()
<
0
)
__PYX_ERR
(
0
,
1
,
__pyx_L1_error
)
#endif
/* "sum.pyx":1
* cdef int sumupto(int n): # <<<<<<<<<<<<<<
* cdef res = 0
*
*/
/* -> StatListNode.generate_execution_code (1, 5) */
/* -> SingleAssignmentNode.generate_execution_code (1, 0) */
/* -> SingleAssignmentNode.generate_rhs_evaluation_code (1, 0) */
/* -> DictNode.generate_evaluation_code (1, 0) */
__pyx_t_1
=
PyDict_New
();
if
(
unlikely
(
!
__pyx_t_1
))
__PYX_ERR
(
0
,
1
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_1
);
/* <- DictNode.generate_evaluation_code (1, 0) */
/* <- SingleAssignmentNode.generate_rhs_evaluation_code (1, 0) */
/* -> SingleAssignmentNode.generate_assignment_code (1, 0) */
if
(
PyDict_SetItem
(
__pyx_d
,
__pyx_n_s_test
,
__pyx_t_1
)
<
0
)
__PYX_ERR
(
0
,
1
,
__pyx_L1_error
)
/* -> DictNode.generate_disposal_code (1, 0) */
__Pyx_DECREF
(
__pyx_t_1
);
__pyx_t_1
=
0
;
/* <- DictNode.generate_disposal_code (1, 0) */
/* <- SingleAssignmentNode.generate_assignment_code (1, 0) */
/* <- SingleAssignmentNode.generate_execution_code (1, 0) */
/* <- StatListNode.generate_execution_code (1, 5) */
/*--- Wrapped vars code ---*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment