[llvm] r223654 - Simple style fixes.
Rafael Espindola
rafael.espindola at gmail.com
Mon Dec 8 05:35:09 PST 2014
Author: rafael
Date: Mon Dec 8 07:35:09 2014
New Revision: 223654
URL: http://llvm.org/viewvc/llvm-project?rev=223654&view=rev
Log:
Simple style fixes.
* Use a range loop.
* Move simple continue checks earlier.
* clang-format.
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=223654&r1=223653&r2=223654&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Mon Dec 8 07:35:09 2014
@@ -1475,27 +1475,28 @@ bool ModuleLinker::run() {
// Link in the function bodies that are defined in the source module into
// DstM.
- for (Module::iterator SF = SrcM->begin(), E = SrcM->end(); SF != E; ++SF) {
+ for (Function &SF : *SrcM) {
+ // Skip if no body (function is external).
+ if (SF.isDeclaration())
+ continue;
+
// Skip if not linking from source.
- if (DoNotLinkFromSource.count(SF)) continue;
+ if (DoNotLinkFromSource.count(&SF))
+ continue;
- Function *DF = cast<Function>(ValueMap[SF]);
+ Function *DF = cast<Function>(ValueMap[&SF]);
// Link in the prefix data.
- if (SF->hasPrefixData())
- DF->setPrefixData(MapValue(
- SF->getPrefixData(), ValueMap, RF_None, &TypeMap, &ValMaterializer));
+ if (SF.hasPrefixData())
+ DF->setPrefixData(MapValue(SF.getPrefixData(), ValueMap, RF_None,
+ &TypeMap, &ValMaterializer));
// Link in the prologue data.
- if (SF->hasPrologueData())
- DF->setPrologueData(MapValue(
- SF->getPrologueData(), ValueMap, RF_None, &TypeMap, &ValMaterializer));
-
- // Skip if no body (function is external).
- if (SF->isDeclaration())
- continue;
+ if (SF.hasPrologueData())
+ DF->setPrologueData(MapValue(SF.getPrologueData(), ValueMap, RF_None,
+ &TypeMap, &ValMaterializer));
- if (linkFunctionBody(DF, SF))
+ if (linkFunctionBody(DF, &SF))
return true;
}
More information about the llvm-commits
mailing list