summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-nm
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2015-10-06 23:24:35 +0000
committerHans Wennborg <hans@hanshq.net>2015-10-06 23:24:35 +0000
commit083ca9bb3233fb4df575bfb8c4198e3f9d6e3acd (patch)
tree81cfb3fc70e644d0ab252b18b9fabf6b764da86a /llvm/tools/llvm-nm
parent44780acd913643391779768c0b1d9259e294dbe8 (diff)
downloadbcm5719-llvm-083ca9bb3233fb4df575bfb8c4198e3f9d6e3acd.tar.gz
bcm5719-llvm-083ca9bb3233fb4df575bfb8c4198e3f9d6e3acd.zip
Fix Clang-tidy modernize-use-nullptr warnings in source directories and generated files; other minor cleanups.
Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13321 llvm-svn: 249482
Diffstat (limited to 'llvm/tools/llvm-nm')
-rw-r--r--llvm/tools/llvm-nm/llvm-nm.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/tools/llvm-nm/llvm-nm.cpp b/llvm/tools/llvm-nm/llvm-nm.cpp
index ce12fe6bc0e..a0b5e9b4eaa 100644
--- a/llvm/tools/llvm-nm/llvm-nm.cpp
+++ b/llvm/tools/llvm-nm/llvm-nm.cpp
@@ -44,6 +44,7 @@
#include <cstring>
#include <system_error>
#include <vector>
+
using namespace llvm;
using namespace object;
@@ -159,7 +160,7 @@ bool MultipleFiles = false;
bool HadError = false;
std::string ToolName;
-}
+} // anonymous namespace
static void error(Twine Message, Twine Path = Twine()) {
HadError = true;
@@ -182,7 +183,7 @@ struct NMSymbol {
StringRef Name;
BasicSymbolRef Sym;
};
-}
+} // anonymous namespace
static bool compareSymbolAddress(const NMSymbol &A, const NMSymbol &B) {
bool ADefined = !(A.Sym.getFlags() & SymbolRef::SF_Undefined);
@@ -439,13 +440,14 @@ static const struct DarwinStabName DarwinStabNames[] = {
{MachO::N_ECOMM, "ECOMM"},
{MachO::N_ECOML, "ECOML"},
{MachO::N_LENG, "LENG"},
- {0, 0}};
+ {0, nullptr}};
+
static const char *getDarwinStabString(uint8_t NType) {
for (unsigned i = 0; DarwinStabNames[i].Name; i++) {
if (DarwinStabNames[i].NType == NType)
return DarwinStabNames[i].Name;
}
- return 0;
+ return nullptr;
}
// darwinPrintStab() prints the n_sect, n_desc along with a symbolic name of
@@ -1150,7 +1152,6 @@ static void dumpSymbolNamesFromFile(std::string &Filename) {
return;
}
error("unrecognizable file type", Filename);
- return;
}
int main(int argc, char **argv) {
OpenPOWER on IntegriCloud