|
8 | 8 |
|
9 | 9 | #include "clang/Basic/Diagnostic.h"
|
10 | 10 | #include "clang/Basic/DiagnosticFrontend.h"
|
| 11 | +#include "clang/Basic/IdentifierTable.h" |
11 | 12 | #include "clang/Basic/TargetInfo.h"
|
12 | 13 | #include "clang/Frontend/CompilerInstance.h"
|
13 | 14 | #include "clang/Frontend/FrontendActions.h"
|
@@ -334,20 +335,18 @@ bool ClangModulesDeclVendorImpl::AddModule(const SourceModule &module,
|
334 | 335 | return false;
|
335 | 336 | }
|
336 | 337 |
|
337 |
| - llvm::SmallVector<std::pair<clang::IdentifierInfo *, clang::SourceLocation>, |
338 |
| - 4> |
339 |
| - clang_path; |
| 338 | + llvm::SmallVector<clang::IdentifierLoc, 4> clang_path; |
340 | 339 |
|
341 | 340 | {
|
342 | 341 | clang::SourceManager &source_manager =
|
343 | 342 | m_compiler_instance->getASTContext().getSourceManager();
|
344 | 343 |
|
345 | 344 | for (ConstString path_component : module.path) {
|
346 |
| - clang_path.push_back(std::make_pair( |
347 |
| - &m_compiler_instance->getASTContext().Idents.get( |
348 |
| - path_component.GetStringRef()), |
| 345 | + clang_path.emplace_back( |
349 | 346 | source_manager.getLocForStartOfFile(source_manager.getMainFileID())
|
350 |
| - .getLocWithOffset(m_source_location_index++))); |
| 347 | + .getLocWithOffset(m_source_location_index++), |
| 348 | + &m_compiler_instance->getASTContext().Idents.get( |
| 349 | + path_component.GetStringRef())); |
351 | 350 | }
|
352 | 351 | }
|
353 | 352 |
|
@@ -629,8 +628,8 @@ ClangModulesDeclVendorImpl::DoGetModule(clang::ModuleIdPath path,
|
629 | 628 |
|
630 | 629 | const bool is_inclusion_directive = false;
|
631 | 630 |
|
632 |
| - return m_compiler_instance->loadModule(path.front().second, path, visibility, |
633 |
| - is_inclusion_directive); |
| 631 | + return m_compiler_instance->loadModule(path.front().getLoc(), path, |
| 632 | + visibility, is_inclusion_directive); |
634 | 633 | }
|
635 | 634 |
|
636 | 635 | static const char *ModuleImportBufferName = "LLDBModulesMemoryBuffer";
|
|
0 commit comments