summaryrefslogtreecommitdiffstats
path: root/llvm/utils/abtest/mark_armfns.py
diff options
context:
space:
mode:
authorFrancis Visoiu Mistrih <fvisoiumistrih@apple.com>2017-05-23 21:22:16 +0000
committerFrancis Visoiu Mistrih <fvisoiumistrih@apple.com>2017-05-23 21:22:16 +0000
commit1c98701e57e9e9342c375fd54ef99d827b61414a (patch)
tree9e5ca081f9efed711708da0c2a4cb6be7339a8c0 /llvm/utils/abtest/mark_armfns.py
parent968fe938031846b58bd2980d51cb9053b820ac2d (diff)
downloadbcm5719-llvm-1c98701e57e9e9342c375fd54ef99d827b61414a.tar.gz
bcm5719-llvm-1c98701e57e9e9342c375fd54ef99d827b61414a.zip
AsmPrinter: mark the beginning and the end of a function in verbose mode
llvm-svn: 303690
Diffstat (limited to 'llvm/utils/abtest/mark_armfns.py')
-rwxr-xr-xllvm/utils/abtest/mark_armfns.py54
1 files changed, 0 insertions, 54 deletions
diff --git a/llvm/utils/abtest/mark_armfns.py b/llvm/utils/abtest/mark_armfns.py
deleted file mode 100755
index 0edf42e8a83..00000000000
--- a/llvm/utils/abtest/mark_armfns.py
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env python
-#
-# Mark functions in an arm assembly file. This is done by surrounding the
-# function with "# -- Begin Name" and "# -- End Name"
-# (This script is designed for arm ios assembly syntax)
-import sys
-import re
-
-inp = open(sys.argv[1], "r").readlines()
-
-# First pass
-linenum = 0
-INVALID=-100
-last_align = INVALID
-last_code = INVALID
-last_globl = INVALID
-begin = INVALID
-begins = dict()
-for line in inp:
- linenum += 1
- if ".align" in line:
- last_align = linenum
- if ".code" in line:
- last_code = linenum
- if ".globl" in line:
- last_globl = linenum
- m = re.search(r'.thumb_func\s+(\w+)', line)
- if m:
- funcname = m.group(1)
- if last_code == last_align+1 and (linenum - last_code) < 4:
- begin = last_align
- if last_globl+1 == last_align:
- begin = last_globl
- if line == "\n" and begin != INVALID:
- end = linenum
- triple = (funcname, begin, end)
- begins[begin] = triple
- begin = INVALID
-
-# Second pass: Mark
-out = open(sys.argv[1], "w")
-in_func = None
-linenum = 0
-for line in inp:
- linenum += 1
- if in_func is not None and linenum == end:
- out.write("# -- End %s\n" % in_func)
- in_func = None
-
- triple = begins.get(linenum)
- if triple is not None:
- in_func, begin, end = triple
- out.write("# -- Begin %s\n" % in_func)
- out.write(line)
OpenPOWER on IntegriCloud