[llvm-commits] [llvm] r83474 - /llvm/trunk/lib/CodeGen/MachineVerifier.cpp
Dan Gohman
gohman at apple.com
Wed Oct 7 10:36:00 PDT 2009
Author: djg
Date: Wed Oct 7 12:36:00 2009
New Revision: 83474
URL: http://llvm.org/viewvc/llvm-project?rev=83474&view=rev
Log:
Add a few simple MachineVerifier checks for MachineMemOperands.
Modified:
llvm/trunk/lib/CodeGen/MachineVerifier.cpp
Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineVerifier.cpp?rev=83474&r1=83473&r2=83474&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineVerifier.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp Wed Oct 7 12:36:00 2009
@@ -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 @@
*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
More information about the llvm-commits
mailing list