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
85ef47bf
Commit
85ef47bf
authored
Mar 10, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trying to run on more things now
parent
c00c9ac6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
3 deletions
+27
-3
plugins/refcount_checker/refcount_checker.cpp
plugins/refcount_checker/refcount_checker.cpp
+27
-3
No files found.
plugins/refcount_checker/refcount_checker.cpp
View file @
85ef47bf
...
...
@@ -196,6 +196,9 @@ private:
return
false
;
auto
pointed_to
=
t
->
getPointeeType
();
while
(
auto
pt
=
dyn_cast
<
ParenType
>
(
pointed_to
))
pointed_to
=
pt
->
getInnerType
();
if
(
isa
<
BuiltinType
>
(
pointed_to
)
||
isa
<
FunctionType
>
(
pointed_to
))
return
false
;
...
...
@@ -212,6 +215,13 @@ private:
return
NULL
;
}
if
(
isa
<
UnresolvedLookupExpr
>
(
expr
)
||
isa
<
CXXUnresolvedConstructExpr
>
(
expr
)
||
isa
<
CXXDependentScopeMemberExpr
>
(
expr
)
||
isa
<
CXXDependencScopeDeclRefExpr
>
(
expr
))
{
// Not really sure about this:
assert
(
!
isRefcountedType
(
expr
->
getType
()));
return
NULL
;
}
if
(
auto
unaryop
=
dyn_cast
<
UnaryOperator
>
(
expr
))
{
handle
(
unaryop
->
getSubExpr
(),
state
);
ASSERT
(
!
isRefcountedType
(
unaryop
->
getType
()),
"implement me"
);
...
...
@@ -243,6 +253,12 @@ private:
return
state
.
createBorrowed
();
}
if
(
auto
thisexpr
=
dyn_cast
<
CXXThisExpr
>
(
expr
))
{
if
(
!
isRefcountedType
(
thisexpr
->
getType
()))
return
NULL
;
return
state
.
createBorrowed
();
}
if
(
auto
refexpr
=
dyn_cast
<
DeclRefExpr
>
(
expr
))
{
if
(
!
isRefcountedType
(
refexpr
->
getType
()))
{
return
NULL
;
...
...
@@ -280,9 +296,17 @@ private:
if
(
isa
<
BuiltinType
>
(
ft_ptr
))
{
ft
=
NULL
;
}
else
if
(
isa
<
TemplateSpecializationType
>
(
ft_ptr
))
{
// Not really sure about this:
ft
=
NULL
;
}
else
{
ft_ptr
->
dump
();
assert
(
ft_ptr
->
isPointerType
());
ft
=
cast
<
FunctionProtoType
>
(
ft_ptr
->
getPointeeType
());
auto
pointed_to
=
ft_ptr
->
getPointeeType
();
while
(
auto
pt
=
dyn_cast
<
ParenType
>
(
pointed_to
))
pointed_to
=
pt
->
getInnerType
();
assert
(
isa
<
FunctionProtoType
>
(
pointed_to
));
ft
=
cast
<
FunctionProtoType
>
(
pointed_to
);
}
handle
(
callee
,
state
);
...
...
@@ -445,8 +469,8 @@ public:
//errs() << filename << '\n';
if
(
func
->
getNameInfo
().
getAsString
()
!=
"firstlineno"
)
return
true
;
//
if (func->getNameInfo().getAsString() != "firstlineno")
//
return true;
checkFunction
(
func
);
...
...
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