mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-22 04:05:05 +00:00
LTO: Don't bother trying to mangle unnamed globals, as they can't be preserved with MustPreserveSymbols.
Summary: Should fix sanitizer-windows bot. Reviewers: joker.eph Subscribers: llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D19635 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267820 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
05e0103959
commit
628f22d543
@ -381,6 +381,10 @@ void LTOCodeGenerator::applyScopeRestrictions() {
|
||||
// candidate GlobalValue if it can be internalized or not.
|
||||
SmallString<64> MangledName;
|
||||
auto mustPreserveGV = [&](const GlobalValue &GV) -> bool {
|
||||
// Unnamed globals can't be mangled, but they can't be preserved either.
|
||||
if (!GV.hasName())
|
||||
return false;
|
||||
|
||||
// Need to mangle the GV as the "MustPreserveSymbols" StringSet is filled
|
||||
// with the linker supplied name, which on Darwin includes a leading
|
||||
// underscore.
|
||||
|
10
test/LTO/X86/unnamed.ll
Normal file
10
test/LTO/X86/unnamed.ll
Normal file
@ -0,0 +1,10 @@
|
||||
; RUN: llvm-as -o %t.bc %s
|
||||
; RUN: llvm-lto -save-merged-module -o %t2 %t.bc
|
||||
; RUN: llvm-dis -o - %t2.merged.bc | FileCheck %s
|
||||
|
||||
; CHECK-NOT: global i32
|
||||
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
@0 = private global i32 42
|
||||
@foo = constant i32* @0
|
Loading…
x
Reference in New Issue
Block a user