[llvm] r203866 - Remove the linker_private and linker_private_weak linkages.

Rafael Espindola rafael.espindola at gmail.com
Thu Mar 13 16:18:37 PDT 2014


Author: rafael
Date: Thu Mar 13 18:18:37 2014
New Revision: 203866

URL: http://llvm.org/viewvc/llvm-project?rev=203866&view=rev
Log:
Remove the linker_private and linker_private_weak linkages.

These linkages were introduced some time ago, but it was never very
clear what exactly their semantics were or what they should be used
for. Some investigation found these uses:

* utf-16 strings in clang.
* non-unnamed_addr strings produced by the sanitizers.

It turns out they were just working around a more fundamental problem.
For some sections a MachO linker needs a symbol in order to split the
section into atoms, and llvm had no idea that was the case. I fixed
that in r201700 and it is now safe to use the private linkage. When
the object ends up in a section that requires symbols, llvm will use a
'l' prefix instead of a 'L' prefix and things just work.

With that, these linkages were already dead, but there was a potential
future user in the objc metadata information. I am still looking at
CGObjcMac.cpp, but at this point I am convinced that linker_private
and linker_private_weak are not what they need.

The objc uses are currently split in

* Regular symbols (no '\01' prefix). LLVM already directly provides
whatever semantics they need.
* Uses of a private name (start with "\01L" or "\01l") and private
linkage. We can drop the "\01L" and "\01l" prefixes as soon as llvm
agrees with clang on L being ok or not for a given section. I have two
patches in code review for this.
* Uses of private name and weak linkage.

The last case is the one that one could think would fit one of these
linkages. That is not the case. The semantics are

* the linker will merge these symbol by *name*.
* the linker will hide them in the final DSO.

Given that the merging is done by name, any of the private (or
internal) linkages would be a bad match. They allow llvm to rename the
symbols, and that is really not what we want. From the llvm point of
view, these objects should really be (linkonce|weak)(_odr)?.

For now, just keeping the "\01l" prefix is probably the best for these
symbols. If we one day want to have a more direct support in llvm,
IMHO what we should add is not a linkage, it is just a hidden_symbol
attribute. It would be applicable to multiple linkages. For example,
on weak it would produce the current behavior we have for objc
metadata. On internal, it would be equivalent to private (and we
should then remove private).

Removed:
    llvm/trunk/test/CodeGen/ARM/2009-08-23-linkerprivate.ll
    llvm/trunk/test/CodeGen/PowerPC/2009-08-23-linkerprivate.ll
    llvm/trunk/test/CodeGen/X86/2009-08-23-linkerprivate.ll
    llvm/trunk/test/CodeGen/X86/linker-private.ll
    llvm/trunk/test/Feature/linker_private_linkages.ll
    llvm/trunk/test/Transforms/ConstantMerge/linker-private.ll
Modified:
    llvm/trunk/docs/BitCodeFormat.rst
    llvm/trunk/docs/LangRef.rst
    llvm/trunk/include/llvm/IR/GlobalValue.h
    llvm/trunk/lib/AsmParser/LLLexer.cpp
    llvm/trunk/lib/AsmParser/LLParser.cpp
    llvm/trunk/lib/AsmParser/LLToken.h
    llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
    llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    llvm/trunk/lib/IR/AsmWriter.cpp
    llvm/trunk/lib/IR/Core.cpp
    llvm/trunk/lib/IR/Mangler.cpp
    llvm/trunk/lib/LTO/LTOModule.cpp
    llvm/trunk/lib/Object/IRObjectFile.cpp
    llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp
    llvm/trunk/test/Bitcode/linkage-types-3.2.ll
    llvm/trunk/test/CodeGen/ARM/2011-04-12-AlignBug.ll
    llvm/trunk/test/CodeGen/NVPTX/bug17709.ll
    llvm/trunk/test/CodeGen/SPARC/exception.ll
    llvm/trunk/test/CodeGen/SPARC/setjmp.ll
    llvm/trunk/test/CodeGen/X86/cfstring.ll
    llvm/trunk/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll
    llvm/trunk/utils/kate/llvm.xml
    llvm/trunk/utils/llvm.grm
    llvm/trunk/utils/vim/llvm.vim

Modified: llvm/trunk/docs/BitCodeFormat.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/BitCodeFormat.rst?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/docs/BitCodeFormat.rst (original)
+++ llvm/trunk/docs/BitCodeFormat.rst Thu Mar 13 18:18:37 2014
@@ -688,7 +688,8 @@ global variable. The operand fields are:
   * ``weak_odr``: code 10
   * ``linkonce_odr``: code 11
   * ``available_externally``: code 12
-  * ``linker_private``: code 13
+  * deprecated : code 13
+  * deprecated : code 14
 
 * alignment*: The logarithm base 2 of the variable's requested alignment, plus 1
 

