diff options
author | David Greene <greened@obbligato.org> | 2012-01-30 20:47:04 +0000 |
---|---|---|
committer | David Greene <greened@obbligato.org> | 2012-01-30 20:47:04 +0000 |
commit | 448b73a95ca9be6409907b96402f1606cd87d80c (patch) | |
tree | ad7e87ee5fdd87105cc6e540900a3885ad6663b7 /lib/TableGen | |
parent | be3e310d5ed8717f070acc71b0f4dae28cb08c4d (diff) |
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
Diffstat (limited to 'lib/TableGen')
-rw-r--r-- | lib/TableGen/Record.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp index bdd6e1562b..e8f23e4888 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) { |