@@ -1947,7 +1947,7 @@ static SwiftASTContext *GetModuleSwiftASTContext(Module &module) {
1947
1947
// / its module SwiftASTContext to Target.
1948
1948
static void
1949
1949
ProcessModule (ModuleSP module_sp, std::string m_description,
1950
- bool use_all_compiler_flags, Target &target,
1950
+ bool use_all_compiler_flags, Target &target, llvm::Triple triple,
1951
1951
std::vector<std::string> &module_search_paths,
1952
1952
std::vector<std::pair<std::string, bool >> &framework_search_paths,
1953
1953
std::vector<std::string> &extra_clang_args) {
@@ -2023,37 +2023,6 @@ ProcessModule(ModuleSP module_sp, std::string m_description,
2023
2023
if (!HasSwiftModules (*module_sp))
2024
2024
return ;
2025
2025
2026
- SwiftASTContext *ast_context = GetModuleSwiftASTContext (*module_sp);
2027
- if (!ast_context || ast_context->HasFatalErrors () ||
2028
- !ast_context->GetClangImporter ()) {
2029
- // Make sure we warn about this module load failure, the one
2030
- // that comes from loading types often gets swallowed up and not
2031
- // seen, this is the only reliable point where we can show this.
2032
- // But only do it once per UUID so we don't overwhelm the user
2033
- // with warnings.
2034
- UUID module_uuid (module_sp->GetUUID ());
2035
- bool unique_message =
2036
- target.RegisterSwiftContextMessageKey (module_uuid.GetAsString ());
2037
- if (!unique_message)
2038
- return ;
2039
- std::string buf;
2040
- {
2041
- llvm::raw_string_ostream ss (buf);
2042
- module_sp->GetDescription (ss, eDescriptionLevelBrief);
2043
- if (ast_context && ast_context->HasFatalErrors ())
2044
- ss << " : " << ast_context->GetFatalErrors ().AsCString (" unknown error" );
2045
- }
2046
- target.GetDebugger ().GetErrorStreamSP ()->Printf (
2047
- " Error while loading Swift module:\n %s\n "
2048
- " Debug info from this module will be unavailable in the "
2049
- " debugger.\n\n " ,
2050
- buf.c_str ());
2051
- return ;
2052
- }
2053
-
2054
- if (ast_context->HasErrors ())
2055
- return ;
2056
-
2057
2026
// Load search path options from the module.
2058
2027
if (!use_all_compiler_flags &&
2059
2028
target.GetExecutableModulePointer () != module_sp.get ())
@@ -2069,7 +2038,6 @@ ProcessModule(ModuleSP module_sp, std::string m_description,
2069
2038
// older versions of the same .swiftinterface.
2070
2039
if (auto dsym = GetDSYMBundle (*module_sp)) {
2071
2040
llvm::SmallString<256 > path (*dsym);
2072
- llvm::Triple triple (ast_context->GetTriple ());
2073
2041
StringRef arch = llvm::Triple::getArchTypeName (triple.getArch ());
2074
2042
llvm::sys::path::append (path, " Contents" , " Resources" , " Swift" , arch);
2075
2043
bool exists = false ;
@@ -2281,11 +2249,10 @@ lldb::TypeSystemSP SwiftASTContext::CreateInstance(lldb::LanguageType language,
2281
2249
const bool use_all_compiler_flags =
2282
2250
!got_serialized_options || target.GetUseAllCompilerFlags ();
2283
2251
2284
- warmup_astcontexts ();
2285
2252
for (size_t mi = 0 ; mi != num_images; ++mi) {
2286
2253
std::vector<std::string> extra_clang_args;
2287
2254
ProcessModule (target.GetImages ().GetModuleAtIndex (mi), m_description,
2288
- use_all_compiler_flags, target, module_search_paths,
2255
+ use_all_compiler_flags, target, triple, module_search_paths,
2289
2256
framework_search_paths, extra_clang_args);
2290
2257
swift_ast_sp->AddExtraClangArgs (extra_clang_args);
2291
2258
}
@@ -5103,7 +5070,7 @@ void SwiftASTContextForExpressions::ModulesDidLoad(ModuleList &module_list) {
5103
5070
std::vector<std::string> extra_clang_args;
5104
5071
lldb::ModuleSP module_sp = module_list.GetModuleAtIndex (mi);
5105
5072
ProcessModule (module_sp, m_description, use_all_compiler_flags, *target_sp,
5106
- module_search_paths, framework_search_paths,
5073
+ GetTriple (), module_search_paths, framework_search_paths,
5107
5074
extra_clang_args);
5108
5075
// If the use-all-compiler-flags setting is enabled, the expression
5109
5076
// context is supposed to merge all search paths from all dylibs.
0 commit comments