forked from OSchip/llvm-project
Fix comments which mixed up 'before' and 'after', NFC
llvm-svn: 337061
This commit is contained in:
parent
47f2844c76
commit
d37e078d39
|
@ -316,7 +316,7 @@ bool replaceDbgDeclare(Value *Address, Value *NewAddress,
|
||||||
/// DW_OP_deref is prepended to the expression. If Offset is non-zero,
|
/// DW_OP_deref is prepended to the expression. If Offset is non-zero,
|
||||||
/// a constant displacement is added to the expression (between the
|
/// a constant displacement is added to the expression (between the
|
||||||
/// optional Deref operations). Offset can be negative. The new
|
/// optional Deref operations). Offset can be negative. The new
|
||||||
/// llvm.dbg.declare is inserted immediately before AI.
|
/// llvm.dbg.declare is inserted immediately after AI.
|
||||||
bool replaceDbgDeclareForAlloca(AllocaInst *AI, Value *NewAllocaAddress,
|
bool replaceDbgDeclareForAlloca(AllocaInst *AI, Value *NewAllocaAddress,
|
||||||
DIBuilder &Builder, bool DerefBefore,
|
DIBuilder &Builder, bool DerefBefore,
|
||||||
int Offset, bool DerefAfter);
|
int Offset, bool DerefAfter);
|
||||||
|
|
|
@ -1534,11 +1534,11 @@ bool llvm::replaceDbgDeclare(Value *Address, Value *NewAddress,
|
||||||
auto *DIExpr = DII->getExpression();
|
auto *DIExpr = DII->getExpression();
|
||||||
assert(DIVar && "Missing variable");
|
assert(DIVar && "Missing variable");
|
||||||
DIExpr = DIExpression::prepend(DIExpr, DerefBefore, Offset, DerefAfter);
|
DIExpr = DIExpression::prepend(DIExpr, DerefBefore, Offset, DerefAfter);
|
||||||
// Insert llvm.dbg.declare immediately after InsertBefore, and remove old
|
// Insert llvm.dbg.declare immediately before InsertBefore, and remove old
|
||||||
// llvm.dbg.declare.
|
// llvm.dbg.declare.
|
||||||
Builder.insertDeclare(NewAddress, DIVar, DIExpr, Loc, InsertBefore);
|
Builder.insertDeclare(NewAddress, DIVar, DIExpr, Loc, InsertBefore);
|
||||||
if (DII == InsertBefore)
|
if (DII == InsertBefore)
|
||||||
InsertBefore = &*std::next(InsertBefore->getIterator());
|
InsertBefore = InsertBefore->getNextNode();
|
||||||
DII->eraseFromParent();
|
DII->eraseFromParent();
|
||||||
}
|
}
|
||||||
return !DbgAddrs.empty();
|
return !DbgAddrs.empty();
|
||||||
|
|
Loading…
Reference in New Issue