Add the private linkage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62279 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2009-01-15 20:18:42 +00:00
parent f193ff0590
commit bb46f52027
72 changed files with 401 additions and 145 deletions

View File

@@ -72,7 +72,7 @@ bool ConstantMerge::runOnModule(Module &M) {
// If this GV is dead, remove it.
GV->removeDeadConstantUsers();
if (GV->use_empty() && GV->hasInternalLinkage()) {
if (GV->use_empty() && GV->hasLocalLinkage()) {
GV->eraseFromParent();
continue;
}
@@ -86,7 +86,7 @@ bool ConstantMerge::runOnModule(Module &M) {
if (Slot == 0) { // Nope, add it to the map.
Slot = GV;
} else if (GV->hasInternalLinkage()) { // Yup, this is a duplicate!
} else if (GV->hasLocalLinkage()) { // Yup, this is a duplicate!
// Make all uses of the duplicate constant use the canonical version.
Replacements.push_back(std::make_pair(GV, Slot));
}