1 //===- PseudoProbePrinter.h - Pseudo probe encoding support -----*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // This file contains support for writing pseudo probe info into asm files. 10 // 11 //===----------------------------------------------------------------------===// 12 13 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_PSEUDOPROBEPRINTER_H 14 #define LLVM_LIB_CODEGEN_ASMPRINTER_PSEUDOPROBEPRINTER_H 15 16 #include "llvm/ADT/DenseMap.h" 17 #include "llvm/CodeGen/AsmPrinterHandler.h" 18 19 namespace llvm { 20 21 class AsmPrinter; 22 class MCStreamer; 23 class Module; 24 class DILocation; 25 26 class PseudoProbeHandler : public AsmPrinterHandler { 27 // Target of pseudo probe emission. 28 AsmPrinter *Asm; 29 30 public: 31 PseudoProbeHandler(AsmPrinter *A) : Asm(A){}; 32 33 void emitPseudoProbe(uint64_t Guid, uint64_t Index, uint64_t Type, 34 uint64_t Attr, const DILocation *DebugLoc); 35 36 // Unused. 37 void setSymbolSize(const MCSymbol *Sym, uint64_t Size) override {} 38 void endModule() override {} 39 void beginFunction(const MachineFunction *MF) override {} 40 void endFunction(const MachineFunction *MF) override {} 41 void beginInstruction(const MachineInstr *MI) override {} 42 void endInstruction() override {} 43 }; 44 45 } // namespace llvm 46 #endif // LLVM_LIB_CODEGEN_ASMPRINTER_PSEUDOPROBEPRINTER_H 47