[llvm] r223470 - Use an early return. NFC.
Rafael Espindola
rafael.espindola at gmail.com
Fri Dec 5 07:42:30 PST 2014
Author: rafael
Date: Fri Dec 5 09:42:30 2014
New Revision: 223470
URL: http://llvm.org/viewvc/llvm-project?rev=223470&view=rev
Log:
Use an early return. NFC.
Modified:
llvm/trunk/lib/Linker/LinkModules.cpp
Modified: llvm/trunk/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=223470&r1=223469&r2=223470&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Fri Dec 5 09:42:30 2014
@@ -1028,30 +1028,30 @@ bool ModuleLinker::linkGlobalValueProto(
else
NewGV = linkGlobalAliasProto(cast<GlobalAlias>(SGV), DGV, LinkFromSrc);
- if (NewGV) {
- if (NewGV != DGV)
- copyGVAttributes(NewGV, SGV);
-
- NewGV->setUnnamedAddr(HasUnnamedAddr);
- NewGV->setVisibility(Visibility);
-
- if (auto *NewGO = dyn_cast<GlobalObject>(NewGV)) {
- if (C)
- NewGO->setComdat(C);
+ if (!NewGV)
+ return false;
- if (DGV && DGV->hasCommonLinkage() && SGV->hasCommonLinkage())
- NewGO->setAlignment(std::max(DGV->getAlignment(), SGV->getAlignment()));
- }
+ if (NewGV != DGV)
+ copyGVAttributes(NewGV, SGV);
+
+ NewGV->setUnnamedAddr(HasUnnamedAddr);
+ NewGV->setVisibility(Visibility);
+
+ if (auto *NewGO = dyn_cast<GlobalObject>(NewGV)) {
+ if (C)
+ NewGO->setComdat(C);
+
+ if (DGV && DGV->hasCommonLinkage() && SGV->hasCommonLinkage())
+ NewGO->setAlignment(std::max(DGV->getAlignment(), SGV->getAlignment()));
+ }
- // Make sure to remember this mapping.
- if (NewGV != DGV) {
- if (DGV) {
- DGV->replaceAllUsesWith(
- ConstantExpr::getBitCast(NewGV, DGV->getType()));
- DGV->eraseFromParent();
- }
- ValueMap[SGV] = NewGV;
+ // Make sure to remember this mapping.
+ if (NewGV != DGV) {
+ if (DGV) {
+ DGV->replaceAllUsesWith(ConstantExpr::getBitCast(NewGV, DGV->getType()));
+ DGV->eraseFromParent();
}
+ ValueMap[SGV] = NewGV;
}
return false;
More information about the llvm-commits
mailing list