
This patchs adds a new metadata kind `exclude` which implies that the global variable should be given the necessary flags during code generation to not be included in the final executable. This is done using the ``SHF_EXCLUDE`` flag on ELF for example. This should make it easier to specify this flag on a variable without needing to explicitly check the section name in the target backend. Depends on D129053 D129052 Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D129151
19 lines
478 B
LLVM
19 lines
478 B
LLVM
; RUN: llc -mtriple x86_64-win32-gnu < %s | FileCheck %s
|
|
|
|
@a = global i32 1
|
|
@b = global i32 1, !exclude !0
|
|
@c = global i32 1, section "aaa"
|
|
; CHECK-DAG: c
|
|
; CHECK-DAG: .section aaa,"dw"
|
|
@d = global i32 1, section "bbb", !exclude !0
|
|
; CHECK-DAG: d
|
|
; CHECK-DAG: .section bbb,"ynD"
|
|
@e = global i32 1, section "bbb", !exclude !0
|
|
; CHECK-DAG: e
|
|
@f = global i32 1, section "ccc", !exclude !0
|
|
@g = global i32 1, section "ccc"
|
|
; CHECK-DAG: f
|
|
; CHECK-DAG: .section ccc,"ynD"
|
|
|
|
!0 = !{}
|