@@ -119,16 +119,19 @@ class Void(Type):
119
119
def __init__ (self ):
120
120
Type .__init__ (self , 0 )
121
121
122
- def compiler_ctor (self ):
122
+ @staticmethod
123
+ def compiler_ctor ():
123
124
return '::VOID'
124
125
125
126
def compiler_ctor_ref (self ):
126
127
return '&' + self .compiler_ctor ()
127
128
128
- def rust_name (self ):
129
+ @staticmethod
130
+ def rust_name ():
129
131
return '()'
130
132
131
- def type_info (self , platform_info ):
133
+ @staticmethod
134
+ def type_info (platform_info ):
132
135
return None
133
136
134
137
def __eq__ (self , other ):
@@ -282,7 +285,7 @@ def __eq__(self, other):
282
285
283
286
class Pointer (Type ):
284
287
def __init__ (self , elem , llvm_elem , const ):
285
- self ._elem = elem ;
288
+ self ._elem = elem
286
289
self ._llvm_elem = llvm_elem
287
290
self ._const = const
288
291
Type .__init__ (self , BITWIDTH_POINTER )
@@ -503,7 +506,7 @@ def monomorphise(self):
503
506
# must be a power of two
504
507
assert width & (width - 1 ) == 0
505
508
def recur (processed , untouched ):
506
- if untouched == [] :
509
+ if not untouched :
507
510
ret = processed [0 ]
508
511
args = processed [1 :]
509
512
yield MonomorphicIntrinsic (self ._platform , self .intrinsic , width ,
@@ -756,22 +759,26 @@ class ExternBlock(object):
756
759
def __init__ (self ):
757
760
pass
758
761
759
- def open (self , platform ):
762
+ @staticmethod
763
+ def open (platform ):
760
764
return 'extern "platform-intrinsic" {'
761
765
762
- def render (self , mono ):
766
+ @staticmethod
767
+ def render (mono ):
763
768
return ' fn {}{}{};' .format (mono .platform_prefix (),
764
769
mono .intrinsic_name (),
765
770
mono .intrinsic_signature ())
766
771
767
- def close (self ):
772
+ @staticmethod
773
+ def close ():
768
774
return '}'
769
775
770
776
class CompilerDefs (object ):
771
777
def __init__ (self ):
772
778
pass
773
779
774
- def open (self , platform ):
780
+ @staticmethod
781
+ def open (platform ):
775
782
return '''\
776
783
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
777
784
// file at the top-level directory of this distribution and at
@@ -798,7 +805,8 @@ def open(self, platform):
798
805
if !name.starts_with("{0}") {{ return None }}
799
806
Some(match &name["{0}".len()..] {{''' .format (platform .platform_prefix ())
800
807
801
- def render (self , mono ):
808
+ @staticmethod
809
+ def render (mono ):
802
810
return '''\
803
811
"{}" => Intrinsic {{
804
812
inputs: {{ static INPUTS: [&'static Type; {}] = [{}]; &INPUTS }},
@@ -810,7 +818,8 @@ def render(self, mono):
810
818
mono .compiler_ret (),
811
819
mono .llvm_name ())
812
820
813
- def close (self ):
821
+ @staticmethod
822
+ def close ():
814
823
return '''\
815
824
_ => return None,
816
825
})
0 commit comments