diff options
Diffstat (limited to 'llvm/tools/llvm-nm/llvm-nm.cpp')
-rw-r--r-- | llvm/tools/llvm-nm/llvm-nm.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/tools/llvm-nm/llvm-nm.cpp b/llvm/tools/llvm-nm/llvm-nm.cpp index 88217a5403f..751156d0f7f 100644 --- a/llvm/tools/llvm-nm/llvm-nm.cpp +++ b/llvm/tools/llvm-nm/llvm-nm.cpp @@ -677,7 +677,7 @@ static void darwinPrintStab(MachOObjectFile *MachO, SymbolListT::iterator I) { } static Optional<std::string> demangle(StringRef Name, bool StripUnderscore) { - if (StripUnderscore && Name.size() > 0 && Name[0] == '_') + if (StripUnderscore && !Name.empty() && Name[0] == '_') Name = Name.substr(1); if (!Name.startswith("_Z")) @@ -1163,7 +1163,7 @@ dumpSymbolNamesFromObject(SymbolicFile &Obj, bool printName, // file get the section number for that section in this object file. unsigned int Nsect = 0; MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(&Obj); - if (SegSect.size() != 0 && MachO) { + if (!SegSect.empty() && MachO) { Nsect = getNsectForSegSect(MachO); // If this section is not in the object file no symbols are printed. if (Nsect == 0) @@ -1800,7 +1800,7 @@ static void dumpSymbolNamesFromFile(std::string &Filename) { } if (MachOUniversalBinary *UB = dyn_cast<MachOUniversalBinary>(&Bin)) { // If we have a list of architecture flags specified dump only those. - if (!ArchAll && ArchFlags.size() != 0) { + if (!ArchAll && !ArchFlags.empty()) { // Look for a slice in the universal binary that matches each ArchFlag. bool ArchFound; for (unsigned i = 0; i < ArchFlags.size(); ++i) { @@ -2071,7 +2071,7 @@ int main(int argc, char **argv) { } } - if (SegSect.size() != 0 && SegSect.size() != 2) + if (!SegSect.empty() && SegSect.size() != 2) error("bad number of arguments (must be two arguments)", "for the -s option"); |