aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2012-01-30 20:47:04 +0000
committerDavid Greene <greened@obbligato.org>2012-01-30 20:47:04 +0000
commit448b73a95ca9be6409907b96402f1606cd87d80c (patch)
treead7e87ee5fdd87105cc6e540900a3885ad6663b7
parentbe3e310d5ed8717f070acc71b0f4dae28cb08c4d (diff)
downloadexternal_llvm-448b73a95ca9be6409907b96402f1606cd87d80c.zip
external_llvm-448b73a95ca9be6409907b96402f1606cd87d80c.tar.gz
external_llvm-448b73a95ca9be6409907b96402f1606cd87d80c.tar.bz2
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
-rw-r--r--lib/TableGen/Record.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp
index bdd6e15..e8f23e4 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<IntInit*>(LHS);
+ if (LHSi) {
+ return StringInit::get(LHSi->getAsString());
+ }
} else {
StringInit *LHSs = dynamic_cast<StringInit*>(LHS);
if (LHSs) {