[llvm-commits] [llvm] r149273 - /llvm/trunk/lib/TableGen/Record.cpp
David Greene
greened at obbligato.org
Mon Jan 30 12:47:04 PST 2012
Author: greened
Date: Mon Jan 30 14:47:04 2012
New Revision: 149273
URL: http://llvm.org/viewvc/llvm-project?rev=149273&view=rev
Log:
Implement String Cast from Integer
Allow casts from integer to string.
Modified:
llvm/trunk/lib/TableGen/Record.cpp
Modified: llvm/trunk/lib/TableGen/Record.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/Record.cpp?rev=149273&r1=149272&r2=149273&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/Record.cpp (original)
+++ llvm/trunk/lib/TableGen/Record.cpp Mon Jan 30 14:47:04 2012
@@ -738,6 +738,11 @@
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) {
More information about the llvm-commits
mailing list