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++.

llvm-svn: 25075
This commit is contained in:
Jeff Cohen 2006-01-04 03:15:19 +00:00
parent 6b52be6a89
commit 7d17a6bc86
1 changed files with 4 additions and 3 deletions

View File

@ -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;