[lld] r209357 - Simplify nullptr check.
Rui Ueyama
ruiu at google.com
Wed May 21 17:36:36 PDT 2014
Author: ruiu
Date: Wed May 21 19:36:36 2014
New Revision: 209357
URL: http://llvm.org/viewvc/llvm-project?rev=209357&view=rev
Log:
Simplify nullptr check.
Modified:
lld/trunk/lib/Core/LinkingContext.cpp
Modified: lld/trunk/lib/Core/LinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Core/LinkingContext.cpp?rev=209357&r1=209356&r2=209357&view=diff
==============================================================================
--- lld/trunk/lib/Core/LinkingContext.cpp (original)
+++ lld/trunk/lib/Core/LinkingContext.cpp Wed May 21 19:36:36 2014
@@ -73,13 +73,10 @@ LinkingContext::createUndefinedSymbolFil
void LinkingContext::createInternalFiles(
std::vector<std::unique_ptr<File> > &result) const {
- std::unique_ptr<File> internalFile;
- internalFile = createEntrySymbolFile();
- if (internalFile)
- result.push_back(std::move(internalFile));
- internalFile = createUndefinedSymbolFile();
- if (internalFile)
- result.push_back(std::move(internalFile));
+ if (std::unique_ptr<File> file = createEntrySymbolFile())
+ result.push_back(std::move(file));
+ if (std::unique_ptr<File> file = createUndefinedSymbolFile())
+ result.push_back(std::move(file));
}
void LinkingContext::addPasses(PassManager &pm) {}
More information about the llvm-commits
mailing list