cl::aliasopt(PrivateHeaders));
static StringRef ToolName;
+static int ReturnValue = EXIT_SUCCESS;
bool llvm::error(std::error_code EC) {
if (!EC)
outs() << ToolName << ": error reading file: " << EC.message() << ".\n";
outs().flush();
+ ReturnValue = EXIT_FAILURE;
return true;
}
}
for (const SectionRef &Section : Obj->sections()) {
- bool Text = Section.isText();
- if (!Text)
+ if (!Section.isText() || Section.isVirtual())
continue;
uint64_t SectionAddr = Section.getAddress();
StringRef BytesStr;
if (error(Section.getContents(BytesStr)))
break;
- ArrayRef<uint8_t> Bytes((uint8_t *)BytesStr.data(), BytesStr.size());
+ ArrayRef<uint8_t> Bytes(reinterpret_cast<const uint8_t *>(BytesStr.data()),
+ BytesStr.size());
uint64_t Size;
uint64_t Index;
outs() << format("%8" PRIx64 ":", SectionAddr + Index);
if (!NoShowRawInsn) {
outs() << "\t";
- DumpBytes(StringRef((char *)Bytes.data() + Index, Size));
+ DumpBytes(StringRef(
+ reinterpret_cast<const char *>(Bytes.data()) + Index, Size));
}
IP->printInst(&Inst, outs(), "");
outs() << CommentStream.str();
std::for_each(InputFilenames.begin(), InputFilenames.end(),
DumpInput);
- return 0;
+ return ReturnValue;
}