Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
9a5fb2c3
"vscode:/vscode.git/clone" did not exist on "de433392fd627ffed7d35cea366c8309e938207e"
Commit
9a5fb2c3
authored
Dec 01, 2023
by
Paul
Browse files
Format
parent
f583f039
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
17 deletions
+25
-17
tools/cppcheck/migraphx.py
tools/cppcheck/migraphx.py
+25
-17
No files found.
tools/cppcheck/migraphx.py
View file @
9a5fb2c3
...
...
@@ -37,6 +37,7 @@ def getVariableDecl(var):
end
=
end
.
next
return
var
.
typeStartToken
.
forward
(
end
)
def
isFunctionCall
(
token
):
if
not
token
:
return
False
...
...
@@ -48,6 +49,7 @@ def isFunctionCall(token):
return
False
return
True
# def isplit(source, sep=' '):
# sepsize = len(sep)
# start = 0
...
...
@@ -127,6 +129,7 @@ def isFunctionCall(token):
# bindings['end'] = end
# return MatchResult(True, bindings=bindings)
@
cppcheck
.
checker
def
AvoidBranchingStatementAsLastInLoop
(
cfg
,
data
):
for
token
in
cfg
.
tokenlist
:
...
...
@@ -439,7 +442,12 @@ def UseDeviceLaunch(cfg, data):
@
cppcheck
.
checker
def
UseManagePointer
(
cfg
,
data
):
functions
=
{
"fclose"
,
"free"
,
"hipFree"
,
"hipHostFree"
,
"hipFreeArray"
,
"hipMemFree"
,
"hipStreamDestroy"
,
"hipEventDestroy"
,
"hipArrayDestroy"
,
"hipCtxDestroy"
,
"hipDestroyTextureObject"
,
"hipDestroySurfaceObject"
,
"miirDestroyHandle"
}
functions
=
{
"fclose"
,
"free"
,
"hipFree"
,
"hipHostFree"
,
"hipFreeArray"
,
"hipMemFree"
,
"hipStreamDestroy"
,
"hipEventDestroy"
,
"hipArrayDestroy"
,
"hipCtxDestroy"
,
"hipDestroyTextureObject"
,
"hipDestroySurfaceObject"
,
"miirDestroyHandle"
}
for
token
in
cfg
.
tokenlist
:
if
not
isFunctionCall
(
token
):
continue
...
...
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