Modified: llvm/trunk/docs/LangRef.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.rst?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/docs/LangRef.rst (original)
+++ llvm/trunk/docs/LangRef.rst Thu Mar 13 18:18:37 2014
@@ -197,16 +197,6 @@ linkage:
     private to be renamed as necessary to avoid collisions. Because the
     symbol is private to the module, all references can be updated. This
     doesn't show up in any symbol table in the object file.
-``linker_private``
-    Similar to ``private``, but the symbol is passed through the
-    assembler and evaluated by the linker. Unlike normal strong symbols,
-    they are removed by the linker from the final linked image
-    (executable or dynamic library).
-``linker_private_weak``
-    Similar to "``linker_private``", but the symbol is weak. Note that
-    ``linker_private_weak`` symbols are subject to coalescing by the
-    linker. The symbols are removed by the linker from the final linked
-    image (executable or dynamic library).
 ``internal``
     Similar to private, but the value shows as a local symbol
     (``STB_LOCAL`` in the case of ELF) in the object file. This
@@ -681,8 +671,7 @@ Syntax::
 
     @<Name> = [Visibility] [DLLStorageClass] alias [Linkage] <AliaseeTy> @<Aliasee>
 
-The linkage must be one of ``private``, ``linker_private``,
-``linker_private_weak``, ``internal``, ``linkonce``, ``weak``,
+The linkage must be one of ``private``, ``internal``, ``linkonce``, ``weak``,
 ``linkonce_odr``, ``weak_odr``, ``external``. Note that some system linkers
 might not correctly handle dropping a weak symbol that is aliased by a non-weak
 alias.

Modified: llvm/trunk/include/llvm/IR/GlobalValue.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/GlobalValue.h?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/GlobalValue.h (original)
+++ llvm/trunk/include/llvm/IR/GlobalValue.h Thu Mar 13 18:18:37 2014
@@ -40,8 +40,6 @@ public:
     AppendingLinkage,   ///< Special purpose, only applies to global arrays
     InternalLinkage,    ///< Rename collisions when linking (static functions).
     PrivateLinkage,     ///< Like Internal, but omit from symbol table.
-    LinkerPrivateLinkage, ///< Like Private, but linker removes.
-    LinkerPrivateWeakLinkage, ///< Like LinkerPrivate, but weak.
     ExternalWeakLinkage,///< ExternalWeak linkage description.
     CommonLinkage       ///< Tentative definitions.
   };
@@ -158,15 +156,8 @@ public:
   static bool isPrivateLinkage(LinkageTypes Linkage) {
     return Linkage == PrivateLinkage;
   }
