mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-26 06:04:47 +00:00
Add a few simple MachineVerifier checks for MachineMemOperands.
llvm-svn: 83474
This commit is contained in:
parent
b38401ccef
commit
aa09eaa3e8
@ -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…
x
Reference in New Issue
Block a user