mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-30 22:18:46 +00:00
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:
@@ -121,9 +121,10 @@ bool InternalizePass::runOnModule(Module &M) {
|
||||
bool Changed = false;
|
||||
|
||||
// Mark all functions not in the api as internal.
|
||||
// FIXME: maybe use private linkage?
|
||||
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
|
||||
if (!I->isDeclaration() && // Function must be defined here
|
||||
!I->hasInternalLinkage() && // Can't already have internal linkage
|
||||
!I->hasLocalLinkage() && // Can't already have internal linkage
|
||||
!ExternalNames.count(I->getName())) {// Not marked to keep external?
|
||||
I->setLinkage(GlobalValue::InternalLinkage);
|
||||
// Remove a callgraph edge from the external node to this function.
|
||||
@@ -149,9 +150,10 @@ bool InternalizePass::runOnModule(Module &M) {
|
||||
|
||||
// Mark all global variables with initializers that are not in the api as
|
||||
// internal as well.
|
||||
// FIXME: maybe use private linkage?
|
||||
for (Module::global_iterator I = M.global_begin(), E = M.global_end();
|
||||
I != E; ++I)
|
||||
if (!I->isDeclaration() && !I->hasInternalLinkage() &&
|
||||
if (!I->isDeclaration() && !I->hasLocalLinkage() &&
|
||||
!ExternalNames.count(I->getName())) {
|
||||
I->setLinkage(GlobalValue::InternalLinkage);
|
||||
Changed = true;
|
||||
|
Reference in New Issue
Block a user