Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions parser/fpc-debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def report(proc: int, failed: int):

def reportFailed(failed_list: list):
print('===== FPChcecker Report =====')
print('The following commnads failed:\n')
print('The following commands failed:\n')
for l in failed_list:
print(l)

Expand All @@ -58,7 +58,7 @@ def reportFailed(failed_list: list):
removeFiles(fileList)
if args.failed:
_, _, failed_list = getCommandsStatus(fileList)
reportFailed(failed_list)
reportFailed(failed_list)

else:
proc, failed, _ = getCommandsStatus(fileList)
Expand Down
13 changes: 6 additions & 7 deletions parser/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ def deprocess(self):
dp = Deprocess(self.preFileName, tmpFname)
if verbose(): print('Running de-processor...')
dp.run()
if verbose():
if verbose():
print('... de-preprocessor done.')
print('Deprocessed file:', self.deprocessedFile)
with open(self.deprocessedFile, 'r') as fd:
i = 1
for l in fd:
print("{n:3d}: {line}".format(n=i, line=l[:-1]))
i += 1
i += 1

#os.close(tmpFd)
#if 'FPC_LEAVE_TEMP_FILES' not in os.environ:
Expand All @@ -63,7 +63,7 @@ def findDeviceDeclarations(self):
self.allTokens.append(token)
m = Match()
self.deviceDclLines = m.match_device_function(self.allTokens)

## This simply uses the entire file as a big code region
## Intended to be used to instrument the entire file
def findAllDeclarations(self):
Expand All @@ -75,7 +75,7 @@ def findAllDeclarations(self):
endLine = self.allTokens[-1:][0].lineNumber()
startIndex = 0
endIndex = len(self.allTokens) - 1
func_type = FunctionType.host
func_type = FunctionType.host
self.deviceDclLines = [(startLine, endLine, startIndex, endIndex, func_type)]

## Add middle lines, i.e., lines in the middle of begin/end
Expand All @@ -98,7 +98,7 @@ def findAssigments(self):
self.linesOfAssigments[i_line].append((i_abs, 'b'))
self.linesOfAssigments[j_line].append((j_abs, 'e'))
self.addMiddleLines(i_line, j_line)
if verbose(): print('Lines with assigments:', self.linesOfAssigments)
if verbose(): print('Lines with assignments:', self.linesOfAssigments)
self.functionTypeMap[i_abs] = f_type

## Adds preamble and end to the operation (i.e., instruments the line)
Expand Down Expand Up @@ -136,7 +136,7 @@ def transformLine(self, index, currentLine: int):
break
i += 1

return i-index, newLine
return i-index, newLine

def produceInstrumentedLines(self):
currentLine = 1
Expand Down Expand Up @@ -228,4 +228,3 @@ def getInstrumentedFileName(self):
inst.findAssigments()
inst.produceInstrumentedLines()
inst.instrument()