[lld-macho][NFC] Make `!= nullptr` implicit

This commit is contained in:
Jez Ng 2020-09-23 20:09:49 -07:00
parent ca8752a793
commit 9c70281497
3 changed files with 5 additions and 5 deletions

View File

@ -613,7 +613,7 @@ bool macho::link(llvm::ArrayRef<const char *> argsArr, bool canExitEarly,
break;
case OPT_weak_library: {
auto *dylibFile = dyn_cast_or_null<DylibFile>(addFile(arg->getValue()));
if (dylibFile != nullptr)
if (dylibFile)
dylibFile->forceWeakImport = true;
break;
}
@ -628,7 +628,7 @@ bool macho::link(llvm::ArrayRef<const char *> argsArr, bool canExitEarly,
StringRef name = arg->getValue();
if (Optional<std::string> path = findLibrary(name)) {
auto *dylibFile = dyn_cast_or_null<DylibFile>(addFile(*path));
if (opt.getID() == OPT_weak_l && dylibFile != nullptr)
if (opt.getID() == OPT_weak_l && dylibFile)
dylibFile->forceWeakImport = true;
break;
}
@ -640,7 +640,7 @@ bool macho::link(llvm::ArrayRef<const char *> argsArr, bool canExitEarly,
StringRef name = arg->getValue();
if (Optional<std::string> path = findFramework(name)) {
auto *dylibFile = dyn_cast_or_null<DylibFile>(addFile(*path));
if (opt.getID() == OPT_weak_framework && dylibFile != nullptr)
if (opt.getID() == OPT_weak_framework && dylibFile)
dylibFile->forceWeakImport = true;
break;
}

View File

@ -387,7 +387,7 @@ static Optional<DylibFile *> loadReexport(StringRef path, DylibFile *umbrella) {
// TODO: Expand @loader_path, @executable_path etc
if (currentTopLevelTapi != nullptr) {
if (currentTopLevelTapi) {
for (InterfaceFile &child :
make_pointee_range(currentTopLevelTapi->documents())) {
if (path == child.getInstallName())

View File

@ -54,7 +54,7 @@ std::vector<OutputSegment *> macho::outputSegments;
OutputSegment *macho::getOrCreateOutputSegment(StringRef name) {
OutputSegment *&segRef = nameToOutputSegment[name];
if (segRef != nullptr)
if (segRef)
return segRef;
segRef = make<OutputSegment>();