translator: add memory debug information to x86

This commit is contained in:
Alexey Stepanov
2016-08-18 18:12:59 +03:00
parent db519059b9
commit acfbb8b40d
9 changed files with 16 additions and 2 deletions
+3 -1
View File
@@ -2,12 +2,14 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
declare i8* @malloc_heap(i32) #1
; Function Attrs: nounwind uwtable
define weak i32 @malloc_array(i32 %x) #0 {
%1 = alloca i32, align 4
store i32 %x, i32* %1, align 4
%2 = load i32* %1, align 4
%3 = call i8* @malloc(i32 %2)
%3 = call i8* @malloc_heap(i32 %2)
%4 = ptrtoint i8* %3 to i32
ret i32 %4
}