From 97a59fb464c7330037ce487f8fb6a079c7a52200 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 16 Feb 2015 19:33:36 +0000 Subject: [PATCH] MSVC 2013 does not ICE on this code in the same fashion that MSVC 2012 did; NFC. llvm-svn: 229422 --- llvm/lib/TableGen/TGParser.cpp | 3 +-- llvm/utils/TableGen/CodeGenRegisters.cpp | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp index 2445e58e1b9c..44f6a6ea9f31 100644 --- a/llvm/lib/TableGen/TGParser.cpp +++ b/llvm/lib/TableGen/TGParser.cpp @@ -385,8 +385,7 @@ static bool isObjectStart(tgtok::TokKind K) { /// GetNewAnonymousName - Generate a unique anonymous name that can be used as /// an identifier. std::string TGParser::GetNewAnonymousName() { - unsigned Tmp = AnonCounter++; // MSVC2012 ICEs without this. - return "anonymous_" + utostr(Tmp); + return "anonymous_" + utostr(AnonCounter++); } /// ParseObjectName - If an object name is specified, return it. Otherwise, diff --git a/llvm/utils/TableGen/CodeGenRegisters.cpp b/llvm/utils/TableGen/CodeGenRegisters.cpp index 2302eb7e5cf2..37f890531add 100644 --- a/llvm/utils/TableGen/CodeGenRegisters.cpp +++ b/llvm/utils/TableGen/CodeGenRegisters.cpp @@ -656,9 +656,7 @@ 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)); - // MSVC2012 ICEs if AnonCounter++ is directly passed to utostr. - ++AnonCounter; + R->setName("AnonRegClass_" + utostr(AnonCounter++)); } std::vector TypeList = R->getValueAsListOfDefs("RegTypes");