xref: /src/contrib/llvm-project/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.h (revision 81ad626541db97eb356e2c1d4a20eb2a26a766ab)
1b60736ecSDimitry Andric //===- LiveDebugValues.cpp - Tracking Debug Value MIs ---------*- C++ -*---===//
2b60736ecSDimitry Andric //
3b60736ecSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4b60736ecSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5b60736ecSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6b60736ecSDimitry Andric //
7b60736ecSDimitry Andric //===----------------------------------------------------------------------===//
8b60736ecSDimitry Andric 
9344a3780SDimitry Andric #ifndef LLVM_LIB_CODEGEN_LIVEDEBUGVALUES_LIVEDEBUGVALUES_H
10344a3780SDimitry Andric #define LLVM_LIB_CODEGEN_LIVEDEBUGVALUES_LIVEDEBUGVALUES_H
11344a3780SDimitry Andric 
12b60736ecSDimitry Andric namespace llvm {
13145449b1SDimitry Andric class MachineDominatorTree;
14145449b1SDimitry Andric class MachineFunction;
15145449b1SDimitry Andric class TargetPassConfig;
16145449b1SDimitry Andric class Triple;
17b60736ecSDimitry Andric 
18b60736ecSDimitry Andric // Inline namespace for types / symbols shared between different
19b60736ecSDimitry Andric // LiveDebugValues implementations.
20b60736ecSDimitry Andric inline namespace SharedLiveDebugValues {
21b60736ecSDimitry Andric 
22b60736ecSDimitry Andric // Expose a base class for LiveDebugValues interfaces to inherit from. This
23b60736ecSDimitry Andric // allows the generic LiveDebugValues pass handles to call into the
24b60736ecSDimitry Andric // implementation.
25b60736ecSDimitry Andric class LDVImpl {
26b60736ecSDimitry Andric public:
27c0981da4SDimitry Andric   virtual bool ExtendRanges(MachineFunction &MF, MachineDominatorTree *DomTree,
28c0981da4SDimitry Andric                             TargetPassConfig *TPC, unsigned InputBBLimit,
29c0981da4SDimitry Andric                             unsigned InputDbgValLimit) = 0;
30145449b1SDimitry Andric   virtual ~LDVImpl() = default;
31b60736ecSDimitry Andric };
32b60736ecSDimitry Andric 
33b60736ecSDimitry Andric } // namespace SharedLiveDebugValues
34b60736ecSDimitry Andric 
35b60736ecSDimitry Andric // Factory functions for LiveDebugValues implementations.
36b60736ecSDimitry Andric extern LDVImpl *makeVarLocBasedLiveDebugValues();
37b60736ecSDimitry Andric extern LDVImpl *makeInstrRefBasedLiveDebugValues();
386f8fc217SDimitry Andric 
396f8fc217SDimitry Andric extern bool debuginfoShouldUseDebugInstrRef(const Triple &T);
406f8fc217SDimitry Andric 
41b60736ecSDimitry Andric } // namespace llvm
42344a3780SDimitry Andric 
43344a3780SDimitry Andric #endif // LLVM_LIB_CODEGEN_LIVEDEBUGVALUES_LIVEDEBUGVALUES_H
44