| 24 | using ResultOpcodeCounter = llvm::StringMap<unsigned>; |
| 25 | |
| 26 | struct OpcodeCounter : public llvm::AnalysisInfoMixin<OpcodeCounter> { |
| 27 | using Result = ResultOpcodeCounter; |
| 28 | Result run(llvm::Function &F, |
| 29 | llvm::FunctionAnalysisManager &); |
| 30 | |
| 31 | OpcodeCounter::Result generateOpcodeMap(llvm::Function &F); |
| 32 | // Part of the official API: |
| 33 | // https://llvm.org/docs/WritingAnLLVMNewPMPass.html#required-passes |
| 34 | static bool isRequired() { return true; } |
| 35 | |
| 36 | private: |
| 37 | // A special type used by analysis passes to provide an address that |
| 38 | // identifies that particular analysis pass type. |
| 39 | static llvm::AnalysisKey Key; |
| 40 | friend struct llvm::AnalysisInfoMixin<OpcodeCounter>; |
| 41 | }; |
| 42 | |
| 43 | //------------------------------------------------------------------------------ |
| 44 | // New PM interface for the printer pass |
no outgoing calls
no test coverage detected