mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 16:24:23 +00:00
IR: Take advantage of -verify checks for MDExpression
Now that we check `MDExpression` during `-verify` (r232299), make the `DIExpression` wrapper more strict: - remove redundant checks in `DebugInfoVerifier`, - overload `get()` to `cast_or_null<MDExpression>` (superseding `getRaw()`), - stop checking for null in any accessor, and - remove `DIExpression::Verify()` entirely in favour of `MDExpression::isValid()`. There is still some logic in this class, mostly to do with high-level iterators; I'll defer cleaning up those until the rest of the wrappers are similarly strict. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232412 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -356,7 +356,7 @@ inline MachineInstrBuilder BuildMI(MachineFunction &MF, DebugLoc DL,
|
||||
unsigned Reg, unsigned Offset,
|
||||
const MDNode *Variable, const MDNode *Expr) {
|
||||
assert(DIVariable(Variable).Verify() && "not a DIVariable");
|
||||
assert(DIExpression(Expr).Verify() && "not a DIExpression");
|
||||
assert(DIExpression(Expr)->isValid() && "not a DIExpression");
|
||||
if (IsIndirect)
|
||||
return BuildMI(MF, DL, MCID)
|
||||
.addReg(Reg, RegState::Debug)
|
||||
@ -383,7 +383,7 @@ inline MachineInstrBuilder BuildMI(MachineBasicBlock &BB,
|
||||
unsigned Reg, unsigned Offset,
|
||||
const MDNode *Variable, const MDNode *Expr) {
|
||||
assert(DIVariable(Variable).Verify() && "not a DIVariable");
|
||||
assert(DIExpression(Expr).Verify() && "not a DIExpression");
|
||||
assert(DIExpression(Expr)->isValid() && "not a DIExpression");
|
||||
MachineFunction &MF = *BB.getParent();
|
||||
MachineInstr *MI =
|
||||
BuildMI(MF, DL, MCID, IsIndirect, Reg, Offset, Variable, Expr);
|
||||
|
Reference in New Issue
Block a user