[lld] [lld] Change `--lto-emit-llvm` to use the pre-codegen module (PR #97480)
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 2 15:04:16 PDT 2024
================
@@ -9,11 +9,13 @@
; RUN: ld.lld --plugin-opt=emit-llvm -mllvm -bitcode-flush-threshold=0 -o /dev/null %t.o
; RUN: ld.lld --lto-emit-llvm -mllvm -bitcode-flush-threshold=0 -o /dev/null %t.o
-; CHECK: define internal void @main()
+; CHECK: define hidden void @main()
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"
-define void @main() {
+ at llvm.compiler.used = appending global [1 x ptr] [ptr @main], section "llvm.metadata"
----------------
jhuber6 wrote:
It optimizes it out completely, so I just made it used so it sticks around. Could make it slightly more complicated if you want.
https://github.com/llvm/llvm-project/pull/97480
More information about the llvm-commits
mailing list