Implement String Cast from Integer

Allow casts from integer to string.

llvm-svn: 149273
This commit is contained in:
David Greene 2012-01-30 20:47:04 +00:00
parent c9204f6bed
commit 6291f3a43c
1 changed files with 5 additions and 0 deletions

View File

@ -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) {