From f15fe8195b0a42d0e950f3694c4d6ccd4034804a Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Tue, 26 Feb 2013 21:29:47 +0000 Subject: [TableGen] Fix ICE on MSVC 2012 Release builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176125 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/TableGen/TGParser.cpp | 3 ++- utils/TableGen/CodeGenRegisters.cpp | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/TableGen/TGParser.cpp b/lib/TableGen/TGParser.cpp index da0086a74a..c4b48fe5e8 100644 --- a/lib/TableGen/TGParser.cpp +++ b/lib/TableGen/TGParser.cpp @@ -382,7 +382,8 @@ static bool isObjectStart(tgtok::TokKind K) { 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, diff --git a/utils/TableGen/CodeGenRegisters.cpp b/utils/TableGen/CodeGenRegisters.cpp index 4238340ff0..993b8dba42 100644 --- a/utils/TableGen/CodeGenRegisters.cpp +++ b/utils/TableGen/CodeGenRegisters.cpp @@ -703,7 +703,9 @@ CodeGenRegisterClass::CodeGenRegisterClass(CodeGenRegBank &RegBank, Record *R) // 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 TypeList = R->getValueAsListOfDefs("RegTypes"); -- cgit v1.2.3-18-g5258