Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
1228d981
Commit
1228d981
authored
Sep 07, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BST: remove column field
parent
f2365ec7
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
107 deletions
+32
-107
src/analysis/type_analysis.cpp
src/analysis/type_analysis.cpp
+2
-4
src/codegen/unwinding.cpp
src/codegen/unwinding.cpp
+1
-1
src/core/bst.h
src/core/bst.h
+11
-13
src/core/cfg.cpp
src/core/cfg.cpp
+15
-85
src/core/types.h
src/core/types.h
+2
-3
src/runtime/cxx_unwind.cpp
src/runtime/cxx_unwind.cpp
+1
-1
No files found.
src/analysis/type_analysis.cpp
View file @
1228d981
...
...
@@ -219,8 +219,7 @@ private:
}
if
(
VERBOSITY
()
>=
2
&&
rtn
==
UNDEF
)
{
printf
(
"Think %s.%s is undefined, at %d:%d
\n
"
,
t
->
debugName
().
c_str
(),
node
->
attr
.
c_str
(),
node
->
lineno
,
node
->
col_offset
);
printf
(
"Think %s.%s is undefined, at %d
\n
"
,
t
->
debugName
().
c_str
(),
node
->
attr
.
c_str
(),
node
->
lineno
);
print_bst
(
node
);
printf
(
"
\n
"
);
}
...
...
@@ -231,8 +230,7 @@ private:
CompilerType
*
t
=
getType
(
node
->
value
);
CompilerType
*
rtn
=
t
->
getattrType
(
node
->
attr
,
true
);
if
(
VERBOSITY
()
>=
2
&&
rtn
==
UNDEF
)
{
printf
(
"Think %s.%s is undefined, at %d:%d
\n
"
,
t
->
debugName
().
c_str
(),
node
->
attr
.
c_str
(),
node
->
lineno
,
node
->
col_offset
);
printf
(
"Think %s.%s is undefined, at %d
\n
"
,
t
->
debugName
().
c_str
(),
node
->
attr
.
c_str
(),
node
->
lineno
);
print_bst
(
node
);
printf
(
"
\n
"
);
}
...
...
src/codegen/unwinding.cpp
View file @
1228d981
...
...
@@ -490,7 +490,7 @@ static const LineInfo lineInfoForFrameInfo(FrameInfo* frame_info) {
auto
*
code
=
frame_info
->
code
;
assert
(
code
);
return
LineInfo
(
current_stmt
->
lineno
,
c
urrent_stmt
->
col_offset
,
c
ode
->
filename
,
code
->
name
);
return
LineInfo
(
current_stmt
->
lineno
,
code
->
filename
,
code
->
name
);
}
// A class that converts a C stack trace to a Python stack trace.
...
...
src/core/bst.h
View file @
1228d981
...
...
@@ -171,7 +171,7 @@ public:
virtual
~
BST
()
{}
const
BST_TYPE
::
BST_TYPE
type
;
uint32_t
lineno
,
col_offset
;
uint32_t
lineno
;
virtual
void
accept
(
BSTVisitor
*
v
)
=
0
;
...
...
@@ -185,10 +185,9 @@ private:
public:
BST
(
BST_TYPE
::
BST_TYPE
type
);
#else
BST
(
BST_TYPE
::
BST_TYPE
type
)
:
type
(
type
),
lineno
(
0
)
,
col_offset
(
0
)
{}
BST
(
BST_TYPE
::
BST_TYPE
type
)
:
type
(
type
),
lineno
(
0
)
{}
#endif
BST
(
BST_TYPE
::
BST_TYPE
type
,
uint32_t
lineno
,
uint32_t
col_offset
=
0
)
:
type
(
type
),
lineno
(
lineno
),
col_offset
(
col_offset
)
{}
BST
(
BST_TYPE
::
BST_TYPE
type
,
uint32_t
lineno
)
:
type
(
type
),
lineno
(
lineno
)
{}
};
class
BST_expr
:
public
BST
{
...
...
@@ -196,7 +195,7 @@ public:
virtual
void
*
accept_expr
(
ExprVisitor
*
v
)
=
0
;
BST_expr
(
BST_TYPE
::
BST_TYPE
type
)
:
BST
(
type
)
{}
BST_expr
(
BST_TYPE
::
BST_TYPE
type
,
uint32_t
lineno
,
uint32_t
col_offset
=
0
)
:
BST
(
type
,
lineno
,
col_offset
)
{}
BST_expr
(
BST_TYPE
::
BST_TYPE
type
,
uint32_t
lineno
)
:
BST
(
type
,
lineno
)
{}
};
class
BST_stmt
:
public
BST
{
...
...
@@ -212,14 +211,14 @@ class BST_slice : public BST {
public:
virtual
void
*
accept_slice
(
SliceVisitor
*
s
)
=
0
;
BST_slice
(
BST_TYPE
::
BST_TYPE
type
)
:
BST
(
type
)
{}
BST_slice
(
BST_TYPE
::
BST_TYPE
type
,
uint32_t
lineno
,
uint32_t
col_offset
=
0
)
:
BST
(
type
,
lineno
,
col_offset
)
{}
BST_slice
(
BST_TYPE
::
BST_TYPE
type
,
uint32_t
lineno
)
:
BST
(
type
,
lineno
)
{}
};
class
BST_Name
;
class
BST_arguments
:
public
BST
{
public:
// no lineno
, col_offset
attributes
// no lineno attributes
std
::
vector
<
BST_expr
*>
defaults
;
virtual
void
accept
(
BSTVisitor
*
v
);
...
...
@@ -445,7 +444,7 @@ public:
class
BST_keyword
:
public
BST
{
public:
// no lineno
, col_offset
attributes
// no lineno attributes
BST_expr
*
value
;
InternedString
arg
;
...
...
@@ -493,8 +492,8 @@ public:
virtual
void
accept
(
BSTVisitor
*
v
);
virtual
void
*
accept_expr
(
ExprVisitor
*
v
);
BST_Name
(
InternedString
id
,
AST_TYPE
::
AST_TYPE
ctx_type
,
int
lineno
,
int
col_offset
=
0
)
:
BST_expr
(
BST_TYPE
::
Name
,
lineno
,
col_offset
),
BST_Name
(
InternedString
id
,
AST_TYPE
::
AST_TYPE
ctx_type
,
int
lineno
)
:
BST_expr
(
BST_TYPE
::
Name
,
lineno
),
ctx_type
(
ctx_type
),
id
(
id
),
lookup_type
(
ScopeInfo
::
VarScopeType
::
UNKNOWN
),
...
...
@@ -676,8 +675,7 @@ public:
virtual
void
accept
(
BSTVisitor
*
v
);
virtual
void
*
accept_expr
(
ExprVisitor
*
v
);
BST_MakeFunction
(
BST_FunctionDef
*
fd
)
:
BST_expr
(
BST_TYPE
::
MakeFunction
,
fd
->
lineno
,
fd
->
col_offset
),
function_def
(
fd
)
{}
BST_MakeFunction
(
BST_FunctionDef
*
fd
)
:
BST_expr
(
BST_TYPE
::
MakeFunction
,
fd
->
lineno
),
function_def
(
fd
)
{}
static
const
BST_TYPE
::
BST_TYPE
TYPE
=
BST_TYPE
::
MakeFunction
;
};
...
...
@@ -689,7 +687,7 @@ public:
virtual
void
accept
(
BSTVisitor
*
v
);
virtual
void
*
accept_expr
(
ExprVisitor
*
v
);
BST_MakeClass
(
BST_ClassDef
*
cd
)
:
BST_expr
(
BST_TYPE
::
MakeClass
,
cd
->
lineno
,
cd
->
col_offset
),
class_def
(
cd
)
{}
BST_MakeClass
(
BST_ClassDef
*
cd
)
:
BST_expr
(
BST_TYPE
::
MakeClass
,
cd
->
lineno
),
class_def
(
cd
)
{}
static
const
BST_TYPE
::
BST_TYPE
TYPE
=
BST_TYPE
::
MakeClass
;
};
...
...
src/core/cfg.cpp
View file @
1228d981
This diff is collapsed.
Click to expand it.
src/core/types.h
View file @
1228d981
...
...
@@ -997,11 +997,10 @@ void raiseSyntaxErrorHelper(llvm::StringRef file, llvm::StringRef func, AST* nod
// A data structure used for storing information for tracebacks.
struct
LineInfo
{
public:
int
line
,
column
;
int
line
;
BoxedString
*
file
,
*
func
;
LineInfo
(
int
line
,
int
column
,
BoxedString
*
file
,
BoxedString
*
func
)
:
line
(
line
),
column
(
column
),
file
(
file
),
func
(
func
)
{}
LineInfo
(
int
line
,
BoxedString
*
file
,
BoxedString
*
func
)
:
line
(
line
),
file
(
file
),
func
(
func
)
{}
};
// A data structure to simplify passing around all the data about a thrown exception.
...
...
src/runtime/cxx_unwind.cpp
View file @
1228d981
...
...
@@ -361,7 +361,7 @@ static void print_frame(unw_cursor_t* cursor, const unw_proc_info_t* pip) {
if
(
frame_type
==
INTERPRETED
&&
cf
&&
cur_stmt
)
{
auto
source
=
cf
->
code_obj
->
source
.
get
();
// FIXME: dup'ed from lineInfoForFrame
LineInfo
line
(
cur_stmt
->
lineno
,
c
ur_stmt
->
col_offset
,
c
f
->
code_obj
->
filename
,
cf
->
code_obj
->
name
);
LineInfo
line
(
cur_stmt
->
lineno
,
cf
->
code_obj
->
filename
,
cf
->
code_obj
->
name
);
printf
(
" File
\"
%s
\"
, line %d, in %s
\n
"
,
line
.
file
->
c_str
(),
line
.
line
,
line
.
func
->
c_str
());
}
}
...
...
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