summaryrefslogtreecommitdiff
path: root/tools/llvm-symbolizer/LLVMSymbolize.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvm-symbolizer/LLVMSymbolize.cpp')
-rw-r--r--tools/llvm-symbolizer/LLVMSymbolize.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/tools/llvm-symbolizer/LLVMSymbolize.cpp b/tools/llvm-symbolizer/LLVMSymbolize.cpp
index 837ed19aa4..4a9bbe5e82 100644
--- a/tools/llvm-symbolizer/LLVMSymbolize.cpp
+++ b/tools/llvm-symbolizer/LLVMSymbolize.cpp
@@ -171,7 +171,7 @@ const char LLVMSymbolizer::kBadString[] = "??";
std::string LLVMSymbolizer::symbolizeCode(const std::string &ModuleName,
uint64_t ModuleOffset) {
ModuleInfo *Info = getOrCreateModuleInfo(ModuleName);
- if (Info == 0)
+ if (!Info)
return printDILineInfo(DILineInfo());
if (Opts.PrintInlining) {
DIInliningInfo InlinedContext =
@@ -232,7 +232,7 @@ static bool findDebugBinary(const std::string &OrigPath,
std::string &Result) {
std::string OrigRealPath = OrigPath;
#if defined(HAVE_REALPATH)
- if (char *RP = realpath(OrigPath.c_str(), NULL)) {
+ if (char *RP = realpath(OrigPath.c_str(), nullptr)) {
OrigRealPath = RP;
free(RP);
}
@@ -298,8 +298,8 @@ LLVMSymbolizer::getOrCreateBinary(const std::string &Path) {
BinaryMapTy::iterator I = BinaryForPath.find(Path);
if (I != BinaryForPath.end())
return I->second;
- Binary *Bin = 0;
- Binary *DbgBin = 0;
+ Binary *Bin = nullptr;
+ Binary *DbgBin = nullptr;
ErrorOr<Binary *> BinaryOrErr = createBinary(Path);
if (!error(BinaryOrErr.getError())) {
std::unique_ptr<Binary> ParsedBinary(BinaryOrErr.get());
@@ -319,7 +319,7 @@ LLVMSymbolizer::getOrCreateBinary(const std::string &Path) {
}
}
// Try to locate the debug binary using .gnu_debuglink section.
- if (DbgBin == 0) {
+ if (!DbgBin) {
std::string DebuglinkName;
uint32_t CRCHash;
std::string DebugBinaryPath;
@@ -333,7 +333,7 @@ LLVMSymbolizer::getOrCreateBinary(const std::string &Path) {
}
}
}
- if (DbgBin == 0)
+ if (!DbgBin)
DbgBin = Bin;
BinaryPair Res = std::make_pair(Bin, DbgBin);
BinaryForPath[Path] = Res;
@@ -342,9 +342,9 @@ LLVMSymbolizer::getOrCreateBinary(const std::string &Path) {
ObjectFile *
LLVMSymbolizer::getObjectFileFromBinary(Binary *Bin, const std::string &ArchName) {
- if (Bin == 0)
- return 0;
- ObjectFile *Res = 0;
+ if (!Bin)
+ return nullptr;
+ ObjectFile *Res = nullptr;
if (MachOUniversalBinary *UB = dyn_cast<MachOUniversalBinary>(Bin)) {
ObjectFileForArchMapTy::iterator I = ObjectFileForArch.find(
std::make_pair(UB, ArchName));
@@ -382,10 +382,10 @@ LLVMSymbolizer::getOrCreateModuleInfo(const std::string &ModuleName) {
ObjectFile *Obj = getObjectFileFromBinary(Binaries.first, ArchName);
ObjectFile *DbgObj = getObjectFileFromBinary(Binaries.second, ArchName);
- if (Obj == 0) {
+ if (!Obj) {
// Failed to find valid object file.
- Modules.insert(make_pair(ModuleName, (ModuleInfo *)0));
- return 0;
+ Modules.insert(make_pair(ModuleName, (ModuleInfo *)nullptr));
+ return nullptr;
}
DIContext *Context = DIContext::getDWARFContext(DbgObj);
assert(Context);
@@ -427,7 +427,7 @@ std::string LLVMSymbolizer::DemangleName(const std::string &Name) {
if (Name.substr(0, 2) != "_Z")
return Name;
int status = 0;
- char *DemangledName = __cxa_demangle(Name.c_str(), 0, 0, &status);
+ char *DemangledName = __cxa_demangle(Name.c_str(), nullptr, nullptr, &status);
if (status != 0)
return Name;
std::string Result = DemangledName;