summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b69b6b5)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254967
91177308-0d34-0410-b5e6-
96231b3b80d8
/// Handles cloning of a global values from the source module into
/// the destination module, including setting the attributes and visibility.
/// Handles cloning of a global values from the source module into
/// the destination module, including setting the attributes and visibility.
- GlobalValue *copyGlobalValueProto(const GlobalValue *SGV,
- const GlobalValue *DGV, bool ForDefinition);
+ GlobalValue *copyGlobalValueProto(const GlobalValue *SGV, bool ForDefinition);
/// Check if we should promote the given local value to global scope.
bool doPromoteLocalToGlobal(const GlobalValue *SGV);
/// Check if we should promote the given local value to global scope.
bool doPromoteLocalToGlobal(const GlobalValue *SGV);
}
GlobalValue *ModuleLinker::copyGlobalValueProto(const GlobalValue *SGV,
}
GlobalValue *ModuleLinker::copyGlobalValueProto(const GlobalValue *SGV,
- const GlobalValue *DGV,
bool ForDefinition) {
GlobalValue *NewGV;
if (auto *SGVar = dyn_cast<GlobalVariable>(SGV)) {
bool ForDefinition) {
GlobalValue *NewGV;
if (auto *SGVar = dyn_cast<GlobalVariable>(SGV)) {
NewGV->setLinkage(GlobalValue::ExternalWeakLinkage);
copyGVAttributes(NewGV, SGV);
NewGV->setLinkage(GlobalValue::ExternalWeakLinkage);
copyGVAttributes(NewGV, SGV);
- setVisibility(NewGV, SGV, DGV);
GlobalValue *NewGV;
if (!LinkFromSrc && DGV) {
NewGV = DGV;
GlobalValue *NewGV;
if (!LinkFromSrc && DGV) {
NewGV = DGV;
- // When linking from source we setVisibility from copyGlobalValueProto.
- setVisibility(NewGV, SGV, DGV);
} else {
// If we are done linking global value bodies (i.e. we are performing
// metadata linking), don't link in the global value due to this
} else {
// If we are done linking global value bodies (i.e. we are performing
// metadata linking), don't link in the global value due to this
if (DoneLinkingBodies)
return nullptr;
if (DoneLinkingBodies)
return nullptr;
- NewGV = copyGlobalValueProto(SGV, DGV, LinkFromSrc);
+ NewGV = copyGlobalValueProto(SGV, LinkFromSrc);
+ setVisibility(NewGV, SGV, DGV);
NewGV->setUnnamedAddr(HasUnnamedAddr);
if (auto *NewGO = dyn_cast<GlobalObject>(NewGV)) {
NewGV->setUnnamedAddr(HasUnnamedAddr);
if (auto *NewGO = dyn_cast<GlobalObject>(NewGV)) {