aboutsummaryrefslogtreecommitdiff
path: root/lib/Linker/LinkModules.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-09-29 11:25:42 +0000
committerDuncan Sands <baldrick@free.fr>2008-09-29 11:25:42 +0000
commit5df3186f598163258fabf3448d9372843804d1ab (patch)
tree18ba793b36fe3510dc3e57d0d7156bbfe7b7af31 /lib/Linker/LinkModules.cpp
parent7ab5799f75766f8f6bc8b76416f6ae925324ebb8 (diff)
Rename isWeakForLinker to mayBeOverridden. Use it
instead of hasWeakLinkage in a bunch of optimization passes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56782 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker/LinkModules.cpp')
-rw-r--r--lib/Linker/LinkModules.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp
index b867705fe1..cee3b23e2a 100644
--- a/lib/Linker/LinkModules.cpp
+++ b/lib/Linker/LinkModules.cpp
@@ -477,7 +477,7 @@ static bool GetLinkageResult(GlobalValue *Dest, const GlobalValue *Src,
"': can only link appending global with another appending global!");
LinkFromSrc = true; // Special cased.
LT = Src->getLinkage();
- } else if (Src->isWeakForLinker()) {
+ } else if (Src->mayBeOverridden()) {
// At this point we know that Dest has LinkOnce, External*, Weak, Common,
// or DLL* linkage.
if ((Dest->hasLinkOnceLinkage() &&
@@ -489,7 +489,7 @@ static bool GetLinkageResult(GlobalValue *Dest, const GlobalValue *Src,
LinkFromSrc = false;
LT = Dest->getLinkage();
}
- } else if (Dest->isWeakForLinker()) {
+ } else if (Dest->mayBeOverridden()) {
// At this point we know that Src has External* or DLL* linkage.
if (Src->hasExternalWeakLinkage()) {
LinkFromSrc = false;
@@ -757,7 +757,7 @@ static bool LinkAlias(Module *Dest, const Module *Src,
} else if (GlobalVariable *DGVar = dyn_cast_or_null<GlobalVariable>(DGV)) {
// The only allowed way is to link alias with external declaration or weak
// symbol..
- if (DGVar->isDeclaration() || DGVar->isWeakForLinker()) {
+ if (DGVar->isDeclaration() || DGVar->mayBeOverridden()) {
// But only if aliasee is global too...
if (!isa<GlobalVariable>(DAliasee))
return Error(Err, "Global-Alias Collision on '" + SGA->getName() +
@@ -786,7 +786,7 @@ static bool LinkAlias(Module *Dest, const Module *Src,
} else if (Function *DF = dyn_cast_or_null<Function>(DGV)) {
// The only allowed way is to link alias with external declaration or weak
// symbol...
- if (DF->isDeclaration() || DF->isWeakForLinker()) {
+ if (DF->isDeclaration() || DF->mayBeOverridden()) {
// But only if aliasee is function too...
if (!isa<Function>(DAliasee))
return Error(Err, "Function-Alias Collision on '" + SGA->getName() +
@@ -862,10 +862,10 @@ static bool LinkGlobalInits(Module *Dest, const Module *Src,
if (DGV->getInitializer() != SInit)
return Error(Err, "Global Variable Collision on '" + SGV->getName() +
"': global variables have different initializers");
- } else if (DGV->isWeakForLinker()) {
+ } else if (DGV->mayBeOverridden()) {
// Nothing is required, mapped values will take the new global
// automatically.
- } else if (SGV->isWeakForLinker()) {
+ } else if (SGV->mayBeOverridden()) {
// Nothing is required, mapped values will take the new global
// automatically.
} else if (DGV->hasAppendingLinkage()) {