2017-08-24 23:21:39 +02:00
|
|
|
//===- LiveDebugVariables.h - Tracking debug info variables -----*- C++ -*-===//
|
2010-11-30 03:17:10 +01:00
|
|
|
//
|
2019-01-19 09:50:56 +01:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2010-11-30 03:17:10 +01:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file provides the interface to the LiveDebugVariables analysis.
|
|
|
|
//
|
|
|
|
// The analysis removes DBG_VALUE instructions for virtual registers and tracks
|
|
|
|
// live user variables in a data structure that can be updated during register
|
|
|
|
// allocation.
|
|
|
|
//
|
|
|
|
// After register allocation new DBG_VALUE instructions are emitted to reflect
|
|
|
|
// the new locations of user variables.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-13 18:26:38 +02:00
|
|
|
#ifndef LLVM_LIB_CODEGEN_LIVEDEBUGVARIABLES_H
|
|
|
|
#define LLVM_LIB_CODEGEN_LIVEDEBUGVARIABLES_H
|
2010-11-30 03:17:10 +01:00
|
|
|
|
|
|
|
#include "llvm/CodeGen/MachineFunctionPass.h"
|
2017-08-24 23:21:39 +02:00
|
|
|
#include "llvm/Support/Compiler.h"
|
2010-11-30 03:17:10 +01:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2016-04-18 11:17:29 +02:00
|
|
|
template <typename T> class ArrayRef;
|
2013-08-15 01:50:04 +02:00
|
|
|
class LiveIntervals;
|
2010-12-03 22:47:10 +01:00
|
|
|
class VirtRegMap;
|
|
|
|
|
2015-07-01 16:47:39 +02:00
|
|
|
class LLVM_LIBRARY_VISIBILITY LiveDebugVariables : public MachineFunctionPass {
|
2017-08-24 23:21:39 +02:00
|
|
|
void *pImpl = nullptr;
|
2015-04-18 01:20:10 +02:00
|
|
|
|
2010-11-30 03:17:10 +01:00
|
|
|
public:
|
|
|
|
static char ID; // Pass identification, replacement for typeid
|
|
|
|
|
|
|
|
LiveDebugVariables();
|
2015-04-11 04:11:45 +02:00
|
|
|
~LiveDebugVariables() override;
|
2010-11-30 03:17:10 +01:00
|
|
|
|
2011-05-06 20:00:02 +02:00
|
|
|
/// splitRegister - Move any user variables in OldReg to the live ranges in
|
|
|
|
/// NewRegs where they are live. Mark the values as unavailable where no new
|
|
|
|
/// register is live.
|
2020-06-30 17:57:24 +02:00
|
|
|
void splitRegister(Register OldReg, ArrayRef<Register> NewRegs,
|
2013-08-15 01:50:04 +02:00
|
|
|
LiveIntervals &LIS);
|
2011-05-06 20:00:02 +02:00
|
|
|
|
2010-11-30 03:17:10 +01:00
|
|
|
/// emitDebugValues - Emit new DBG_VALUE instructions reflecting the changes
|
|
|
|
/// that happened during register allocation.
|
2010-12-03 22:47:10 +01:00
|
|
|
/// @param VRM Rename virtual registers according to map.
|
|
|
|
void emitDebugValues(VirtRegMap *VRM);
|
2010-11-30 03:17:10 +01:00
|
|
|
|
2010-12-02 19:15:44 +01:00
|
|
|
/// dump - Print data structures to dbgs().
|
2017-06-22 00:19:17 +02:00
|
|
|
void dump() const;
|
2010-12-02 19:15:44 +01:00
|
|
|
|
2010-11-30 03:17:10 +01:00
|
|
|
private:
|
2014-03-07 10:26:03 +01:00
|
|
|
bool runOnMachineFunction(MachineFunction &) override;
|
|
|
|
void releaseMemory() override;
|
|
|
|
void getAnalysisUsage(AnalysisUsage &) const override;
|
2010-11-30 03:17:10 +01:00
|
|
|
};
|
|
|
|
|
2017-08-24 23:21:39 +02:00
|
|
|
} // end namespace llvm
|
2010-11-30 03:17:10 +01:00
|
|
|
|
2017-08-24 23:21:39 +02:00
|
|
|
#endif // LLVM_LIB_CODEGEN_LIVEDEBUGVARIABLES_H
|