Skip to content

Commit

Permalink
Implement String Cast from Integer
Browse files Browse the repository at this point in the history
Allow casts from integer to string.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149273 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
greened committed Jan 30, 2012
1 parent be3e310 commit 448b73a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/TableGen/Record.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 448b73a

Please sign in to comment.