@@ -119,16 +119,19 @@ class Void(Type):
119119 def __init__ (self ):
120120 Type .__init__ (self , 0 )
121121
122- def compiler_ctor (self ):
122+ @staticmethod
123+ def compiler_ctor ():
123124 return '::VOID'
124125
125126 def compiler_ctor_ref (self ):
126127 return '&' + self .compiler_ctor ()
127128
128- def rust_name (self ):
129+ @staticmethod
130+ def rust_name ():
129131 return '()'
130132
131- def type_info (self , platform_info ):
133+ @staticmethod
134+ def type_info (platform_info ):
132135 return None
133136
134137 def __eq__ (self , other ):
@@ -282,7 +285,7 @@ def __eq__(self, other):
282285
283286class Pointer (Type ):
284287 def __init__ (self , elem , llvm_elem , const ):
285- self ._elem = elem ;
288+ self ._elem = elem
286289 self ._llvm_elem = llvm_elem
287290 self ._const = const
288291 Type .__init__ (self , BITWIDTH_POINTER )
@@ -503,7 +506,7 @@ def monomorphise(self):
503506 # must be a power of two
504507 assert width & (width - 1 ) == 0
505508 def recur (processed , untouched ):
506- if untouched == [] :
509+ if not untouched :
507510 ret = processed [0 ]
508511 args = processed [1 :]
509512 yield MonomorphicIntrinsic (self ._platform , self .intrinsic , width ,
@@ -756,22 +759,26 @@ class ExternBlock(object):
756759 def __init__ (self ):
757760 pass
758761
759- def open (self , platform ):
762+ @staticmethod
763+ def open (platform ):
760764 return 'extern "platform-intrinsic" {'
761765
762- def render (self , mono ):
766+ @staticmethod
767+ def render (mono ):
763768 return ' fn {}{}{};' .format (mono .platform_prefix (),
764769 mono .intrinsic_name (),
765770 mono .intrinsic_signature ())
766771
767- def close (self ):
772+ @staticmethod
773+ def close ():
768774 return '}'
769775
770776class CompilerDefs (object ):
771777 def __init__ (self ):
772778 pass
773779
774- def open (self , platform ):
780+ @staticmethod
781+ def open (platform ):
775782 return '''\
776783 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
777784// file at the top-level directory of this distribution and at
@@ -798,7 +805,8 @@ def open(self, platform):
798805 if !name.starts_with("{0}") {{ return None }}
799806 Some(match &name["{0}".len()..] {{''' .format (platform .platform_prefix ())
800807
801- def render (self , mono ):
808+ @staticmethod
809+ def render (mono ):
802810 return '''\
803811 "{}" => Intrinsic {{
804812 inputs: {{ static INPUTS: [&'static Type; {}] = [{}]; &INPUTS }},
@@ -810,7 +818,8 @@ def render(self, mono):
810818 mono .compiler_ret (),
811819 mono .llvm_name ())
812820
813- def close (self ):
821+ @staticmethod
822+ def close ():
814823 return '''\
815824 _ => return None,
816825 })
0 commit comments