Skip to content

Commit 989b562

Browse files
committed
[lldb] Fix compile error in lldb
Signed-off-by: yronglin <[email protected]>
1 parent 20491ba commit 989b562

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "clang/Basic/Builtins.h"
1414
#include "clang/Basic/DarwinSDKInfo.h"
1515
#include "clang/Basic/DiagnosticIDs.h"
16+
#include "clang/Basic/IdentifierTable.h"
1617
#include "clang/Basic/SourceLocation.h"
1718
#include "clang/Basic/TargetInfo.h"
1819
#include "clang/Basic/Version.h"
@@ -135,8 +136,9 @@ class ClangExpressionParser::LLDBPreprocessorCallbacks : public PPCallbacks {
135136

136137
SourceModule module;
137138

138-
for (const std::pair<IdentifierInfo *, SourceLocation> &component : path)
139-
module.path.push_back(ConstString(component.first->getName()));
139+
for (const IdentifierLoc &component : path)
140+
module.path.push_back(
141+
ConstString(component.getIdentifierInfo()->getName()));
140142

141143
StreamString error_stream;
142144

lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "clang/Basic/Diagnostic.h"
1010
#include "clang/Basic/DiagnosticFrontend.h"
11+
#include "clang/Basic/IdentifierTable.h"
1112
#include "clang/Basic/TargetInfo.h"
1213
#include "clang/Frontend/CompilerInstance.h"
1314
#include "clang/Frontend/FrontendActions.h"
@@ -334,20 +335,18 @@ bool ClangModulesDeclVendorImpl::AddModule(const SourceModule &module,
334335
return false;
335336
}
336337

337-
llvm::SmallVector<std::pair<clang::IdentifierInfo *, clang::SourceLocation>,
338-
4>
339-
clang_path;
338+
llvm::SmallVector<clang::IdentifierLoc, 4> clang_path;
340339

341340
{
342341
clang::SourceManager &source_manager =
343342
m_compiler_instance->getASTContext().getSourceManager();
344343

345344
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(
349346
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()));
351350
}
352351
}
353352

@@ -629,8 +628,8 @@ ClangModulesDeclVendorImpl::DoGetModule(clang::ModuleIdPath path,
629628

630629
const bool is_inclusion_directive = false;
631630

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);
634633
}
635634

636635
static const char *ModuleImportBufferName = "LLDBModulesMemoryBuffer";

0 commit comments

Comments
 (0)