diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-03-21 19:48:26 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-03-21 19:48:26 -0700 |
commit | 24856d20699818b35f01963e4144c87d1a5c56ff (patch) | |
tree | ade6915ad86dedcc646eec29bcca845d5bf90212 /third_party | |
parent | 98f6e8924d27246f40f50ec3f75084f1f04b6459 (diff) |
optimize FUNCTION_POINTER and exporting
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/demangler.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/third_party/demangler.py b/third_party/demangler.py index f3407825..ed8d52b0 100644 --- a/third_party/demangler.py +++ b/third_party/demangler.py @@ -19,7 +19,7 @@ JS_ENGINE_PARAMS=[] ''' -import os, sys, subprocess +import os, sys, subprocess, re abspath = os.path.abspath(os.path.dirname(__file__)) def path_from_root(*pathelems): @@ -27,14 +27,15 @@ def path_from_root(*pathelems): exec(open(path_from_root('tools', 'shared.py'), 'r').read()) data = open(sys.argv[1], 'r').readlines() -splitter = sys.argv[2] SEEN = {} for line in data: if len(line) < 4: continue if line[:2] != ' ': continue - if line[2] != '_': continue - func = line.lstrip().split(splitter)[0] + if line[2] != 'f': continue + m = re.match('^ function (?P<func>[^(]+)\(.*', line) + if not m: continue + func = m.groups('func')[0] if func in SEEN: continue SEEN[func] = True cleaned = run_js(JS_ENGINE, path_from_root('third_party', 'gcc_demangler.js'), [func[1:]]) |