Skip to content

Commit

Permalink
- Add the LinkerPrivateWeakDefAutoLinkage to the Ada bindings.
Browse files Browse the repository at this point in the history
- Support the LinkerWeak*Linkage types in llvm-nm and in LinkModules.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111952 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
isanbard committed Aug 24, 2010
1 parent fba88d4 commit 4e34d50
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 19 deletions.
36 changes: 19 additions & 17 deletions bindings/ada/llvm/llvm.ads
Original file line number Diff line number Diff line change
Expand Up @@ -317,25 +317,27 @@ package llvm is
LLVMGhostLinkage,
LLVMCommonLinkage,
LLVMLinkerPrivateLinkage,
LLVMLinkerPrivateWeakLinkage);
LLVMLinkerPrivateWeakLinkage,
LinkerPrivateWeakDefAutoLinkage);

for LLVMLinkage use
(LLVMExternalLinkage => 0,
LLVMAvailableExternallyLinkage => 1,
LLVMLinkOnceAnyLinkage => 2,
LLVMLinkOnceODRLinkage => 3,
LLVMWeakAnyLinkage => 4,
LLVMWeakODRLinkage => 5,
LLVMAppendingLinkage => 6,
LLVMInternalLinkage => 7,
LLVMPrivateLinkage => 8,
LLVMDLLImportLinkage => 9,
LLVMDLLExportLinkage => 10,
LLVMExternalWeakLinkage => 11,
LLVMGhostLinkage => 12,
LLVMCommonLinkage => 13,
LLVMLinkerPrivateLinkage => 14,
LLVMLinkerPrivateWeakLinkage => 15);
(LLVMExternalLinkage => 0,
LLVMAvailableExternallyLinkage => 1,
LLVMLinkOnceAnyLinkage => 2,
LLVMLinkOnceODRLinkage => 3,
LLVMWeakAnyLinkage => 4,
LLVMWeakODRLinkage => 5,
LLVMAppendingLinkage => 6,
LLVMInternalLinkage => 7,
LLVMPrivateLinkage => 8,
LLVMDLLImportLinkage => 9,
LLVMDLLExportLinkage => 10,
LLVMExternalWeakLinkage => 11,
LLVMGhostLinkage => 12,
LLVMCommonLinkage => 13,
LLVMLinkerPrivateLinkage => 14,
LLVMLinkerPrivateWeakLinkage => 15,
LinkerPrivateWeakDefAutoLinkage => 16);

pragma Convention (C, LLVMLinkage);

Expand Down
6 changes: 6 additions & 0 deletions lib/Linker/LinkModules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,12 @@ CalculateAliasLinkage(const GlobalValue *SGV, const GlobalValue *DGV) {
else if (SL == GlobalValue::LinkerPrivateLinkage &&
DL == GlobalValue::LinkerPrivateLinkage)
return GlobalValue::LinkerPrivateLinkage;
else if (SL == GlobalValue::LinkerPrivateWeakLinkage &&
DL == GlobalValue::LinkerPrivateWeakLinkage)
return GlobalValue::LinkerPrivateWeakLinkage;
else if (SL == GlobalValue::LinkerPrivateWeakDefAutoLinkage &&
DL == GlobalValue::LinkerPrivateWeakDefAutoLinkage)
return GlobalValue::LinkerPrivateWeakDefAutoLinkage;
else {
assert (SL == GlobalValue::PrivateLinkage &&
DL == GlobalValue::PrivateLinkage && "Unexpected linkage type");
Expand Down
7 changes: 5 additions & 2 deletions tools/llvm-nm/llvm-nm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,11 @@ static char TypeCharForSymbol(GlobalValue &GV) {

static void DumpSymbolNameForGlobalValue(GlobalValue &GV) {
// Private linkage and available_externally linkage don't exist in symtab.
if (GV.hasPrivateLinkage() || GV.hasLinkerPrivateLinkage() ||
GV.hasLinkerPrivateWeakLinkage() || GV.hasAvailableExternallyLinkage())
if (GV.hasPrivateLinkage() ||
GV.hasLinkerPrivateLinkage() ||
GV.hasLinkerPrivateWeakLinkage() ||
GV.hasLinkerPrivateWeakDefAutoLinkage() ||
GV.hasAvailableExternallyLinkage())
return;

const std::string SymbolAddrStr = " "; // Not used yet...
Expand Down

0 comments on commit 4e34d50

Please sign in to comment.