llvm-bcanalyzer
llvm-c-test
llvm-cov
+ llvm-cxxdump
llvm-diff
llvm-dis
llvm-dsymutil
llvm-size
llvm-symbolizer
llvm-tblgen
- llvm-vtabledump
macho-dump
opt
FileCheck
# suffixes: A list of file extensions to treat as test files. This is overriden
# by individual lit.local.cfg files in the test subdirectories.
-config.suffixes = ['.ll', '.c', '.cpp', '.test', '.txt', '.s']
+config.suffixes = ['.ll', '.c', '.cxx', '.test', '.txt', '.s']
# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
# subdirectories contain auxiliary inputs for various tests in their parent
r"\bllvm-bcanalyzer\b",
r"\bllvm-config\b",
r"\bllvm-cov\b",
+ r"\bllvm-cxxdump\b",
r"\bllvm-diff\b",
r"\bllvm-dis\b",
r"\bllvm-dsymutil\b",
r"\bllvm-rtdyld\b",
r"\bllvm-size\b",
r"\bllvm-tblgen\b",
- r"\bllvm-vtabledump\b",
r"\bllvm-c-test\b",
r"\bmacho-dump\b",
NOJUNK + r"\bopt\b",
-RUN: llvm-vtabledump %p/Inputs/eh.obj.coff-i386 \
+RUN: llvm-cxxdump %p/Inputs/eh.obj.coff-i386 \
RUN: | FileCheck %s --check-prefix=COFF-I386
-RUN: llvm-vtabledump %p/Inputs/trivial.obj.coff-i386 \
+RUN: llvm-cxxdump %p/Inputs/trivial.obj.coff-i386 \
RUN: | FileCheck %s --check-prefix=COFF-I386
-RUN: llvm-vtabledump %p/Inputs/trivial.obj.elf-i386 \
+RUN: llvm-cxxdump %p/Inputs/trivial.obj.elf-i386 \
RUN: | FileCheck %s --check-prefix=ELF-I386
COFF-I386: ??_7S@@6B@[0]: ??_R4S@@6B@
add_llvm_tool_subdirectory(llvm-rtdyld)
add_llvm_tool_subdirectory(llvm-dwarfdump)
add_llvm_tool_subdirectory(dsymutil)
-add_llvm_tool_subdirectory(llvm-vtabledump)
+add_llvm_tool_subdirectory(llvm-cxxdump)
if( LLVM_USE_INTEL_JITEVENTS )
add_llvm_tool_subdirectory(llvm-jitlistener)
else()
macho-dump llvm-objdump llvm-readobj llvm-rtdyld \
llvm-dwarfdump llvm-cov llvm-size llvm-stress llvm-mcmarkup \
llvm-profdata llvm-symbolizer obj2yaml yaml2obj llvm-c-test \
- llvm-vtabledump verify-uselistorder dsymutil llvm-pdbdump
+ llvm-cxxdump verify-uselistorder dsymutil llvm-pdbdump
# If Intel JIT Events support is configured, build an extra tool to test it.
ifeq ($(USE_INTEL_JITEVENTS), 1)
Support
)
-add_llvm_tool(llvm-vtabledump
- llvm-vtabledump.cpp
+add_llvm_tool(llvm-cxxdump
+ llvm-cxxdump.cpp
Error.cpp
)
-//===- Error.cpp - system_error extensions for llvm-vtabledump --*- C++ -*-===//
+//===- Error.cxx - system_error extensions for llvm-cxxdump -----*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
//
//===----------------------------------------------------------------------===//
//
-// This defines a new error_category for the llvm-vtabledump tool.
+// This defines a new error_category for the llvm-cxxdump tool.
//
//===----------------------------------------------------------------------===//
using namespace llvm;
namespace {
-class vtabledump_error_category : public std::error_category {
+class cxxdump_error_category : public std::error_category {
public:
- const char *name() const LLVM_NOEXCEPT override { return "llvm.vtabledump"; }
+ const char *name() const LLVM_NOEXCEPT override { return "llvm.cxxdump"; }
std::string message(int ev) const override {
- switch (static_cast<vtabledump_error>(ev)) {
- case vtabledump_error::success:
+ switch (static_cast<cxxdump_error>(ev)) {
+ case cxxdump_error::success:
return "Success";
- case vtabledump_error::file_not_found:
+ case cxxdump_error::file_not_found:
return "No such file.";
- case vtabledump_error::unrecognized_file_format:
+ case cxxdump_error::unrecognized_file_format:
return "Unrecognized file type.";
}
llvm_unreachable(
- "An enumerator of vtabledump_error does not have a message defined.");
+ "An enumerator of cxxdump_error does not have a message defined.");
}
};
} // namespace
namespace llvm {
-const std::error_category &vtabledump_category() {
- static vtabledump_error_category o;
+const std::error_category &cxxdump_category() {
+ static cxxdump_error_category o;
return o;
}
} // namespace llvm
-//===- Error.h - system_error extensions for llvm-vtabledump ----*- C++ -*-===//
+//===- Error.h - system_error extensions for llvm-cxxdump -------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
//
//===----------------------------------------------------------------------===//
//
-// This declares a new error_category for the llvm-vtabledump tool.
+// This declares a new error_category for the llvm-cxxdump tool.
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_TOOLS_LLVM_VTABLEDUMP_ERROR_H
-#define LLVM_TOOLS_LLVM_VTABLEDUMP_ERROR_H
+#ifndef LLVM_TOOLS_LLVM_CXXDUMP_ERROR_H
+#define LLVM_TOOLS_LLVM_CXXDUMP_ERROR_H
#include <system_error>
namespace llvm {
-const std::error_category &vtabledump_category();
+const std::error_category &cxxdump_category();
-enum class vtabledump_error {
+enum class cxxdump_error {
success = 0,
file_not_found,
unrecognized_file_format,
};
-inline std::error_code make_error_code(vtabledump_error e) {
- return std::error_code(static_cast<int>(e), vtabledump_category());
+inline std::error_code make_error_code(cxxdump_error e) {
+ return std::error_code(static_cast<int>(e), cxxdump_category());
}
} // namespace llvm
namespace std {
template <>
-struct is_error_code_enum<llvm::vtabledump_error> : std::true_type {};
+struct is_error_code_enum<llvm::cxxdump_error> : std::true_type {};
}
#endif
-;===- ./tools/llvm-vtabledump/LLVMBuild.txt --------------------*- Conf -*--===;
+;===- ./tools/llvm-cxxdump/LLVMBuild.txt -----------------------*- Conf -*--===;
;
; The LLVM Compiler Infrastructure
;
[component_0]
type = Tool
-name = llvm-vtabledump
+name = llvm-cxxdump
parent = Tools
required_libraries = all-targets BitReader Object
-##===- tools/llvm-vtabledump/Makefile ----------------------*- Makefile -*-===##
+##===- tools/llvm-cxxdump/Makefile -------------------------*- Makefile -*-===##
#
# The LLVM Compiler Infrastructure
#
##===----------------------------------------------------------------------===##
LEVEL := ../..
-TOOLNAME := llvm-vtabledump
+TOOLNAME := llvm-cxxdump
LINK_COMPONENTS := bitreader object all-targets
# This tool has no plugins, optimize startup time.
-//===- llvm-vtabledump.cpp - Dump vtables in an Object File -----*- C++ -*-===//
+//===- llvm-cxxdump.cpp - Dump C++ data in an Object File -------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
//
//===----------------------------------------------------------------------===//
//
-// Dumps VTables resident in object files and archives.
+// Dumps C++ data resident in object files and archives.
//
//===----------------------------------------------------------------------===//
-#include "llvm-vtabledump.h"
+#include "llvm-cxxdump.h"
#include "Error.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/Object/Archive.h"
return false;
}
-static void dumpVTables(const ObjectFile *Obj) {
+static void dumpCXXData(const ObjectFile *Obj) {
struct CompleteObjectLocator {
StringRef Symbols[2];
ArrayRef<little32_t> Data;
auto Key = std::make_pair(SymName, SymOffI);
if (VTableSymEntries.count(Key))
continue;
- const char *DataPtr = SymContents.substr(SymOffI, BytesInAddress).data();
+ const char *DataPtr =
+ SymContents.substr(SymOffI, BytesInAddress).data();
int64_t VData;
if (BytesInAddress == 8)
VData = *reinterpret_cast<const little64_t *>(DataPtr);
// FIXME: Do something with these!
}
}
- for (const std::pair<std::pair<StringRef, uint64_t>, StringRef> &VFTableEntry :
- VFTableEntries) {
+ for (const auto &VFTableEntry : VFTableEntries) {
StringRef VFTableName = VFTableEntry.first.first;
uint64_t Offset = VFTableEntry.first.second;
StringRef SymName = VFTableEntry.second;
outs() << COLName << "[OffsetToTop]: " << COL.Data[1] << '\n';
outs() << COLName << "[VFPtrOffset]: " << COL.Data[2] << '\n';
outs() << COLName << "[TypeDescriptor]: " << COL.Symbols[0] << '\n';
- outs() << COLName << "[ClassHierarchyDescriptor]: " << COL.Symbols[1] << '\n';
+ outs() << COLName << "[ClassHierarchyDescriptor]: " << COL.Symbols[1]
+ << '\n';
}
for (const std::pair<StringRef, ClassHierarchyDescriptor> &CHDPair : CHDs) {
StringRef CHDName = CHDPair.first;
outs() << BCDName << "[VBPtrOffset]: " << BCD.Data[2] << '\n';
outs() << BCDName << "[OffsetInVBTable]: " << BCD.Data[3] << '\n';
outs() << BCDName << "[Flags]: " << BCD.Data[4] << '\n';
- outs() << BCDName << "[ClassHierarchyDescriptor]: " << BCD.Symbols[1] << '\n';
+ outs() << BCDName << "[ClassHierarchyDescriptor]: " << BCD.Symbols[1]
+ << '\n';
}
for (const std::pair<StringRef, TypeDescriptor> &TDPair : TDs) {
StringRef TDName = TDPair.first;
}
if (ObjectFile *Obj = dyn_cast<ObjectFile>(&*ChildOrErr.get()))
- dumpVTables(Obj);
+ dumpCXXData(Obj);
else
- reportError(Arc->getFileName(),
- vtabledump_error::unrecognized_file_format);
+ reportError(Arc->getFileName(), cxxdump_error::unrecognized_file_format);
}
}
static void dumpInput(StringRef File) {
// If file isn't stdin, check that it exists.
if (File != "-" && !sys::fs::exists(File)) {
- reportError(File, vtabledump_error::file_not_found);
+ reportError(File, cxxdump_error::file_not_found);
return;
}
if (Archive *Arc = dyn_cast<Archive>(&Binary))
dumpArchive(Arc);
else if (ObjectFile *Obj = dyn_cast<ObjectFile>(&Binary))
- dumpVTables(Obj);
+ dumpCXXData(Obj);
else
- reportError(File, vtabledump_error::unrecognized_file_format);
+ reportError(File, cxxdump_error::unrecognized_file_format);
}
int main(int argc, const char *argv[]) {
// Register the target printer for --version.
cl::AddExtraVersionPrinter(TargetRegistry::printRegisteredTargetsForVersion);
- cl::ParseCommandLineOptions(argc, argv, "LLVM VTable Dumper\n");
+ cl::ParseCommandLineOptions(argc, argv, "LLVM C++ ABI Data Dumper\n");
// Default to stdin if no filename is specified.
if (opts::InputFilenames.size() == 0)
-//===-- llvm-vtabledump.h ---------------------------------------*- C++ -*-===//
+//===-- llvm-cxxdump.h ------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_TOOLS_LLVM_VTABLEDUMP_LLVM_VTABLEDUMP_H
-#define LLVM_TOOLS_LLVM_VTABLEDUMP_LLVM_VTABLEDUMP_H
+#ifndef LLVM_TOOLS_LLVM_CXXDUMP_LLVM_CXXDUMP_H
+#define LLVM_TOOLS_LLVM_CXXDUMP_LLVM_CXXDUMP_H
#include "llvm/Support/CommandLine.h"
#include <string>
extern llvm::cl::list<std::string> InputFilenames;
} // namespace opts
-#define LLVM_VTABLEDUMP_ENUM_ENT(ns, enum) \
+#define LLVM_CXXDUMP_ENUM_ENT(ns, enum) \
{ #enum, ns::enum }
#endif