From 448b73a95ca9be6409907b96402f1606cd87d80c Mon Sep 17 00:00:00 2001 From: David Greene Date: Mon, 30 Jan 2012 20:47:04 +0000 Subject: [PATCH] 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 --- lib/TableGen/Record.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp index bdd6e1562b96..e8f23e488873 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) {