Skip to content

Commit

Permalink
compilers: drop dead code
Browse files Browse the repository at this point in the history
no_warn_args is unused. Its only purpose was to implement automatic
hiding of UB in transpiled code, and it was not used at all in languages
other than C/C++ -- specifically when the C/C++ source files were
created by transpiling from vala or cython.
  • Loading branch information
eli-schwartz committed Dec 6, 2023
1 parent 5f659af commit 39ecfc2
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 24 deletions.
4 changes: 0 additions & 4 deletions mesonbuild/compilers/compilers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1377,10 +1377,6 @@ def get_debug_args(self, is_debug: bool) -> T.List[str]:
"""Arguments required for a debug build."""
return []

def get_no_warn_args(self) -> T.List[str]:
"""Arguments to completely disable warnings."""
return []

def needs_static_linker(self) -> bool:
raise NotImplementedError(f'There is no static linker for {self.language}')

Expand Down
4 changes: 0 additions & 4 deletions mesonbuild/compilers/fortran.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,6 @@ def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoic
def get_module_outdir_args(self, path: str) -> T.List[str]:
return ['-fmod=' + path]

def get_no_warn_args(self) -> T.List[str]:
# FIXME: Confirm that there's no compiler option to disable all warnings
return []


class SunFortranCompiler(FortranCompiler):

Expand Down
3 changes: 0 additions & 3 deletions mesonbuild/compilers/java.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ def get_warn_args(self, level: str) -> T.List[str]:
def get_werror_args(self) -> T.List[str]:
return ['-Werror']

def get_no_warn_args(self) -> T.List[str]:
return ['-nowarn']

def get_output_args(self, outputname: str) -> T.List[str]:
if outputname == '':
outputname = './'
Expand Down
4 changes: 0 additions & 4 deletions mesonbuild/compilers/mixins/clike.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,6 @@ def get_warn_args(self, level: str) -> T.List[str]:
# TODO: this should be an enum
return self.warn_args[level]

def get_no_warn_args(self) -> T.List[str]:
# Almost every compiler uses this for disabling warnings
return ['-w']

def get_depfile_suffix(self) -> str:
return 'd'

Expand Down
3 changes: 0 additions & 3 deletions mesonbuild/compilers/mixins/pgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ def __init__(self) -> None:
def get_module_incdir_args(self) -> T.Tuple[str]:
return ('-module', )

def get_no_warn_args(self) -> T.List[str]:
return ['-silent']

def gen_import_library_args(self, implibname: str) -> T.List[str]:
return []

Expand Down
3 changes: 0 additions & 3 deletions mesonbuild/compilers/rust.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,6 @@ def get_warn_args(self, level: str) -> T.List[str]:
# TODO: I'm not really sure what to put here, Rustc doesn't have warning
return self._WARNING_LEVELS[level]

def get_no_warn_args(self) -> T.List[str]:
return self._WARNING_LEVELS["0"]

def get_pic_args(self) -> T.List[str]:
# relocation-model=pic is rustc's default already.
return []
Expand Down
3 changes: 0 additions & 3 deletions mesonbuild/compilers/vala.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ def get_always_args(self) -> T.List[str]:
def get_warn_args(self, level: str) -> T.List[str]:
return []

def get_no_warn_args(self) -> T.List[str]:
return ['--disable-warnings']

def get_werror_args(self) -> T.List[str]:
return ['--fatal-warnings']

Expand Down

0 comments on commit 39ecfc2

Please sign in to comment.