[llvm-branch-commits] [llvm][AsmPrinter] Emit call graph section (PR #87576)

Paul Kirth via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Dec 11 09:41:35 PST 2024


================
@@ -0,0 +1,73 @@
+; Tests that we store the type identifiers in .callgraph section of the binary.
+
+; RUN: llc --call-graph-section -filetype=obj -o - < %s | \
+; RUN: llvm-readelf -x .callgraph - | FileCheck %s
+
+target triple = "x86_64-unknown-linux-gnu"
+
+define dso_local void @foo() #0 !type !4 {
+entry:
+  ret void
+}
+
+define dso_local i32 @bar(i8 signext %a) #0 !type !5 {
+entry:
+  %a.addr = alloca i8, align 1
+  store i8 %a, i8* %a.addr, align 1
+  ret i32 0
+}
+
+define dso_local i32* @baz(i8* %a) #0 !type !6 {
+entry:
+  %a.addr = alloca i8*, align 8
+  store i8* %a, i8** %a.addr, align 8
+  ret i32* null
+}
----------------
ilovepi wrote:

Do you even need these functions? or can you just use a declaration w/ the type info?

https://github.com/llvm/llvm-project/pull/87576


More information about the llvm-branch-commits mailing list