MachineModuleSlotTracker.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===-- llvm/CodeGen/MachineModuleInfo.h ------------------------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_CODEGEN_MACHINEMODULESLOTTRACKER_H
  14. #define LLVM_CODEGEN_MACHINEMODULESLOTTRACKER_H
  15. #include "llvm/IR/ModuleSlotTracker.h"
  16. namespace llvm {
  17. class AbstractSlotTrackerStorage;
  18. class Function;
  19. class MachineModuleInfo;
  20. class MachineFunction;
  21. class Module;
  22. class MachineModuleSlotTracker : public ModuleSlotTracker {
  23. const Function &TheFunction;
  24. const MachineModuleInfo &TheMMI;
  25. unsigned MDNStartSlot = 0, MDNEndSlot = 0;
  26. void processMachineFunctionMetadata(AbstractSlotTrackerStorage *AST,
  27. const MachineFunction &MF);
  28. void processMachineModule(AbstractSlotTrackerStorage *AST, const Module *M,
  29. bool ShouldInitializeAllMetadata);
  30. void processMachineFunction(AbstractSlotTrackerStorage *AST,
  31. const Function *F,
  32. bool ShouldInitializeAllMetadata);
  33. public:
  34. MachineModuleSlotTracker(const MachineFunction *MF,
  35. bool ShouldInitializeAllMetadata = true);
  36. ~MachineModuleSlotTracker();
  37. void collectMachineMDNodes(MachineMDNodeListType &L) const;
  38. };
  39. } // namespace llvm
  40. #endif // LLVM_CODEGEN_MACHINEMODULESLOTTRACKER_H
  41. #ifdef __GNUC__
  42. #pragma GCC diagnostic pop
  43. #endif