aboutsummaryrefslogtreecommitdiffstats
path: root/utils/TableGen
diff options
context:
space:
mode:
authorJeff Cohen <jeffc@jolt-lang.org>2006-01-04 03:15:19 +0000
committerJeff Cohen <jeffc@jolt-lang.org>2006-01-04 03:15:19 +0000
commitf356d70ec3a231ee760529fa1ca966f3e0b5161c (patch)
tree920a9500f5aa251e24f349c551a34dab0dec9cb2 /utils/TableGen
parent84e1064f4584c20b839b9172c5c26c20b6ffb2fe (diff)
downloadexternal_llvm-f356d70ec3a231ee760529fa1ca966f3e0b5161c.zip
external_llvm-f356d70ec3a231ee760529fa1ca966f3e0b5161c.tar.gz
external_llvm-f356d70ec3a231ee760529fa1ca966f3e0b5161c.tar.bz2
Tblgen was generating syntactically illegal C++ code like:
SDOperand Tmp0,Tmp1,Tmp2,Tmp3,; GCC has a bug (24907) in which is fails to catch this, but VC++ correctly notes its illegality, so tblgen must be taught to only generate legal C++. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25075 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r--utils/TableGen/DAGISelEmitter.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp
index d719038..1fbb7c6 100644
--- a/utils/TableGen/DAGISelEmitter.cpp
+++ b/utils/TableGen/DAGISelEmitter.cpp
@@ -2030,12 +2030,13 @@ public:
std::string Fn = CP->getSelectFunc();
NumRes = CP->getNumOperands();
OS << " SDOperand ";
- for (unsigned i = 0; i != NumRes; ++i)
+ unsigned i;
+ for (i = 0; i < NumRes - 1; ++i)
OS << "Tmp" << (i+ResNo) << ",";
- OS << ";\n";
+ OS << "Tmp" << (i+ResNo) << ";\n";
OS << " if (!" << Fn << "(" << Val;
- for (unsigned i = 0; i < NumRes; i++)
+ for (i = 0; i < NumRes; i++)
OS << ", Tmp" << i + ResNo;
OS << ")) goto P" << PatternNo << "Fail;\n";
TmpNo = ResNo + NumRes;