2
0
Эх сурвалжийг харах

[cpp] Use cpp.Reference instead of AsVar, since the latter created temp variables

hughsando 8 жил өмнө
parent
commit
41f39a7d63

+ 2 - 1
src/optimization/analyzerTexpr.ml

@@ -151,6 +151,7 @@ let is_unbound_call_that_might_have_side_effects v el = match v.v_name,el with
 
 let is_ref_type = function
 	| TType({t_path = ["cs"],("Ref" | "Out")},_) -> true
+	| TType({t_path = ["cpp"],("Reference")},_) -> true
 	| TAbstract({a_path=["hl";"types"],"Ref"},_) -> true
 	| _ -> false
 
@@ -1112,4 +1113,4 @@ module Purity = struct
 			| _ ->
 				acc
 		) node_lut [];
-end
+end

+ 1 - 1
std/cpp/Pointer.hx

@@ -44,7 +44,7 @@ extern class Pointer<T> extends ConstPointer<T> implements ArrayAccess<T>
 
    public static function fromPointer<T>(inNativePointer:Dynamic) : Pointer<T>;
 
-   public static function addressOf<T>(inVariable:AsVar<T>) : Pointer<T>;
+   public static function addressOf<T>(inVariable:cpp.Reference<T>) : Pointer<T>;
 
    public static function endOf<T:{}>(inVariable:T) : Pointer<cpp.Void>;