diff options
| author | Jeff Cohen <jeffc@jolt-lang.org> | 2006-01-04 03:15:19 +0000 |
|---|---|---|
| committer | Jeff Cohen <jeffc@jolt-lang.org> | 2006-01-04 03:15:19 +0000 |
| commit | 7d17a6bc861756a3393ecbe3654d94bf75877bc5 (patch) | |
| tree | aae004d1ee4885d60720866acda30f7fe9c921e6 /llvm/utils | |
| parent | 6b52be6a899074ce83e52225680e5ae4eaa0ffce (diff) | |
| download | bcm5719-llvm-7d17a6bc861756a3393ecbe3654d94bf75877bc5.tar.gz bcm5719-llvm-7d17a6bc861756a3393ecbe3654d94bf75877bc5.zip | |
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
Diffstat (limited to 'llvm/utils')
| -rw-r--r-- | llvm/utils/TableGen/DAGISelEmitter.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/DAGISelEmitter.cpp b/llvm/utils/TableGen/DAGISelEmitter.cpp index d719038ac89..1fbb7c6946e 100644 --- a/llvm/utils/TableGen/DAGISelEmitter.cpp +++ b/llvm/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; |

