Changeset View
Changeset View
Standalone View
Standalone View
llvm/utils/lit/lit/llvm/config.py
Show First 20 Lines • Show All 339 Lines • ▼ Show 20 Lines | def use_llvm_tool(self, name, search_env=None, required=False, quiet=False): | ||||
self.lit_config.fatal(message) | self.lit_config.fatal(message) | ||||
if tool: | if tool: | ||||
tool = os.path.normpath(tool) | tool = os.path.normpath(tool) | ||||
if not self.lit_config.quiet and not quiet: | if not self.lit_config.quiet and not quiet: | ||||
self.lit_config.note('using {}: {}'.format(name, tool)) | self.lit_config.note('using {}: {}'.format(name, tool)) | ||||
return tool | return tool | ||||
def use_clang(self, additional_tool_dirs=[], additional_flags=[], required=True): | def use_clang(self, additional_tool_dirs=[], cc_additional_flags=[], | ||||
cc1_additional_flags=[], cl_additional_flags=[], required=True): | |||||
"""Configure the test suite to be able to invoke clang. | """Configure the test suite to be able to invoke clang. | ||||
Sets up some environment variables important to clang, locates a | Sets up some environment variables important to clang, locates a | ||||
just-built or installed clang, and add a set of standard | just-built or installed clang, and add a set of standard | ||||
substitutions useful to any test suite that makes use of clang. | substitutions useful to any test suite that makes use of clang. | ||||
""" | """ | ||||
# Clear some environment variables that might affect Clang. | # Clear some environment variables that might affect Clang. | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | def use_clang(self, additional_tool_dirs=[], cc_additional_flags=[], | ||||
pext = getattr(self.config, 'llvm_plugin_ext', None) | pext = getattr(self.config, 'llvm_plugin_ext', None) | ||||
if shl: | if shl: | ||||
self.config.substitutions.append(('%llvmshlibdir', shl)) | self.config.substitutions.append(('%llvmshlibdir', shl)) | ||||
if pext: | if pext: | ||||
self.config.substitutions.append(('%pluginext', pext)) | self.config.substitutions.append(('%pluginext', pext)) | ||||
builtin_include_dir = self.get_clang_builtin_include_dir(self.config.clang) | builtin_include_dir = self.get_clang_builtin_include_dir(self.config.clang) | ||||
tool_substitutions = [ | tool_substitutions = [ | ||||
ToolSubst('%clang', command=self.config.clang, extra_args=additional_flags), | ToolSubst('%clang', command=self.config.clang, extra_args=cc_additional_flags), | ||||
ToolSubst('%clang_analyze_cc1', command='%clang_cc1', extra_args=['-analyze', '%analyze', '-setup-static-analyzer']+additional_flags), | ToolSubst('%clang_analyze_cc1', command='%clang_cc1', extra_args=['-analyze', '%analyze', '-setup-static-analyzer']+cc1_additional_flags), | ||||
ToolSubst('%clang_cc1', command=self.config.clang, extra_args=['-cc1', '-internal-isystem', builtin_include_dir, '-nostdsysteminc']+additional_flags), | ToolSubst('%clang_cc1', command=self.config.clang, extra_args=['-cc1', '-internal-isystem', builtin_include_dir, '-nostdsysteminc']+cc1_additional_flags), | ||||
ToolSubst('%clang_cpp', command=self.config.clang, extra_args=['--driver-mode=cpp']+additional_flags), | ToolSubst('%clang_cpp', command=self.config.clang, extra_args=['--driver-mode=cpp']), | ||||
ToolSubst('%clang_cl', command=self.config.clang, extra_args=['--driver-mode=cl']+additional_flags), | ToolSubst('%clang_cl', command=self.config.clang, extra_args=['--driver-mode=cl']+cl_additional_flags), | ||||
ToolSubst('%clangxx', command=self.config.clang, extra_args=['--driver-mode=g++']+additional_flags), | ToolSubst('%clangxx', command=self.config.clang, extra_args=['--driver-mode=g++']+cc_additional_flags), | ||||
ToolSubst('%clang_bin', command=self.config.clang), | |||||
] | ] | ||||
self.add_tool_substitutions(tool_substitutions) | self.add_tool_substitutions(tool_substitutions) | ||||
self.config.substitutions.append(('%itanium_abi_triple', | self.config.substitutions.append(('%itanium_abi_triple', | ||||
self.make_itanium_abi_triple(self.config.target_triple))) | self.make_itanium_abi_triple(self.config.target_triple))) | ||||
self.config.substitutions.append(('%ms_abi_triple', | self.config.substitutions.append(('%ms_abi_triple', | ||||
self.make_msabi_triple(self.config.target_triple))) | self.make_msabi_triple(self.config.target_triple))) | ||||
self.config.substitutions.append( | self.config.substitutions.append( | ||||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |