]> git.saurik.com Git - cycript.git/blobdiff - Output.cpp
Added bridging for nlist_64, activated memory manager, and setup a remap from singlet...
[cycript.git] / Output.cpp
index 1f1163d91b91e3d898d49357b15ad3134989cbfd..3396b483207c555a34fccf778fdee0d364ad0786 100644 (file)
@@ -3,6 +3,9 @@
 #include <iostream>
 #include <iomanip>
 
+#include <objc/runtime.h>
+#include <sstream>
+
 _finline CYFlags operator ~(CYFlags rhs) {
     return static_cast<CYFlags>(~static_cast<unsigned>(rhs));
 }
@@ -43,7 +46,7 @@ bool CYTrue::Value() const {
 
 void CYAddressOf::Output(std::ostream &out, CYFlags flags) const {
     rhs_->Output(out, 1, CYLeft(flags));
-    out << ".$()";
+    out << ".addressOf()";
 }
 
 void CYArgument::Output(std::ostream &out) const {
@@ -463,14 +466,15 @@ void CYSelectorPart::Output(std::ostream &out) const {
 void CYSend::Output(std::ostream &out, CYFlags flags) const {
     out << "objc_msgSend(";
     self_->Output(out, CYPA, CYNoFlags);
-    out << ",\"";
+    out << ",";
+    std::ostringstream name;
     for (CYArgument *argument(arguments_); argument != NULL; argument = argument->next_)
         if (argument->name_ != NULL) {
-            out << *argument->name_;
+            name << *argument->name_;
             if (argument->value_ != NULL)
-                out << ':';
+                name << ':';
         }
-    out << "\"";
+    out << reinterpret_cast<void *>(sel_registerName(name.str().c_str()));
     for (CYArgument *argument(arguments_); argument != NULL; argument = argument->next_)
         if (argument->value_ != NULL) {
             out << ",";