mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Add a few simple MachineVerifier checks for MachineMemOperands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83474 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ff8952e8a9
commit
2dbc4c84f6
@ -27,6 +27,7 @@
|
||||
#include "llvm/CodeGen/LiveVariables.h"
|
||||
#include "llvm/CodeGen/MachineFunctionPass.h"
|
||||
#include "llvm/CodeGen/MachineFrameInfo.h"
|
||||
#include "llvm/CodeGen/MachineMemOperand.h"
|
||||
#include "llvm/CodeGen/MachineRegisterInfo.h"
|
||||
#include "llvm/CodeGen/Passes.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
@ -457,6 +458,15 @@ void MachineVerifier::visitMachineInstrBefore(const MachineInstr *MI) {
|
||||
*OS << TI.getNumOperands() << " operands expected, but "
|
||||
<< MI->getNumExplicitOperands() << " given.\n";
|
||||
}
|
||||
|
||||
// Check the MachineMemOperands for basic consistency.
|
||||
for (MachineInstr::mmo_iterator I = MI->memoperands_begin(),
|
||||
E = MI->memoperands_end(); I != E; ++I) {
|
||||
if ((*I)->isLoad() && !TI.mayLoad())
|
||||
report("Missing mayLoad flag", MI);
|
||||
if ((*I)->isStore() && !TI.mayStore())
|
||||
report("Missing mayStore flag", MI);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user