Index: include/llvm/LTO/LTO.h =================================================================== --- include/llvm/LTO/LTO.h +++ include/llvm/LTO/LTO.h @@ -387,16 +387,10 @@ /// The resolution for a symbol. The linker must provide a SymbolResolution for /// each global symbol based on its internal resolution of that symbol. struct SymbolResolution { - SymbolResolution() - : Prevailing(0), FinalDefinitionInLinkageUnit(0), VisibleToRegularObj(0) { - } + SymbolResolution() : Prevailing(0), VisibleToRegularObj(0) {} /// The linker has chosen this definition of the symbol. unsigned Prevailing : 1; - /// The definition of this symbol is unpreemptable at runtime and is known to - /// be in this linkage unit. - unsigned FinalDefinitionInLinkageUnit : 1; - /// The definition of this symbol is visible outside of the LTO unit. unsigned VisibleToRegularObj : 1; }; Index: lib/LTO/LTO.cpp =================================================================== --- lib/LTO/LTO.cpp +++ lib/LTO/LTO.cpp @@ -269,8 +269,6 @@ OS << "-r=" << Path << ',' << Sym.getName() << ','; if (Res.Prevailing) OS << 'p'; - if (Res.FinalDefinitionInLinkageUnit) - OS << 'l'; if (Res.VisibleToRegularObj) OS << 'x'; OS << '\n'; @@ -358,8 +356,6 @@ CommonRes.Size = std::max(CommonRes.Size, Sym.getCommonSize()); CommonRes.Align = std::max(CommonRes.Align, Sym.getCommonAlignment()); } - - // FIXME: use proposed local attribute for FinalDefinitionInLinkageUnit. } assert(ResI == Res.end()); Index: test/LTO/Resolution/X86/comdat.ll =================================================================== --- test/LTO/Resolution/X86/comdat.ll +++ test/LTO/Resolution/X86/comdat.ll @@ -1,7 +1,7 @@ ; RUN: llvm-as %s -o %t.o ; RUN: llvm-as %p/Inputs/comdat.ll -o %t2.o ; RUN: llvm-lto2 -save-temps -o %t3.o %t.o %t2.o \ -; RUN: -r=%t.o,f1,plx \ +; RUN: -r=%t.o,f1,px \ ; RUN: -r=%t.o,v1,px \ ; RUN: -r=%t.o,r11,px \ ; RUN: -r=%t.o,r12,px \ @@ -10,7 +10,7 @@ ; RUN: -r=%t.o,a13,px \ ; RUN: -r=%t.o,a14,px \ ; RUN: -r=%t.o,a15,px \ -; RUN: -r=%t2.o,f1,l \ +; RUN: -r=%t2.o,f1, \ ; RUN: -r=%t2.o,will_be_undefined, \ ; RUN: -r=%t2.o,v1, \ ; RUN: -r=%t2.o,r21,px \ Index: test/ThinLTO/X86/cache.ll =================================================================== --- test/ThinLTO/X86/cache.ll +++ test/ThinLTO/X86/cache.ll @@ -10,9 +10,9 @@ ; Verify that enabling caching is working with llvm-lto2 ; RUN: rm -Rf %t.cache && mkdir %t.cache ; RUN: llvm-lto2 -o %t.o %t2.bc %t.bc -cache-dir %t.cache \ -; RUN: -r=%t2.bc,_main,plx \ -; RUN: -r=%t2.bc,_globalfunc,lx \ -; RUN: -r=%t.bc,_globalfunc,plx +; RUN: -r=%t2.bc,_main,px \ +; RUN: -r=%t2.bc,_globalfunc,x \ +; RUN: -r=%t.bc,_globalfunc,px ; RUN: ls %t.cache | count 2 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" Index: test/ThinLTO/X86/dicompositetype-unique.ll =================================================================== --- test/ThinLTO/X86/dicompositetype-unique.ll +++ test/ThinLTO/X86/dicompositetype-unique.ll @@ -2,9 +2,9 @@ ; RUN: opt -module-summary -o %t2.bc %S/Inputs/dicompositetype-unique.ll ; RUN: llvm-lto2 %t1.bc %t2.bc -o %t --save-temps \ -; RUN: -r %t1.bc,_foo,lx \ -; RUN: -r %t1.bc,_main,plx \ -; RUN: -r %t2.bc,_foo,plx +; RUN: -r %t1.bc,_foo,x \ +; RUN: -r %t1.bc,_main,px \ +; RUN: -r %t2.bc,_foo,px ; RUN: llvm-dis %t.0.3.import.bc -o - | FileCheck %s Index: test/ThinLTO/X86/internalize.ll =================================================================== --- test/ThinLTO/X86/internalize.ll +++ test/ThinLTO/X86/internalize.ll @@ -4,11 +4,13 @@ ; RUN: llvm-lto -thinlto-action=internalize -thinlto-index %t.index.bc %t1.bc -o - --exported-symbol=foo | llvm-dis -o - | FileCheck %s --check-prefix=INTERNALIZE ; RUN: llvm-lto2 %t1.bc -o %t.o -save-temps \ -; RUN: -r=%t1.bc,_foo,pxl \ -; RUN: -r=%t1.bc,_bar,pl \ -; RUN: -r=%t1.bc,_linkonce_func,pl +; RUN: -r=%t1.bc,_foo,px \ +; RUN: -r=%t1.bc,_bar,p \ +; RUN: -r=%t1.bc,_linkonce_func,p ; RUN: llvm-dis < %t.o.0.2.internalize.bc | FileCheck %s --check-prefix=INTERNALIZE +; RUN: not llvm-lto2 %t1.bc -o %t.o -r=%t1.bc,_foo,pu 2>&1 | FileCheck --check-prefix=ERROR %s + ; REGULAR: define void @foo ; REGULAR: define void @bar @@ -17,6 +19,8 @@ ; INTERNALIZE: define internal void @bar ; INTERNALIZE: define internal void @linkonce_func() +; ERROR: invalid character u in resolution + target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.11.0" @@ -29,4 +33,4 @@ } define linkonce void @linkonce_func() { ret void -} \ No newline at end of file +} Index: tools/llvm-lto2/llvm-lto2.cpp =================================================================== --- tools/llvm-lto2/llvm-lto2.cpp +++ tools/llvm-lto2/llvm-lto2.cpp @@ -126,13 +126,13 @@ for (char C : Rest) { if (C == 'p') Res.Prevailing = true; - else if (C == 'l') - Res.FinalDefinitionInLinkageUnit = true; else if (C == 'x') Res.VisibleToRegularObj = true; - else + else { llvm::errs() << "invalid character " << C << " in resolution: " << R << '\n'; + exit(1); + } } CommandLineResolutions[{FileName, SymbolName}] = Res; }