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
This commit is contained in:
David Greene 2012-01-30 20:47:04 +00:00
parent be3e310d5e
commit 448b73a95c

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