diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:01:25 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:01:25 +0000 |
| commit | d8e91e46262bc44006913e6796843909f1ac7bcd (patch) | |
| tree | 7d0c143d9b38190e0fa0180805389da22cd834c5 /lib/Target/BPF/BPFAsmPrinter.cpp | |
| parent | b7eb8e35e481a74962664b63dfb09483b200209a (diff) | |
Notes
Diffstat (limited to 'lib/Target/BPF/BPFAsmPrinter.cpp')
| -rw-r--r-- | lib/Target/BPF/BPFAsmPrinter.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Target/BPF/BPFAsmPrinter.cpp b/lib/Target/BPF/BPFAsmPrinter.cpp index 705211b486bf..ada5eb923f40 100644 --- a/lib/Target/BPF/BPFAsmPrinter.cpp +++ b/lib/Target/BPF/BPFAsmPrinter.cpp @@ -16,6 +16,7 @@ #include "BPFInstrInfo.h" #include "BPFMCInstLower.h" #include "BPFTargetMachine.h" +#include "BTFDebug.h" #include "InstPrinter/BPFInstPrinter.h" #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/MachineConstantPool.h" @@ -40,6 +41,7 @@ public: : AsmPrinter(TM, std::move(Streamer)) {} StringRef getPassName() const override { return "BPF Assembly Printer"; } + bool doInitialization(Module &M) override; void printOperand(const MachineInstr *MI, int OpNum, raw_ostream &O); bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode, @@ -52,6 +54,18 @@ public: }; } // namespace +bool BPFAsmPrinter::doInitialization(Module &M) { + AsmPrinter::doInitialization(M); + + if (MAI->doesSupportDebugInformation()) { + Handlers.push_back(HandlerInfo(new BTFDebug(this), "emit", + "Debug Info Emission", "BTF", + "BTF Emission")); + } + + return false; +} + void BPFAsmPrinter::printOperand(const MachineInstr *MI, int OpNum, raw_ostream &O) { const MachineOperand &MO = MI->getOperand(OpNum); |
