Skip to content

Instantly share code, notes, and snippets.

@oprypin
Created June 22, 2020 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oprypin/a3cce1a5acde28990cbbdec13e68dd10 to your computer and use it in GitHub Desktop.
Save oprypin/a3cce1a5acde28990cbbdec13e68dd10 to your computer and use it in GitHub Desktop.
%2 = alloca %struct.Vec, align 8
call void @callback(%struct.Vec* %2)
--------
; Function Attrs: noinline nounwind optnone uwtable
define dso_local void @callback(%struct.Vec* %0) #1 {
%2 = getelementptr inbounds %struct.Vec, %struct.Vec* %0, i32 0, i32 1
%3 = load i64, i64* %2, align 8
%4 = getelementptr inbounds %struct.Vec, %struct.Vec* %0, i32 0, i32 0
%5 = load i64, i64* %4, align 8
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"??_C@_0L@EGEBKBBB@?$CFlld?5?$CFlld?6?$AA@", i64 0, i64 0), i64 %5, i64 %3)
ret void
}
%v = alloca %"struct.Lib::Vec"
call void @callback(%"struct.Lib::Vec"* byval %v)
--------
; Function Attrs: uwtable
define void @callback(%"struct.Lib::Vec"* byval %v) #0 {
entry:
%0 = call i8* @.2A.String.23.to_unsafe.3A.Pointer.28.UInt8.29.(%String* bitcast ({ i32, i32, i32, [11 x i8] }* @"'%lld %lld\0A'" to %String*))
%1 = getelementptr inbounds %"struct.Lib::Vec", %"struct.Lib::Vec"* %v, i32 0, i32 0
%2 = load i64, i64* %1
%3 = getelementptr inbounds %"struct.Lib::Vec", %"struct.Lib::Vec"* %v, i32 0, i32 1
%4 = load i64, i64* %3
%5 = call i32 (i8*, ...) @printf(i8* %0, i64 %2, i64 %4)
ret void
}
%v = alloca %"struct.Lib::Vec"
call void @callback(%"struct.Lib::Vec"* %v)
--------
; Function Attrs: uwtable
define void @callback(%"struct.Lib::Vec"* %v) #0 {
alloca:
%v1 = alloca %"struct.Lib::Vec"
br label %entry
entry: ; preds = %alloca
%0 = bitcast %"struct.Lib::Vec"* %v1 to %"struct.Lib::Vec"**
store %"struct.Lib::Vec"* %v, %"struct.Lib::Vec"** %0
%1 = call i8* @.2A.String.23.to_unsafe.3A.Pointer.28.UInt8.29.(%String* bitcast ({ i32, i32, i32, [11 x i8] }* @"'%lld %lld\0A'" to %String*))
%2 = getelementptr inbounds %"struct.Lib::Vec", %"struct.Lib::Vec"* %v1, i32 0, i32 0
%3 = load i64, i64* %2
%4 = getelementptr inbounds %"struct.Lib::Vec", %"struct.Lib::Vec"* %v1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = call i32 (i8*, ...) @printf(i8* %1, i64 %3, i64 %5)
ret void
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment