diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-04-11 19:17:19 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-04-11 19:17:19 -0700 |
commit | fd8e8492d4902ed44f963f6f49efa14f763aa8dc (patch) | |
tree | 30522a6e7886f408f0824608468681db45b5ddf3 | |
parent | 82d12c4fc04647cfdd2cb7624321a5380806525f (diff) |
some memcpy support in autodebugger
-rw-r--r-- | tools/autodebugger.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/autodebugger.py b/tools/autodebugger.py index 08cb1c66..943ff043 100644 --- a/tools/autodebugger.py +++ b/tools/autodebugger.py @@ -251,6 +251,15 @@ for i in range(len(lines)): lines[i] += '\n call void @emscripten_autodebug_%s(i32 %d, %s %%%s)' % (m.group('type'), index, m.group('type'), m.group('var')) lines_added += 1 continue + m = re.match(' call void @llvm\.memcpy\.p0i8\.p0i8\.i32\(i8\* %(?P<dst>[\w_.]+), i8\* %(?P<src>[\w_.]+), i32 8, i32 (?P<align>\d+),.*', lines[i]) + if m: + index = i+1+lines_added + lines[i] += '\n %%adpretemp%d = bitcast i8* %%%s to i64*' % (index, m.group('src')) + \ + '\n %%adtemp%d = load i64* %%adpretemp%d, align %s' % (index, index, m.group('align')) + \ + '\n call void @emscripten_autodebug_%s(i32 %d, %s %%adtemp%d)' % ('i64', index, 'i64', index) + lines_added += 3 + continue + finally: if len(pre) > 0: lines[i] = pre + '\n' + lines[i] |