Skip to content

Commit c5ce1c6

Browse files
aparshin-inteligcbot
authored andcommitted
get rid of deprecated DbgVariableIntrinsic wrapper, fix issue with LLVM-13 build.
get rid of deprecated DbgVariableIntrinsic wrapper, fix issue with LLVM-13 build.
1 parent f1fed8f commit c5ce1c6

File tree

4 files changed

+17
-24
lines changed

4 files changed

+17
-24
lines changed

IGC/DebugInfo/DwarfCompileUnit.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ int64_t CompileUnit::getDefaultLowerBound() const
203203
}
204204

205205
static bool HasImplicitLocation(const DbgVariable& var) {
206-
if (auto* dbgInst = dyn_cast_or_null<IGCLLVM::DbgVariableIntrinsic>(var.getDbgInst()))
206+
if (auto* dbgInst = var.getDbgInst())
207207
if (auto* expr = dbgInst->getExpression())
208208
return expr->isImplicit();
209209
return false;
@@ -2625,9 +2625,9 @@ IGC::DIEBlock* CompileUnit::buildGeneral(const DbgVariable& var,
26252625

26262626
auto EmitExpression = [this](IGC::DIEBlock* Block, const DbgVariable& var) {
26272627
// Emit DIExpression if it exists
2628-
if (auto dbgInst = dyn_cast_or_null<IGCLLVM::DbgVariableIntrinsic>(var.getDbgInst()))
2628+
if (auto* dbgInst = var.getDbgInst())
26292629
{
2630-
if (auto expr = dbgInst->getExpression())
2630+
if (auto* expr = dbgInst->getExpression())
26312631
{
26322632
for (auto elem : expr->getElements())
26332633
{

IGC/DebugInfo/DwarfDebug.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,7 +1592,7 @@ void DwarfDebug::collectVariableInfo(const Function* MF, SmallPtrSet<const MDNod
15921592
// If a function is inlined x times, there would be x number of DbgVariable instances.
15931593
using DbgVarIPInfo =
15941594
std::tuple<unsigned int, unsigned int, DbgVariable*,
1595-
const IGCLLVM::DbgVariableIntrinsic*>;
1595+
const llvm::DbgVariableIntrinsic*>;
15961596
// TODO: consider replacing std::list to std::vector
15971597
std::unordered_map<DbgVariable*, std::list<DbgVarIPInfo>> DbgValuesWithGenIP;
15981598
for (auto HI = History.begin(), HE = History.end(); HI != HE; HI++)
@@ -1621,7 +1621,7 @@ void DwarfDebug::collectVariableInfo(const Function* MF, SmallPtrSet<const MDNod
16211621
continue;
16221622

16231623
Processed.insert(DV);
1624-
const IGCLLVM::DbgVariableIntrinsic* pInst = H; // History.front();
1624+
const llvm::DbgVariableIntrinsic* pInst = H; // History.front();
16251625

16261626
IGC_ASSERT_MESSAGE(IsDebugInst(pInst),
16271627
"History must begin with debug instruction");
@@ -1742,7 +1742,7 @@ void DwarfDebug::collectVariableInfo(const Function* MF, SmallPtrSet<const MDNod
17421742
uint64_t start = 0;
17431743
uint64_t end = 0;
17441744
DbgVariable* dbgVar = nullptr;
1745-
const IGCLLVM::DbgVariableIntrinsic* pInst = nullptr;
1745+
const llvm::DbgVariableIntrinsic* pInst = nullptr;
17461746
const ConstantInt* imm = nullptr;
17471747

17481748
std::vector<VISAVariableLocation> Locs;
@@ -2262,7 +2262,7 @@ void DwarfDebug::beginFunction(const Function* MF, IGC::VISAModule* v)
22622262
History.pop_back();
22632263
}
22642264
}
2265-
History.push_back(cast<IGCLLVM::DbgVariableIntrinsic>(MI));
2265+
History.push_back(cast<llvm::DbgVariableIntrinsic>(MI));
22662266
}
22672267
else if(m_pModule->IsExecutableInst(*MI))
22682268
{

IGC/DebugInfo/DwarfDebug.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ namespace IGC
7272
uint32_t offset = 0;
7373

7474
// The location in the machine frame.
75-
const IGCLLVM::DbgVariableIntrinsic* m_pDbgInst = nullptr;
75+
const llvm::DbgVariableIntrinsic* m_pDbgInst = nullptr;
7676

7777
// The variable to which this location entry corresponds.
7878
const llvm::MDNode* Variable = nullptr;
@@ -84,19 +84,19 @@ namespace IGC
8484

8585
DotDebugLocEntry() : m_pDbgInst(nullptr), Variable(nullptr) { }
8686
DotDebugLocEntry(const llvm::MCSymbol* B, const llvm::MCSymbol* E,
87-
const IGCLLVM::DbgVariableIntrinsic* pDbgInst,
87+
const llvm::DbgVariableIntrinsic* pDbgInst,
8888
const llvm::MDNode* V)
8989
: m_pDbgInst(pDbgInst), Variable(V) { }
9090
DotDebugLocEntry(const uint64_t s, const uint64_t e,
91-
const IGCLLVM::DbgVariableIntrinsic* pDbgInst,
91+
const llvm::DbgVariableIntrinsic* pDbgInst,
9292
const llvm::MDNode* V)
9393
: start(s), end(e), m_pDbgInst(pDbgInst), Variable(V) {}
9494

9595
/// \brief Empty entries are also used as a trigger to emit temp label. Such
9696
/// labels are referenced is used to find debug_loc offset for a given DIE.
9797
bool isEmpty() const { return start == 0 && end == 0; }
9898
const llvm::MDNode* getVariable() const { return Variable; }
99-
const IGCLLVM::DbgVariableIntrinsic* getDbgInst() const { return m_pDbgInst; }
99+
const llvm::DbgVariableIntrinsic* getDbgInst() const { return m_pDbgInst; }
100100
uint64_t getStart() const { return start; }
101101
uint64_t getEnd() const { return end; }
102102

@@ -128,7 +128,7 @@ namespace IGC
128128
// Corresponding Abstract variable, if any
129129
DbgVariable* AbsVar = nullptr;
130130
// DBG_VALUE instruction of the variable
131-
const IGCLLVM::DbgVariableIntrinsic* m_pDbgInst = nullptr;
131+
const llvm::DbgVariableIntrinsic* m_pDbgInst = nullptr;
132132

133133
public:
134134

@@ -150,8 +150,8 @@ namespace IGC
150150
llvm::StringRef getName() const { return Var->getName(); }
151151
DbgVariable* getAbstractVariable() const { return AbsVar; }
152152

153-
const IGCLLVM::DbgVariableIntrinsic* getDbgInst() const { return m_pDbgInst; }
154-
void setDbgInst(const IGCLLVM::DbgVariableIntrinsic* pInst) { m_pDbgInst = pInst; }
153+
const llvm::DbgVariableIntrinsic* getDbgInst() const { return m_pDbgInst; }
154+
void setDbgInst(const llvm::DbgVariableIntrinsic* pInst) { m_pDbgInst = pInst; }
155155

156156
/// If this type is derived from a base type then return base type size
157157
/// even if it derived directly or indirectly from Composite Type
@@ -344,7 +344,7 @@ namespace IGC
344344
// For each user variable, keep a list of DBG_VALUE instructions in order.
345345
// The list can also contain normal instructions that clobber the previous
346346
// DBG_VALUE.
347-
using InstructionsList = llvm::SmallVector<const IGCLLVM::DbgVariableIntrinsic*, 4>;
347+
using InstructionsList = llvm::SmallVector<const llvm::DbgVariableIntrinsic*, 4>;
348348
typedef llvm::DenseMap<const llvm::MDNode*, InstructionsList> DbgValueHistoryMap;
349349
DbgValueHistoryMap DbgValues;
350350

IGC/WrapperLLVM/include/llvmWrapper/IR/IntrinsicInst.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,13 @@ SPDX-License-Identifier: MIT
1616

1717
namespace IGCLLVM
1818
{
19-
// TODO: remove support for LLVM 7
20-
#if LLVM_VERSION_MAJOR <= 7
21-
using DbgVariableIntrinsic = llvm::DbgInfoIntrinsic;
22-
#else
23-
using llvm::DbgVariableIntrinsic;
24-
#endif
25-
26-
inline llvm::Value* getVariableLocation(const DbgVariableIntrinsic* DbgInst)
19+
inline llvm::Value* getVariableLocation(const llvm::DbgVariableIntrinsic* DbgInst)
2720
{
2821
IGC_ASSERT(DbgInst);
2922
#if LLVM_VERSION_MAJOR <= 12
3023
return DbgInst->getVariableLocation();
3124
#else
32-
IGC_ASSERT_MESSAGE(getNumVariableLocationOps() == 1,
25+
IGC_ASSERT_MESSAGE(DbgInst->getNumVariableLocationOps() == 1,
3326
"unsupported number of location ops");
3427
return DbgInst->getVariableLocationOp(0);
3528
#endif

0 commit comments

Comments
 (0)