2017-08-25 05:21:39 +08:00
|
|
|
//===- LiveDebugVariables.h - Tracking debug info variables -----*- C++ -*-===//
|
2010-11-30 10:17:10 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08: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 10:17:10 +08: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-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_LIB_CODEGEN_LIVEDEBUGVARIABLES_H
|
|
|
|
#define LLVM_LIB_CODEGEN_LIVEDEBUGVARIABLES_H
|
2010-11-30 10:17:10 +08:00
|
|
|
|
|
|
|
#include "llvm/CodeGen/MachineFunctionPass.h"
|
2017-08-25 05:21:39 +08:00
|
|
|
#include "llvm/Support/Compiler.h"
|
2010-11-30 10:17:10 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2016-04-18 17:17:29 +08:00
|
|
|
template <typename T> class ArrayRef;
|
2013-08-15 07:50:04 +08:00
|
|
|
class LiveIntervals;
|
2010-12-04 05:47:10 +08:00
|
|
|
class VirtRegMap;
|
|
|
|
|
2015-07-01 22:47:39 +08:00
|
|
|
class LLVM_LIBRARY_VISIBILITY LiveDebugVariables : public MachineFunctionPass {
|
2017-08-25 05:21:39 +08:00
|
|
|
void *pImpl = nullptr;
|
2015-04-18 07:20:10 +08:00
|
|
|
|
2010-11-30 10:17:10 +08:00
|
|
|
public:
|
|
|
|
static char ID; // Pass identification, replacement for typeid
|
|
|
|
|
|
|
|
LiveDebugVariables();
|
2015-04-11 10:11:45 +08:00
|
|
|
~LiveDebugVariables() override;
|
2010-11-30 10:17:10 +08:00
|
|
|
|
2011-05-07 02:00:02 +08: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 23:57:24 +08:00
|
|
|
void splitRegister(Register OldReg, ArrayRef<Register> NewRegs,
|
2013-08-15 07:50:04 +08:00
|
|
|
LiveIntervals &LIS);
|
2011-05-07 02:00:02 +08:00
|
|
|
|
2010-11-30 10:17:10 +08:00
|
|
|
/// emitDebugValues - Emit new DBG_VALUE instructions reflecting the changes
|
|
|
|
/// that happened during register allocation.
|
2010-12-04 05:47:10 +08:00
|
|
|
/// @param VRM Rename virtual registers according to map.
|
|
|
|
void emitDebugValues(VirtRegMap *VRM);
|
2010-11-30 10:17:10 +08:00
|
|
|
|
2010-12-03 02:15:44 +08:00
|
|
|
/// dump - Print data structures to dbgs().
|
2017-06-22 06:19:17 +08:00
|
|
|
void dump() const;
|
2010-12-03 02:15:44 +08:00
|
|
|
|
2010-11-30 10:17:10 +08:00
|
|
|
private:
|
2014-03-07 17:26:03 +08:00
|
|
|
bool runOnMachineFunction(MachineFunction &) override;
|
|
|
|
void releaseMemory() override;
|
|
|
|
void getAnalysisUsage(AnalysisUsage &) const override;
|
2010-11-30 10:17:10 +08:00
|
|
|
};
|
|
|
|
|
2017-08-25 05:21:39 +08:00
|
|
|
} // end namespace llvm
|
2010-11-30 10:17:10 +08:00
|
|
|
|
2017-08-25 05:21:39 +08:00
|
|
|
#endif // LLVM_LIB_CODEGEN_LIVEDEBUGVARIABLES_H
|