]> git.saurik.com Git - cycript.git/blobdiff - Replace.cpp
Use libclang to walk CXType for anonymous structs.
[cycript.git] / Replace.cpp
index 6f33f8f584dbe08ea0f2ba983805f3e257cdd8c4..df47604db724c8b5ce5b58f33ecaee71c7fa1f65 100644 (file)
@@ -182,6 +182,7 @@ CYTarget *CYClassExpression::Replace(CYContext &context) {
 
     if (tail_->constructor_ == NULL)
         tail_->constructor_ = $ CYFunctionExpression(NULL, NULL, NULL);
+    tail_->constructor_->name_ = name_;
     tail_->constructor_ = CYSuperize(context, tail_->constructor_);
 
     context.super_ = old;
@@ -388,8 +389,12 @@ CYTarget *CYExtend::Replace(CYContext &context) {
     return object_.Replace(context, lhs_);
 }
 
-CYStatement *CYExternal::Replace(CYContext &context) {
-    return $E($ CYAssign($V(typed_->identifier_), $C1(typed_->Replace(context), $C2($V("dlsym"), $V("RTLD_DEFAULT"), $S(typed_->identifier_->Word())))));
+CYStatement *CYExternalDefinition::Replace(CYContext &context) {
+    return $E($ CYAssign($V(typed_->identifier_), $ CYExternalExpression(abi_, typed_)));
+}
+
+CYTarget *CYExternalExpression::Replace(CYContext &context) {
+    return $C1(typed_->Replace(context), $C2($V("dlsym"), $V("RTLD_DEFAULT"), $S(typed_->identifier_->Word())));
 }
 
 CYNumber *CYFalse::Number(CYContext &context) {