-  static bool isLinkerPrivateLinkage(LinkageTypes Linkage) {
-    return Linkage == LinkerPrivateLinkage;
-  }
-  static bool isLinkerPrivateWeakLinkage(LinkageTypes Linkage) {
-    return Linkage == LinkerPrivateWeakLinkage;
-  }
   static bool isLocalLinkage(LinkageTypes Linkage) {
-    return isInternalLinkage(Linkage) || isPrivateLinkage(Linkage) ||
-      isLinkerPrivateLinkage(Linkage) || isLinkerPrivateWeakLinkage(Linkage);
+    return isInternalLinkage(Linkage) || isPrivateLinkage(Linkage);
   }
   static bool isExternalWeakLinkage(LinkageTypes Linkage) {
     return Linkage == ExternalWeakLinkage;
@@ -185,11 +176,8 @@ public:
   /// by something non-equivalent at link time.  For example, if a function has
   /// weak linkage then the code defining it may be replaced by different code.
   static bool mayBeOverridden(LinkageTypes Linkage) {
-    return Linkage == WeakAnyLinkage ||
-           Linkage == LinkOnceAnyLinkage ||
-           Linkage == CommonLinkage ||
-           Linkage == ExternalWeakLinkage ||
-           Linkage == LinkerPrivateWeakLinkage;
+    return Linkage == WeakAnyLinkage || Linkage == LinkOnceAnyLinkage ||
+           Linkage == CommonLinkage || Linkage == ExternalWeakLinkage;
   }
 
   /// isWeakForLinker - Whether the definition of this global may be replaced at
@@ -197,14 +185,10 @@ public:
   /// always a mistake: when working at the IR level use mayBeOverridden instead
   /// as it knows about ODR semantics.
   static bool isWeakForLinker(LinkageTypes Linkage)  {
-    return Linkage == AvailableExternallyLinkage ||
-           Linkage == WeakAnyLinkage ||
-           Linkage == WeakODRLinkage ||
-           Linkage == LinkOnceAnyLinkage ||
-           Linkage == LinkOnceODRLinkage ||
-           Linkage == CommonLinkage ||
-           Linkage == ExternalWeakLinkage ||
-           Linkage == LinkerPrivateWeakLinkage;
+    return Linkage == AvailableExternallyLinkage || Linkage == WeakAnyLinkage ||
+           Linkage == WeakODRLinkage || Linkage == LinkOnceAnyLinkage ||
+           Linkage == LinkOnceODRLinkage || Linkage == CommonLinkage ||
+           Linkage == ExternalWeakLinkage;
   }
 
   bool hasExternalLinkage() const { return isExternalLinkage(Linkage); }
@@ -220,10 +204,6 @@ public:
   bool hasAppendingLinkage() const { return isAppendingLinkage(Linkage); }
   bool hasInternalLinkage() const { return isInternalLinkage(Linkage); }
   bool hasPrivateLinkage() const { return isPrivateLinkage(Linkage); }
-  bool hasLinkerPrivateLinkage() const { return isLinkerPrivateLinkage(Linkage); }
-  bool hasLinkerPrivateWeakLinkage() const {
-    return isLinkerPrivateWeakLinkage(Linkage);
-  }
   bool hasLocalLinkage() const { return isLocalLinkage(Linkage); }
   bool hasExternalWeakLinkage() const { return isExternalWeakLinkage(Linkage); }
   bool hasCommonLinkage() const { return isCommonLinkage(Linkage); }

Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.cpp?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLLexer.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLLexer.cpp Thu Mar 13 18:18:37 2014
@@ -480,8 +480,6 @@ lltok::Kind LLLexer::LexIdentifier() {
   KEYWORD(global);  KEYWORD(constant);
 
   KEYWORD(private);
-  KEYWORD(linker_private);
-  KEYWORD(linker_private_weak);
   KEYWORD(internal);
   KEYWORD(available_externally);
   KEYWORD(linkonce);

Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Thu Mar 13 18:18:37 2014
@@ -246,8 +246,6 @@ bool LLParser::ParseTopLevelEntities() {
     //               OptionalThreadLocal OptionalAddrSpace OptionalUnNammedAddr
     //               ('constant'|'global') ...
     case lltok::kw_private:             // OptionalLinkage
-    case lltok::kw_linker_private:      // OptionalLinkage
-    case lltok::kw_linker_private_weak: // OptionalLinkage
     case lltok::kw_internal:            // OptionalLinkage
     case lltok::kw_weak:                // OptionalLinkage
     case lltok::kw_weak_odr:            // OptionalLinkage
@@ -1278,8 +1276,6 @@ bool LLParser::ParseOptionalReturnAttrs(
 /// ParseOptionalLinkage
 ///   ::= /*empty*/
 ///   ::= 'private'
-///   ::= 'linker_private'
-///   ::= 'linker_private_weak'
 ///   ::= 'internal'
 ///   ::= 'weak'
 ///   ::= 'weak_odr'
@@ -1295,10 +1291,6 @@ bool LLParser::ParseOptionalLinkage(unsi
   switch (Lex.getKind()) {
   default:                       Res=GlobalValue::ExternalLinkage; return false;
   case lltok::kw_private:        Res = GlobalValue::PrivateLinkage;       break;
-  case lltok::kw_linker_private: Res = GlobalValue::LinkerPrivateLinkage; break;
-  case lltok::kw_linker_private_weak:
-    Res = GlobalValue::LinkerPrivateWeakLinkage;
-    break;
   case lltok::kw_internal:       Res = GlobalValue::InternalLinkage;      break;
   case lltok::kw_weak:           Res = GlobalValue::WeakAnyLinkage;       break;
   case lltok::kw_weak_odr:       Res = GlobalValue::WeakODRLinkage;       break;
@@ -2992,8 +2984,6 @@ bool LLParser::ParseFunctionHeader(Funct
       return Error(LinkageLoc, "invalid linkage for function definition");
     break;
   case GlobalValue::PrivateLinkage:
-  case GlobalValue::LinkerPrivateLinkage:
-  case GlobalValue::LinkerPrivateWeakLinkage:
   case GlobalValue::InternalLinkage:
   case GlobalValue::AvailableExternallyLinkage:
   case GlobalValue::LinkOnceAnyLinkage:

Modified: llvm/trunk/lib/AsmParser/LLToken.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLToken.h?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLToken.h (original)
+++ llvm/trunk/lib/AsmParser/LLToken.h Thu Mar 13 18:18:37 2014
@@ -37,7 +37,7 @@ namespace lltok {
     kw_declare, kw_define,
     kw_global,  kw_constant,
 
-    kw_private, kw_linker_private, kw_linker_private_weak,
+    kw_private,
     kw_internal,
     kw_linkonce, kw_linkonce_odr,
     kw_weak, kw_weak_odr, kw_appending,

Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Thu Mar 13 18:18:37 2014
@@ -88,8 +88,10 @@ static GlobalValue::LinkageTypes GetDeco
   case 10: return GlobalValue::WeakODRLinkage;
   case 11: return GlobalValue::LinkOnceODRLinkage;
   case 12: return GlobalValue::AvailableExternallyLinkage;
-  case 13: return GlobalValue::LinkerPrivateLinkage;
-  case 14: return GlobalValue::LinkerPrivateWeakLinkage;
+  case 13:
+    return GlobalValue::PrivateLinkage; // Obsolete LinkerPrivateLinkage
+  case 14:
+    return GlobalValue::PrivateLinkage; // Obsolete LinkerPrivateWeakLinkage
   }
 }
 

Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Thu Mar 13 18:18:37 2014
@@ -487,8 +487,6 @@ static unsigned getEncodedLinkage(const
   case GlobalValue::WeakODRLinkage:                  return 10;
   case GlobalValue::LinkOnceODRLinkage:              return 11;
   case GlobalValue::AvailableExternallyLinkage:      return 12;
-  case GlobalValue::LinkerPrivateLinkage:            return 13;
-  case GlobalValue::LinkerPrivateWeakLinkage:        return 14;
   }
   llvm_unreachable("Invalid linkage");
 }

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Thu Mar 13 18:18:37 2014
@@ -272,7 +272,6 @@ void AsmPrinter::EmitLinkage(const Globa
   case GlobalValue::LinkOnceODRLinkage:
   case GlobalValue::WeakAnyLinkage:
   case GlobalValue::WeakODRLinkage:
-  case GlobalValue::LinkerPrivateWeakLinkage:
     if (MAI->hasWeakDefDirective()) {
       // .globl _foo
       OutStreamer.EmitSymbolAttribute(GVSym, MCSA_Global);
@@ -301,7 +300,6 @@ void AsmPrinter::EmitLinkage(const Globa
     return;
   case GlobalValue::PrivateLinkage:
   case GlobalValue::InternalLinkage:
-  case GlobalValue::LinkerPrivateLinkage:
     return;
   case GlobalValue::AvailableExternallyLinkage:
     llvm_unreachable("Should never emit this");

Modified: llvm/trunk/lib/IR/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AsmWriter.cpp?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/lib/IR/AsmWriter.cpp (original)
+++ llvm/trunk/lib/IR/AsmWriter.cpp Thu Mar 13 18:18:37 2014
@@ -1391,10 +1391,6 @@ static void PrintLinkage(GlobalValue::Li
   switch (LT) {
   case GlobalValue::ExternalLinkage: break;
   case GlobalValue::PrivateLinkage:       Out << "private ";        break;
-  case GlobalValue::LinkerPrivateLinkage: Out << "linker_private "; break;
-  case GlobalValue::LinkerPrivateWeakLinkage:
-    Out << "linker_private_weak ";
-    break;
   case GlobalValue::InternalLinkage:      Out << "internal ";       break;
   case GlobalValue::LinkOnceAnyLinkage:   Out << "linkonce ";       break;
   case GlobalValue::LinkOnceODRLinkage:   Out << "linkonce_odr ";   break;

Modified: llvm/trunk/lib/IR/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Core.cpp?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Core.cpp (original)
+++ llvm/trunk/lib/IR/Core.cpp Thu Mar 13 18:18:37 2014
@@ -1159,10 +1159,6 @@ LLVMLinkage LLVMGetLinkage(LLVMValueRef
     return LLVMInternalLinkage;
   case GlobalValue::PrivateLinkage:
     return LLVMPrivateLinkage;
-  case GlobalValue::LinkerPrivateLinkage:
-    return LLVMLinkerPrivateLinkage;
-  case GlobalValue::LinkerPrivateWeakLinkage:
-    return LLVMLinkerPrivateWeakLinkage;
   case GlobalValue::ExternalWeakLinkage:
     return LLVMExternalWeakLinkage;
   case GlobalValue::CommonLinkage:
@@ -1208,10 +1204,10 @@ void LLVMSetLinkage(LLVMValueRef Global,
     GV->setLinkage(GlobalValue::PrivateLinkage);
     break;
   case LLVMLinkerPrivateLinkage:
-    GV->setLinkage(GlobalValue::LinkerPrivateLinkage);
+    GV->setLinkage(GlobalValue::PrivateLinkage);
     break;
   case LLVMLinkerPrivateWeakLinkage:
-    GV->setLinkage(GlobalValue::LinkerPrivateWeakLinkage);
+    GV->setLinkage(GlobalValue::PrivateLinkage);
     break;
   case LLVMDLLImportLinkage:
     DEBUG(errs()

Modified: llvm/trunk/lib/IR/Mangler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Mangler.cpp?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Mangler.cpp (original)
+++ llvm/trunk/lib/IR/Mangler.cpp Thu Mar 13 18:18:37 2014
@@ -84,9 +84,6 @@ void Mangler::getNameWithPrefix(raw_ostr
       PrefixTy = Mangler::LinkerPrivate;
     else
       PrefixTy = Mangler::Private;
-  } else if (GV->hasLinkerPrivateLinkage() ||
-             GV->hasLinkerPrivateWeakLinkage()) {
-    PrefixTy = Mangler::LinkerPrivate;
   }
 
   if (!GV->hasName()) {

Modified: llvm/trunk/lib/LTO/LTOModule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOModule.cpp?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/LTOModule.cpp (original)
+++ llvm/trunk/lib/LTO/LTOModule.cpp Thu Mar 13 18:18:37 2014
@@ -408,8 +408,7 @@ void LTOModule::addDefinedSymbol(const G
   }
 
   // set definition part
-  if (def->hasWeakLinkage() || def->hasLinkOnceLinkage() ||
-      def->hasLinkerPrivateWeakLinkage())
+  if (def->hasWeakLinkage() || def->hasLinkOnceLinkage())
     attr |= LTO_SYMBOL_DEFINITION_WEAK;
   else if (def->hasCommonLinkage())
     attr |= LTO_SYMBOL_DEFINITION_TENTATIVE;
@@ -424,8 +423,7 @@ void LTOModule::addDefinedSymbol(const G
   else if (canBeHidden(def))
     attr |= LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN;
   else if (def->hasExternalLinkage() || def->hasWeakLinkage() ||
-           def->hasLinkOnceLinkage() || def->hasCommonLinkage() ||
-           def->hasLinkerPrivateWeakLinkage())
+           def->hasLinkOnceLinkage() || def->hasCommonLinkage())
     attr |= LTO_SYMBOL_SCOPE_DEFAULT;
   else
     attr |= LTO_SYMBOL_SCOPE_INTERNAL;

Modified: llvm/trunk/lib/Object/IRObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/IRObjectFile.cpp?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/lib/Object/IRObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/IRObjectFile.cpp Thu Mar 13 18:18:37 2014
@@ -110,8 +110,7 @@ uint32_t IRObjectFile::getSymbolFlags(Da
   uint32_t Res = BasicSymbolRef::SF_None;
   if (GV.isDeclaration() || GV.hasAvailableExternallyLinkage())
     Res |= BasicSymbolRef::SF_Undefined;
-  if (GV.hasPrivateLinkage() || GV.hasLinkerPrivateLinkage() ||
-      GV.hasLinkerPrivateWeakLinkage())
+  if (GV.hasPrivateLinkage())
     Res |= BasicSymbolRef::SF_FormatSpecific;
   if (!GV.hasLocalLinkage())
     Res |= BasicSymbolRef::SF_Global;

Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original)
+++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Thu Mar 13 18:18:37 2014
@@ -283,10 +283,6 @@ void CppWriter::printLinkageType(GlobalV
     Out << "GlobalValue::InternalLinkage"; break;
   case GlobalValue::PrivateLinkage:
     Out << "GlobalValue::PrivateLinkage"; break;
-  case GlobalValue::LinkerPrivateLinkage:
-    Out << "GlobalValue::LinkerPrivateLinkage"; break;
-  case GlobalValue::LinkerPrivateWeakLinkage:
-    Out << "GlobalValue::LinkerPrivateWeakLinkage"; break;
   case GlobalValue::AvailableExternallyLinkage:
     Out << "GlobalValue::AvailableExternallyLinkage "; break;
   case GlobalValue::LinkOnceAnyLinkage:

Modified: llvm/trunk/test/Bitcode/linkage-types-3.2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/linkage-types-3.2.ll?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/test/Bitcode/linkage-types-3.2.ll (original)
+++ llvm/trunk/test/Bitcode/linkage-types-3.2.ll Thu Mar 13 18:18:37 2014
@@ -17,10 +17,10 @@
 ; CHECK: @private.var = private constant i32 0
 
 @linker_private.var = linker_private constant i32 0
-; CHECK: @linker_private.var = linker_private constant i32 0
+; CHECK: @linker_private.var = private constant i32 0
 
 @linker_private_weak.var = linker_private_weak constant i32 0
-; CHECK: @linker_private_weak.var = linker_private_weak constant i32 0
+; CHECK: @linker_private_weak.var = private constant i32 0
 
 @linker_private_weak_def_auto.var = linker_private_weak_def_auto constant i32 0
 ; CHECK: @linker_private_weak_def_auto.var = constant i32 0
@@ -59,13 +59,13 @@ define private void @private()
 }
 
 define linker_private void @linker_private()
-; CHECK: define linker_private void @linker_private
+; CHECK: define private void @linker_private
 {
   ret void;
 }
 
 define linker_private_weak void @linker_private_weak()
-; CHECK: define linker_private_weak void @linker_private_weak
+; CHECK: define private void @linker_private_weak
 {
   ret void;
 }

Removed: llvm/trunk/test/CodeGen/ARM/2009-08-23-linkerprivate.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2009-08-23-linkerprivate.ll?rev=203865&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/2009-08-23-linkerprivate.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/2009-08-23-linkerprivate.ll (removed)
@@ -1,8 +0,0 @@
-; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | FileCheck %s
-
-; ModuleID = '/Volumes/MacOS9/tests/WebKit/JavaScriptCore/profiler/ProfilerServer.mm'
-
-@"\01l_objc_msgSend_fixup_alloc" = linker_private_weak hidden global i32 0, section "__DATA, __objc_msgrefs, coalesced", align 16
-
-; CHECK: .globl l_objc_msgSend_fixup_alloc
-; CHECK: .weak_definition l_objc_msgSend_fixup_alloc

Modified: llvm/trunk/test/CodeGen/ARM/2011-04-12-AlignBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2011-04-12-AlignBug.ll?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/2011-04-12-AlignBug.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/2011-04-12-AlignBug.ll Thu Mar 13 18:18:37 2014
@@ -3,9 +3,9 @@ target datalayout = "e-p:32:32:32-i1:8:3
 target triple = "thumbv7-apple-darwin10.0.0"
 
 ; CHECK: align 3
- at .v = linker_private unnamed_addr constant <4 x i32> <i32 1, i32 2, i32 3, i32 4>, align 8
+ at .v = private unnamed_addr constant <4 x i32> <i32 1, i32 2, i32 3, i32 4>, align 8
 ; CHECK: align 2
- at .strA = linker_private unnamed_addr constant [4 x i8] c"bar\00"
+ at .strA = private unnamed_addr constant [4 x i8] c"bar\00"
 ; CHECK-NOT: align
- at .strB = linker_private unnamed_addr constant [4 x i8] c"foo\00", align 1
- at .strC = linker_private unnamed_addr constant [4 x i8] c"baz\00", section "__TEXT,__cstring,cstring_literals", align 1
+ at .strB = private unnamed_addr constant [4 x i8] c"foo\00", align 1
+ at .strC = private unnamed_addr constant [4 x i8] c"baz\00", section "__TEXT,__cstring,cstring_literals", align 1

Modified: llvm/trunk/test/CodeGen/NVPTX/bug17709.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/NVPTX/bug17709.ll?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/NVPTX/bug17709.ll (original)
+++ llvm/trunk/test/CodeGen/NVPTX/bug17709.ll Thu Mar 13 18:18:37 2014
@@ -4,7 +4,7 @@
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64"
 target triple = "nvptx64-nvidia-cuda"
 
-define linker_private ptx_device { double, double } @__utils1_MOD_trace(%"struct.array2_complex(kind=8).43.5.57"* noalias %m) {
+define private ptx_device { double, double } @__utils1_MOD_trace(%"struct.array2_complex(kind=8).43.5.57"* noalias %m) {
 entry:
   ;unreachable
   %t0 = insertvalue {double, double} undef, double 1.0, 0

Removed: llvm/trunk/test/CodeGen/PowerPC/2009-08-23-linkerprivate.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/2009-08-23-linkerprivate.ll?rev=203865&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/2009-08-23-linkerprivate.ll (original)
+++ llvm/trunk/test/CodeGen/PowerPC/2009-08-23-linkerprivate.ll (removed)
@@ -1,8 +0,0 @@
-; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin | FileCheck %s
-
-; ModuleID = '/Volumes/MacOS9/tests/WebKit/JavaScriptCore/profiler/ProfilerServer.mm'
-
-@"\01l_objc_msgSend_fixup_alloc" = linker_private_weak hidden global i32 0, section "__DATA, __objc_msgrefs, coalesced", align 16
-
-; CHECK: .globl l_objc_msgSend_fixup_alloc
-; CHECK: .weak_definition l_objc_msgSend_fixup_alloc

Modified: llvm/trunk/test/CodeGen/SPARC/exception.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SPARC/exception.ll?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/SPARC/exception.ll (original)
+++ llvm/trunk/test/CodeGen/SPARC/exception.ll Thu Mar 13 18:18:37 2014
@@ -11,8 +11,8 @@
 
 @_ZTIi = external constant %struct.__fundamental_type_info_pseudo
 @_ZTIf = external constant %struct.__fundamental_type_info_pseudo
- at .cst = linker_private unnamed_addr constant [12 x i8] c"catched int\00", align 64
- at .cst1 = linker_private unnamed_addr constant [14 x i8] c"catched float\00", align 64
+ at .cst = private unnamed_addr constant [12 x i8] c"catched int\00", align 64
+ at .cst1 = private unnamed_addr constant [14 x i8] c"catched float\00", align 64
 
 ; V8ABS-LABEL: main:
 ; V8ABS:        .cfi_startproc

Modified: llvm/trunk/test/CodeGen/SPARC/setjmp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SPARC/setjmp.ll?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/SPARC/setjmp.ll (original)
+++ llvm/trunk/test/CodeGen/SPARC/setjmp.ll Thu Mar 13 18:18:37 2014
@@ -7,7 +7,7 @@
 %struct.__jmp_buf_tag = type { [3 x i32], i32, %0 }
 
 @jenv = common unnamed_addr global %struct.jmpbuf_env* null
- at .cst = linker_private unnamed_addr constant [30 x i8] c"in bar with jmp_buf's id: %d\0A\00", align 64
+ at .cst = private unnamed_addr constant [30 x i8] c"in bar with jmp_buf's id: %d\0A\00", align 64
 
 ; CHECK-LABEL: foo
 ; CHECK-DAG:   st {{.+}}, [%i0]

Removed: llvm/trunk/test/CodeGen/X86/2009-08-23-linkerprivate.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-08-23-linkerprivate.ll?rev=203865&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2009-08-23-linkerprivate.ll (original)
+++ llvm/trunk/test/CodeGen/X86/2009-08-23-linkerprivate.ll (removed)
@@ -1,8 +0,0 @@
-; RUN: llc < %s -march=x86 -mtriple=i686-apple-darwin | FileCheck %s
-
-; ModuleID = '/Volumes/MacOS9/tests/WebKit/JavaScriptCore/profiler/ProfilerServer.mm'
-
-@"\01l_objc_msgSend_fixup_alloc" = linker_private_weak hidden global i32 0, section "__DATA, __objc_msgrefs, coalesced", align 16
-
-; CHECK: .globl l_objc_msgSend_fixup_alloc
-; CHECK: .weak_definition l_objc_msgSend_fixup_alloc

Modified: llvm/trunk/test/CodeGen/X86/cfstring.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/cfstring.ll?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/cfstring.ll (original)
+++ llvm/trunk/test/CodeGen/X86/cfstring.ll Thu Mar 13 18:18:37 2014
@@ -7,7 +7,7 @@
 ; Make sure that the string ends up the correct section.
 
 ; CHECK:        .section __TEXT,__cstring
-; CHECK-NEXT: l_.str3:
+; CHECK-NEXT: L_.str3:
 
 ; CHECK:        .section  __DATA,__cfstring
 ; CHECK-NEXT:   .align  4
@@ -15,13 +15,13 @@
 ; CHECK-NEXT:   .quad  ___CFConstantStringClassReference
 ; CHECK-NEXT:   .long  1992
 ; CHECK-NEXT:   .space  4
-; CHECK-NEXT:   .quad  l_.str3
+; CHECK-NEXT:   .quad  L_.str3
 ; CHECK-NEXT:   .long  0
 ; CHECK-NEXT:   .space  4
 
 @isLogVisible = global i8 0, align 1
 @__CFConstantStringClassReference = external global [0 x i32]
- at .str3 = linker_private unnamed_addr constant [1 x i8] zeroinitializer, align 1
+ at .str3 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
 @_unnamed_cfstring_4 = private constant %struct.NSConstantString { i32* getelementptr inbounds ([0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([1 x i8]* @.str3, i32 0, i32 0), i32 0 }, section "__DATA,__cfstring"
 @null.array = weak_odr constant [1 x i8] zeroinitializer, align 1
 

Removed: llvm/trunk/test/CodeGen/X86/linker-private.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/linker-private.ll?rev=203865&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/linker-private.ll (original)
+++ llvm/trunk/test/CodeGen/X86/linker-private.ll (removed)
@@ -1,10 +0,0 @@
-; RUN: llc < %s -mtriple=x86_64-pc-linux | FileCheck --check-prefix=ELF %s
-; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck --check-prefix=MACHO %s
-
- at foo = linker_private global i32 42
-;ELF: {{^}}.Lfoo:
-;MACHO: {{^}}l_foo:
-
-define i32* @f() {
-  ret i32* @foo
-}

Removed: llvm/trunk/test/Feature/linker_private_linkages.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Feature/linker_private_linkages.ll?rev=203865&view=auto
==============================================================================
--- llvm/trunk/test/Feature/linker_private_linkages.ll (original)
+++ llvm/trunk/test/Feature/linker_private_linkages.ll (removed)
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
- at foo = linker_private hidden global i32 0
- at bar = linker_private_weak hidden global i32 0

Removed: llvm/trunk/test/Transforms/ConstantMerge/linker-private.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ConstantMerge/linker-private.ll?rev=203865&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/ConstantMerge/linker-private.ll (original)
+++ llvm/trunk/test/Transforms/ConstantMerge/linker-private.ll (removed)
@@ -1,23 +0,0 @@
-; RUN: opt < %s -constmerge -S | FileCheck %s
-; <rdar://problem/10564621>
-
-%0 = type opaque
-%struct.NSConstantString = type { i32*, i32, i8*, i32 }
-
-; CHECK: @.str3 = linker_private unnamed_addr constant [1 x i8] zeroinitializer, align 1
-
- at isLogVisible = global i8 0, align 1
- at __CFConstantStringClassReference = external global [0 x i32]
- at .str3 = linker_private unnamed_addr constant [1 x i8] zeroinitializer, align 1
- at _unnamed_cfstring_4 = private constant %struct.NSConstantString { i32* getelementptr inbounds ([0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([1 x i8]* @.str3, i32 0, i32 0), i32 0 }, section "__DATA,__cfstring"
- at null.array = weak_odr constant [1 x i8] zeroinitializer, align 1
-
-define linkonce_odr void @bar() nounwind ssp align 2 {
-entry:
-  %stack = alloca i8*, align 4
-  %call = call %0* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %0* (i8*, i8*, %0*)*)(i8* null, i8* null, %0* bitcast (%struct.NSConstantString* @_unnamed_cfstring_4 to %0*))
-  store i8* getelementptr inbounds ([1 x i8]* @null.array, i32 0, i32 0), i8** %stack, align 4
-  ret void
-}
-
-declare i8* @objc_msgSend(i8*, i8*, ...) nonlazybind

Modified: llvm/trunk/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll (original)
+++ llvm/trunk/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll Thu Mar 13 18:18:37 2014
@@ -24,11 +24,11 @@ target triple = "x86_64-apple-macosx10.9
 @"\01L_OBJC_METH_VAR_NAME_" = internal global [4 x i8] c"new\00", section "__TEXT,__objc_methname,cstring_literals", align 1
 @"\01L_OBJC_SELECTOR_REFERENCES_" = internal global i8* getelementptr inbounds ([4 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i64 0, i64 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip"
 @__CFConstantStringClassReference = external global [0 x i32]
- at .str = linker_private unnamed_addr constant [11 x i8] c"Failed: %@\00", align 1
+ at .str = private unnamed_addr constant [11 x i8] c"Failed: %@\00", align 1
 @_unnamed_cfstring_ = private constant %struct.NSConstantString { i32* getelementptr inbounds ([0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([11 x i8]* @.str, i32 0, i32 0), i64 10 }, section "__DATA,__cfstring"
 @"OBJC_CLASS_$_NSException" = external global %struct._class_t
 @"\01L_OBJC_CLASSLIST_REFERENCES_$_1" = internal global %struct._class_t* @"OBJC_CLASS_$_NSException", section "__DATA, __objc_classrefs, regular, no_dead_strip", align 8
- at .str2 = linker_private unnamed_addr constant [4 x i8] c"Foo\00", align 1
+ at .str2 = private unnamed_addr constant [4 x i8] c"Foo\00", align 1
 @_unnamed_cfstring_3 = private constant %struct.NSConstantString { i32* getelementptr inbounds ([0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([4 x i8]* @.str2, i32 0, i32 0), i64 3 }, section "__DATA,__cfstring"
 @"\01L_OBJC_METH_VAR_NAME_4" = internal global [14 x i8] c"raise:format:\00", section "__TEXT,__objc_methname,cstring_literals", align 1
 @"\01L_OBJC_SELECTOR_REFERENCES_5" = internal global i8* getelementptr inbounds ([14 x i8]* @"\01L_OBJC_METH_VAR_NAME_4", i64 0, i64 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip"

Modified: llvm/trunk/utils/kate/llvm.xml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/kate/llvm.xml?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/utils/kate/llvm.xml (original)
+++ llvm/trunk/utils/kate/llvm.xml Thu Mar 13 18:18:37 2014
@@ -39,8 +39,6 @@
     </list>
     <list name="linkage-types">
       <item> private </item>
-      <item> linker_private </item>
-      <item> linker_private_weak </item>
       <item> internal </item>
       <item> available_externally </item>
       <item> linkonce </item>

Modified: llvm/trunk/utils/llvm.grm
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvm.grm?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/utils/llvm.grm (original)
+++ llvm/trunk/utils/llvm.grm Thu Mar 13 18:18:37 2014
@@ -92,8 +92,6 @@ GVInternalLinkage
  | dllexport
  | common
  | private
- | "linker_private"
- | "linker_private_weak"
  ;
 
 GVExternalLinkage

Modified: llvm/trunk/utils/vim/llvm.vim
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/vim/llvm.vim?rev=203866&r1=203865&r2=203866&view=diff
==============================================================================
--- llvm/trunk/utils/vim/llvm.vim (original)
+++ llvm/trunk/utils/vim/llvm.vim Thu Mar 13 18:18:37 2014
@@ -43,8 +43,7 @@ syn keyword llvmKeyword blockaddress byv
 syn keyword llvmKeyword constant datalayout declare default define deplibs
 syn keyword llvmKeyword dllexport dllimport except extern_weak external fastcc
 syn keyword llvmKeyword filter gc global hidden initialexec inlinehint inreg
-syn keyword llvmKeyword intel_ocl_bicc inteldialect internal linker_private
-syn keyword llvmKeyword linker_private_weak
+syn keyword llvmKeyword intel_ocl_bicc inteldialect internal
 syn keyword llvmKeyword linkonce linkonce_odr
 syn keyword llvmKeyword localdynamic localexec minsize module monotonic
 syn keyword llvmKeyword msp430_intrcc naked nest noalias nocapture





More information about the llvm-commits mailing list