From 22e9ce48e013be951a18499306a89c922d2f78e9 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. llvm-svn: 149273 --- lib/TableGen/Record.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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) {