Skip to content

Instantly share code, notes, and snippets.

@fjolnir
Last active August 29, 2015 14:20
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 fjolnir/a5f0089641272e84c404 to your computer and use it in GitHub Desktop.
Save fjolnir/a5f0089641272e84c404 to your computer and use it in GitHub Desktop.
// @property(nonatomic) int foo;
; Function Attrs: nounwind ssp uwtable
define internal void @"\01-[Obj setFoo:]"(%0* nocapture %self, i8* nocapture readnone %_cmd, i32 %foo) #1 {
entry:
%ivar = load i64* @"OBJC_IVAR_$_Obj._foo", align 8, !invariant.load !5
%0 = bitcast %0* %self to i8*
%add.ptr = getelementptr inbounds i8* %0, i64 %ivar
%1 = bitcast i8* %add.ptr to i32*
store i32 %foo, i32* %1, align 4, !tbaa !6
ret void
}
// @property(atomic) int foo;
; Function Attrs: nounwind ssp uwtable
define internal void @"\01-[Obj setFoo:]"(%0* nocapture %self, i8* nocapture readnone %_cmd, i32 %foo) #1 {
entry:
%ivar = load i64* @"OBJC_IVAR_$_Obj._foo", align 8, !invariant.load !5
%0 = bitcast %0* %self to i8*
%add.ptr = getelementptr inbounds i8* %0, i64 %ivar
%1 = bitcast i8* %add.ptr to i32*
store atomic i32 %foo, i32* %1 unordered, align 4
ret void
}
// @property(nonatomic) struct {void*a; void *b; void *c; void *d; void *e; } foo;
; Function Attrs: nounwind ssp uwtable
define internal void @"\01-[Obj setFoo:]"(%0* nocapture %self, i8* nocapture readnone %_cmd, %struct.anon* byval nocapture readonly align 8 %foo) #0 {
entry:
%ivar = load i64* @"OBJC_IVAR_$_Obj._foo", align 8, !invariant.load !5
%0 = bitcast %0* %self to i8*
%add.ptr = getelementptr inbounds i8* %0, i64 %ivar
%1 = bitcast %struct.anon* %foo to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %add.ptr, i8* %1, i64 40, i32 8, i1 false), !tbaa.struct !6
ret void
}
// @property(atomic) struct {void*a; void *b; void *c; void *d; void *e; } foo;
define internal void @"\01-[Obj setFoo:]"(%0* %self, i8* nocapture readnone %_cmd, %struct.anon* byval align 8 %foo) #0 {
entry:
%ivar = load i64* @"OBJC_IVAR_$_Obj._foo", align 8, !invariant.load !5
%0 = bitcast %0* %self to i8*
%add.ptr = getelementptr inbounds i8* %0, i64 %ivar
%1 = bitcast %struct.anon* %foo to i8*
call void @objc_copyStruct(i8* %add.ptr, i8* %1, i64 40, i1 zeroext true, i1 zeroext false)
ret void
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment