소스 검색

Add @:keep to the cpp Std members to avoid DCE creating significant dependency changes when unrelated code uses one of the lesser functions, such as random

hughsando 11 년 전
부모
커밋
9f284a45a2
2개의 변경된 파일8개의 추가작업 그리고 8개의 파일을 삭제
  1. 1 1
      libs
  2. 7 7
      std/cpp/_std/Std.hx

+ 1 - 1
libs

@@ -1 +1 @@
-Subproject commit faf3761e1e1627c63b4b53d8044df915d77ce27d
+Subproject commit 87a41172b0afb34df37adfee2c07c1b561e4de63

+ 7 - 7
std/cpp/_std/Std.hx

@@ -20,31 +20,31 @@
  * DEALINGS IN THE SOFTWARE.
  */
 @:coreApi class Std {
-	public static function is( v : Dynamic, t : Dynamic ) : Bool {
+	@:keep public static function is( v : Dynamic, t : Dynamic ) : Bool {
 		return untyped __global__.__instanceof(v,t);
 	}
 
-	public static function instance<T>( v : { }, c : Class<T> ) : T {
+	@:keep public static function instance<T>( v : { }, c : Class<T> ) : T {
 		return Std.is(v, c) ? cast v : null;
 	}
 
-	public static function string( s : Dynamic ) : String {
+	@:keep public static function string( s : Dynamic ) : String {
 		return untyped s==null ? "null" : s.toString();
 	}
 
-	public static function int( x : Float ) : Int {
+	@:keep public static function int( x : Float ) : Int {
 		return untyped __global__.__int__(x);
 	}
 
-	public static function parseInt( x : String ) : Null<Int> {
+	@:keep public static function parseInt( x : String ) : Null<Int> {
 		return untyped __global__.__hxcpp_parse_int(x);
 	}
 
-	public static function parseFloat( x : String ) : Float {
+	@:keep public static function parseFloat( x : String ) : Float {
 		return untyped __global__.__hxcpp_parse_float(x);
 	}
 
-	public static function random( x : Int ) : Int {
+	@:keep public static function random( x : Int ) : Int {
 		if (x <= 0) return 0;
 		return untyped __global__.__hxcpp_irand(x);
 	}