diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2023-07-17 00:29:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-17 00:29:37 +0300 |
commit | 0dba7340ecfbe84231a14559ef7f9e7dfb7d1299 (patch) | |
tree | ade6d93a8c93bfbfe9df8de6796c93588e3fe080 /mesonbuild/compilers/mixins/compcert.py | |
parent | b60ea0851b1dfe4400dc2d12b127300b1da41105 (diff) | |
parent | 9b86c67e19b91eee065c1e3706ad5521801022da (diff) | |
download | meson-0dba7340ecfbe84231a14559ef7f9e7dfb7d1299.zip meson-0dba7340ecfbe84231a14559ef7f9e7dfb7d1299.tar.gz meson-0dba7340ecfbe84231a14559ef7f9e7dfb7d1299.tar.bz2 |
Merge pull request #11976 from tristan957/cleanups
Some various type related cleanups
Diffstat (limited to 'mesonbuild/compilers/mixins/compcert.py')
-rw-r--r-- | mesonbuild/compilers/mixins/compcert.py | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/mesonbuild/compilers/mixins/compcert.py b/mesonbuild/compilers/mixins/compcert.py index d9c21a8..ac4d5aa 100644 --- a/mesonbuild/compilers/mixins/compcert.py +++ b/mesonbuild/compilers/mixins/compcert.py @@ -30,16 +30,16 @@ else: # do). This gives up DRYer type checking, with no runtime impact Compiler = object -ccomp_buildtype_args = { +ccomp_buildtype_args: T.Dict[str, T.List[str]] = { 'plain': [''], 'debug': ['-O0', '-g'], 'debugoptimized': ['-O0', '-g'], 'release': ['-O3'], 'minsize': ['-Os'], 'custom': ['-Obranchless'], -} # type: T.Dict[str, T.List[str]] +} -ccomp_optimization_args = { +ccomp_optimization_args: T.Dict[str, T.List[str]] = { 'plain': [], '0': ['-O0'], 'g': ['-O0'], @@ -47,19 +47,19 @@ ccomp_optimization_args = { '2': ['-O2'], '3': ['-O3'], 's': ['-Os'] -} # type: T.Dict[str, T.List[str]] +} -ccomp_debug_args = { +ccomp_debug_args: T.Dict[bool, T.List[str]] = { False: [], True: ['-g'] -} # type: T.Dict[bool, T.List[str]] +} # As of CompCert 20.04, these arguments should be passed to the underlying gcc linker (via -WUl,<arg>) # There are probably (many) more, but these are those used by picolibc -ccomp_args_to_wul = [ +ccomp_args_to_wul: T.List[str] = [ r"^-ffreestanding$", r"^-r$" -] # type: T.List[str] +] class CompCertCompiler(Compiler): @@ -69,12 +69,13 @@ class CompCertCompiler(Compiler): # Assembly self.can_compile_suffixes.add('s') self.can_compile_suffixes.add('sx') - default_warn_args = [] # type: T.List[str] - self.warn_args = {'0': [], - '1': default_warn_args, - '2': default_warn_args + [], - '3': default_warn_args + [], - 'everything': default_warn_args + []} # type: T.Dict[str, T.List[str]] + default_warn_args: T.List[str] = [] + self.warn_args: T.Dict[str, T.List[str]] = { + '0': [], + '1': default_warn_args, + '2': default_warn_args + [], + '3': default_warn_args + [], + 'everything': default_warn_args + []} def get_always_args(self) -> T.List[str]: return [] @@ -95,7 +96,7 @@ class CompCertCompiler(Compiler): @classmethod def _unix_args_to_native(cls, args: T.List[str], info: MachineInfo) -> T.List[str]: "Always returns a copy that can be independently mutated" - patched_args = [] # type: T.List[str] + patched_args: T.List[str] = [] for arg in args: added = 0 for ptrn in ccomp_args_to_wul: |