mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
Use const_cast instead of a C-style cast to cast away const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101639 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9f23dee08c
commit
82d5eaf23e
@ -2068,8 +2068,9 @@ void DwarfDebug::collectVariableInfo() {
|
|||||||
// FIXME : Lift this restriction.
|
// FIXME : Lift this restriction.
|
||||||
if (MInsn->getNumOperands() != 3)
|
if (MInsn->getNumOperands() != 3)
|
||||||
continue;
|
continue;
|
||||||
DIVariable DV((MDNode*)(MInsn->getOperand(MInsn->getNumOperands()
|
DIVariable DV(
|
||||||
- 1).getMetadata()));
|
const_cast<MDNode *>(MInsn->getOperand(MInsn->getNumOperands() - 1)
|
||||||
|
.getMetadata()));
|
||||||
if (DV.getTag() == dwarf::DW_TAG_arg_variable) {
|
if (DV.getTag() == dwarf::DW_TAG_arg_variable) {
|
||||||
// FIXME Handle inlined subroutine arguments.
|
// FIXME Handle inlined subroutine arguments.
|
||||||
DbgVariable *ArgVar = new DbgVariable(DV, MInsn, NULL);
|
DbgVariable *ArgVar = new DbgVariable(DV, MInsn, NULL);
|
||||||
|
@ -344,7 +344,7 @@ void X86AsmPrinter::PrintDebugValueComment(const MachineInstr *MI,
|
|||||||
assert(NOps==7);
|
assert(NOps==7);
|
||||||
O << '\t' << MAI->getCommentString() << "DEBUG_VALUE: ";
|
O << '\t' << MAI->getCommentString() << "DEBUG_VALUE: ";
|
||||||
// cast away const; DIetc do not take const operands for some reason.
|
// cast away const; DIetc do not take const operands for some reason.
|
||||||
DIVariable V((MDNode*)(MI->getOperand(NOps-1).getMetadata()));
|
DIVariable V(const_cast<MDNode *>(MI->getOperand(NOps-1).getMetadata()));
|
||||||
O << V.getName();
|
O << V.getName();
|
||||||
O << " <- ";
|
O << " <- ";
|
||||||
// Frame address. Currently handles register +- offset only.
|
// Frame address. Currently handles register +- offset only.
|
||||||
|
Loading…
Reference in New Issue
Block a user