Skip to content

Instantly share code, notes, and snippets.

@Aatch
Created June 23, 2013 01:54
Show Gist options
  • Save Aatch/5843416 to your computer and use it in GitHub Desktop.
Save Aatch/5843416 to your computer and use it in GitHub Desktop.
#[no_drop_flag]
%struct.Foo = type { i64 }
define void @_ZN14__extensions__9meth_29568finalize16_d7d397690bb61803_00E({ i64, %tydesc*, i8*, i8*, i8 }*) #1 {
static_allocas:
br label %1
; <label>:1 ; preds = %static_allocas
br label %return
return: ; preds = %1
ret void
}
define internal void @_ZN4main16_d7d397690bb61803_00E({ i64, %tydesc*, i8*, i8*, i8 }*) #1 {
static_allocas:
%1 = alloca %struct.Foo
br label %2
; <label>:2 ; preds = %static_allocas
%3 = getelementptr inbounds %struct.Foo* %1, i32 0, i32 0
store i64 1, i64* %3
br label %4
return: ; preds = %4
ret void
; <label>:4 ; preds = %2
%5 = bitcast %struct.Foo* %1 to i8*
call void @_ZN3Foo17_9681d6fdb97ccc5b14glue_drop_2963E({}* null, %tydesc** null, i8* %5)
br label %return
}
define internal void @_ZN3Foo17_9681d6fdb97ccc5b14glue_drop_2963E({}*, %tydesc**, i8*) #2 {
static_allocas:
%3 = alloca %struct.Foo*
br label %4
return: ; preds = %4
ret void
; <label>:4 ; preds = %static_allocas
%5 = bitcast i8* %2 to %struct.Foo*
store %struct.Foo* %5, %struct.Foo** %3
%6 = bitcast %struct.Foo** %3 to { i64, %tydesc*, i8*, i8*, i8 }*
call void @_ZN14__extensions__9meth_29568finalize16_d7d397690bb61803_00E({ i64, %tydesc*, i8*, i8*, i8 }* %6)
%7 = getelementptr inbounds %struct.Foo* %5, i32 0, i32 0
%8 = bitcast %struct.Foo* %5 to i8*
call void @llvm.memset.p0i8.i64(i8* %8, i8 0, i64 8, i32 8, i1 false)
br label %return
}
#[no_drop_flag]
struct Foo {
a: uint
}
impl Drop for Foo {
fn finalize(&self) {
}
}
fn main() {
let _a = Foo { a: 1 };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment