projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
be3e310
)
Implement String Cast from Integer
author
David Greene
<greened@obbligato.org>
Mon, 30 Jan 2012 20:47:04 +0000
(20:47 +0000)
committer
David Greene
<greened@obbligato.org>
Mon, 30 Jan 2012 20:47:04 +0000
(20:47 +0000)
Allow casts from integer to string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149273
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/TableGen/Record.cpp
patch
|
blob
|
history
diff --git
a/lib/TableGen/Record.cpp
b/lib/TableGen/Record.cpp
index bdd6e1562b96a5318eecd701637e4aa96ddc3725..e8f23e48887330e496e06b01000afb5d781e3752 100644
(file)
--- 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) {