projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add tests for the 'x' operation.
[oota-llvm.git]
/
utils
/
TableGen
/
CodeEmitterGen.cpp
diff --git
a/utils/TableGen/CodeEmitterGen.cpp
b/utils/TableGen/CodeEmitterGen.cpp
index e60aec9568ff9b950870593f467f1522a1159a75..c94d384901f0c21d02081448c1df5c9f3fe30a23 100644
(file)
--- a/
utils/TableGen/CodeEmitterGen.cpp
+++ b/
utils/TableGen/CodeEmitterGen.cpp
@@
-14,10
+14,10
@@
//===----------------------------------------------------------------------===//
#include "CodeGenTarget.h"
//===----------------------------------------------------------------------===//
#include "CodeGenTarget.h"
-#include "llvm/TableGen/Record.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
+#include "llvm/TableGen/Record.h"
#include "llvm/TableGen/TableGenBackend.h"
#include <map>
#include <string>
#include "llvm/TableGen/TableGenBackend.h"
#include <map>
#include <string>
@@
-134,10
+134,13
@@
AddCodeToMergeInOperand(Record *R, BitsInit *BI, const std::string &VarName,
assert(!CGI.Operands.isFlatOperandNotEmitted(OpIdx) &&
"Explicitly used operand also marked as not emitted!");
} else {
assert(!CGI.Operands.isFlatOperandNotEmitted(OpIdx) &&
"Explicitly used operand also marked as not emitted!");
} else {
+ unsigned NumberOps = CGI.Operands.size();
/// If this operand is not supposed to be emitted by the
/// generated emitter, skip it.
/// If this operand is not supposed to be emitted by the
/// generated emitter, skip it.
- while (CGI.Operands.isFlatOperandNotEmitted(NumberedOp))
+ while (NumberedOp < NumberOps &&
+ CGI.Operands.isFlatOperandNotEmitted(NumberedOp))
++NumberedOp;
++NumberedOp;
+
OpIdx = NumberedOp++;
}
OpIdx = NumberedOp++;
}