[llvm] r176125 - [TableGen] Fix ICE on MSVC 2012 Release builds.
Michael J. Spencer
bigcheesegs at gmail.com
Tue Feb 26 13:29:47 PST 2013
Author: mspencer
Date: Tue Feb 26 15:29:47 2013
New Revision: 176125
URL: http://llvm.org/viewvc/llvm-project?rev=176125&view=rev
Log:
[TableGen] Fix ICE on MSVC 2012 Release builds.
Modified:
llvm/trunk/lib/TableGen/TGParser.cpp
llvm/trunk/utils/TableGen/CodeGenRegisters.cpp
Modified: llvm/trunk/lib/TableGen/TGParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/TGParser.cpp?rev=176125&r1=176124&r2=176125&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/TGParser.cpp (original)
+++ llvm/trunk/lib/TableGen/TGParser.cpp Tue Feb 26 15:29:47 2013
@@ -382,7 +382,8 @@ static bool isObjectStart(tgtok::TokKind
static std::string GetNewAnonymousName() {
static unsigned AnonCounter = 0;
- return "anonymous."+utostr(AnonCounter++);
+ unsigned Tmp = AnonCounter++; // MSVC2012 ICEs without this.
+ return "anonymous." + utostr(Tmp);
}
/// ParseObjectName - If an object name is specified, return it. Otherwise,
Modified: llvm/trunk/utils/TableGen/CodeGenRegisters.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenRegisters.cpp?rev=176125&r1=176124&r2=176125&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenRegisters.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeGenRegisters.cpp Tue Feb 26 15:29:47 2013
@@ -703,7 +703,9 @@ CodeGenRegisterClass::CodeGenRegisterCla
// Rename anonymous register classes.
if (R->getName().size() > 9 && R->getName()[9] == '.') {
static unsigned AnonCounter = 0;
- R->setName("AnonRegClass_"+utostr(AnonCounter++));
+ R->setName("AnonRegClass_" + utostr(AnonCounter));
+ // MSVC2012 ICEs if AnonCounter++ is directly passed to utostr.
+ ++AnonCounter;
}
std::vector<Record*> TypeList = R->getValueAsListOfDefs("RegTypes");
More information about the llvm-commits
mailing list