[llvm] [SystemZ][z/OS] Add goffdumper/llvm-readobj tools (PR #71071)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 3 01:25:39 PDT 2023
================
@@ -0,0 +1,94 @@
+#include "ObjDumper.h"
+#include "llvm-readobj.h"
+#include "llvm/Object/GOFFObjectFile.h"
+#include "llvm/Support/ScopedPrinter.h"
+
+using namespace llvm;
+using namespace llvm::object;
+
+namespace {
+
+class GOFFDumper : public ObjDumper {
+public:
+ GOFFDumper(const GOFFObjectFile *Obj, ScopedPrinter &Writer)
+ : ObjDumper(Writer, Obj->getFileName()), Obj(Obj) {}
+
+ void printFileHeaders() override {}
+ void printSectionHeaders() override;
+ void printRelocations() override;
+ void printSymbols(bool ExtraSymInfo) override;
+ void printDynamicSymbols() override;
+ void printUnwindInfo() override {}
+ void printStackMap() const override {}
+
+ const object::GOFFObjectFile *getGOFFObject() const { return Obj; };
+
+private:
+ void printSymbol(const SymbolRef &Sym);
+
+ const GOFFObjectFile *Obj;
+};
+
+} // End anonymous namespace
+
+namespace llvm {
+std::unique_ptr<ObjDumper> createGOFFDumper(const object::GOFFObjectFile &Obj,
+ ScopedPrinter &Writer) {
+ return std::make_unique<GOFFDumper>(&Obj, Writer);
+}
+
----------------
jh7370 wrote:
Nit: be consistent with your start/end of your namespacing with regards to blank lines.
https://github.com/llvm/llvm-project/pull/71071
More information about the llvm-commits
mailing list