aboutsummaryrefslogtreecommitdiff
path: root/lld/MachO
diff options
context:
space:
mode:
authorJez Ng <jezng@fb.com>2020-09-23 20:09:49 -0700
committerJez Ng <jezng@fb.com>2020-09-23 20:09:49 -0700
commit9c70281497730a7dc7df43435bf570bef1108454 (patch)
tree038aacfdf2e46ded39d00ea07f0a001ff61178cc /lld/MachO
parentca8752a793f1576b666fb22a74278d44725138f1 (diff)
downloadllvm-project-9c70281497730a7dc7df43435bf570bef1108454.tar.gz
[lld-macho][NFC] Make `!= nullptr` implicit
Diffstat (limited to 'lld/MachO')
-rw-r--r--lld/MachO/Driver.cpp6
-rw-r--r--lld/MachO/InputFiles.cpp2
-rw-r--r--lld/MachO/OutputSegment.cpp2
3 files changed, 5 insertions, 5 deletions
diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp
index 79808d67bf09..e95a7350921f 100644
--- a/lld/MachO/Driver.cpp
+++ b/lld/MachO/Driver.cpp
@@ -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;
}
diff --git a/lld/MachO/InputFiles.cpp b/lld/MachO/InputFiles.cpp
index 8516e90cffc3..ad2d6a25849a 100644
--- a/lld/MachO/InputFiles.cpp
+++ b/lld/MachO/InputFiles.cpp
@@ -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())
diff --git a/lld/MachO/OutputSegment.cpp b/lld/MachO/OutputSegment.cpp
index 5e57c49f5c0a..07e45901581b 100644
--- a/lld/MachO/OutputSegment.cpp
+++ b/lld/MachO/OutputSegment.cpp
@@ -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>();