From: David Greene Date: Mon, 30 Jan 2012 20:47:04 +0000 (+0000) Subject: Implement String Cast from Integer X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=448b73a95ca9be6409907b96402f1606cd87d80c;p=oota-llvm.git Implement String Cast from Integer Allow casts from integer to string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149273 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp index bdd6e1562b9..e8f23e48887 100644 --- a/lib/TableGen/Record.cpp +++ b/lib/TableGen/Record.cpp @@ -738,6 +738,11 @@ Init *UnOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) const { if (LHSd) { return StringInit::get(LHSd->getDef()->getName()); } + + IntInit *LHSi = dynamic_cast(LHS); + if (LHSi) { + return StringInit::get(LHSi->getAsString()); + } } else { StringInit *LHSs = dynamic_cast(LHS); if (LHSs) {