Skip to content

Instantly share code, notes, and snippets.

@minglotus-6
Created January 11, 2022 00:05
Show Gist options
  • Save minglotus-6/6a41c391db8656f83e2528d57001ab1d to your computer and use it in GitHub Desktop.
Save minglotus-6/6a41c391db8656f83e2528d57001ab1d to your computer and use it in GitHub Desktop.
struct RetVal {
char x;
int y;
};
typedef RetVal (*Parser)();
RetVal Parse(bool test, Parser p) {
if (test) return {};
return p();
}
; ModuleID = 'int_char.cpp'
source_filename = "int_char.cpp"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; Function Attrs: mustprogress uwtable
define dso_local i64 @_Z5ParsebPF6RetValvE(i1 zeroext %test, i64 ()* nocapture %p) local_unnamed_addr #0 {
entry:
br i1 %test, label %return, label %if.end
if.end: ; preds = %entry
%call = tail call i64 %p()
br label %return
return: ; preds = %entry, %if.end
%retval.sroa.32.0 = phi i64 [ %call, %if.end ], [ 0, %entry ]
ret i64 %retval.sroa.32.0
}
attributes #0 = { mustprogress uwtable "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1}
!llvm.ident = !{!2}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 7, !"uwtable", i32 1}
!2 = !{!"clang version 14.0.0 (https://github.com/llvm/llvm-project.git 4f60a42878b0d46bc2cc84d8f0d316cac2c60c9d)"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment