Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
Show First 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | AnyScopesHaveTemplateParams(llvm::ArrayRef<llvm::ms_demangle::Node *> scopes) { | ||||
for (llvm::ms_demangle::Node *n : scopes) { | for (llvm::ms_demangle::Node *n : scopes) { | ||||
auto *idn = static_cast<llvm::ms_demangle::IdentifierNode *>(n); | auto *idn = static_cast<llvm::ms_demangle::IdentifierNode *>(n); | ||||
if (idn->TemplateParams) | if (idn->TemplateParams) | ||||
return true; | return true; | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
static ClangASTContext &GetClangASTContext(ObjectFile &obj) { | |||||
TypeSystem *ts = | |||||
obj.GetModule()->GetTypeSystemForLanguage(lldb::eLanguageTypeC_plus_plus); | |||||
lldbassert(ts); | |||||
return static_cast<ClangASTContext &>(*ts); | |||||
} | |||||
static llvm::Optional<clang::CallingConv> | static llvm::Optional<clang::CallingConv> | ||||
TranslateCallingConvention(llvm::codeview::CallingConvention conv) { | TranslateCallingConvention(llvm::codeview::CallingConvention conv) { | ||||
using CC = llvm::codeview::CallingConvention; | using CC = llvm::codeview::CallingConvention; | ||||
switch (conv) { | switch (conv) { | ||||
case CC::NearC: | case CC::NearC: | ||||
case CC::FarC: | case CC::FarC: | ||||
return clang::CallingConv::CC_C; | return clang::CallingConv::CC_C; | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | GetNestedTagDefinition(const NestedTypeRecord &Record, | ||||
return std::move(child); | return std::move(child); | ||||
} | } | ||||
static bool IsAnonymousNamespaceName(llvm::StringRef name) { | static bool IsAnonymousNamespaceName(llvm::StringRef name) { | ||||
return name == "`anonymous namespace'" || name == "`anonymous-namespace'"; | return name == "`anonymous namespace'" || name == "`anonymous-namespace'"; | ||||
} | } | ||||
PdbAstBuilder::PdbAstBuilder(ObjectFile &obj, PdbIndex &index) | PdbAstBuilder::PdbAstBuilder(ObjectFile &obj, PdbIndex &index, ClangASTContext &clang) | ||||
: m_index(index), m_clang(GetClangASTContext(obj)) { | : m_index(index), m_clang(clang) { | ||||
BuildParentMap(); | BuildParentMap(); | ||||
} | } | ||||
lldb_private::CompilerDeclContext PdbAstBuilder::GetTranslationUnitDecl() { | lldb_private::CompilerDeclContext PdbAstBuilder::GetTranslationUnitDecl() { | ||||
return ToCompilerDeclContext(*m_clang.GetTranslationUnitDecl()); | return ToCompilerDeclContext(*m_clang.GetTranslationUnitDecl()); | ||||
} | } | ||||
std::pair<clang::DeclContext *, std::string> | std::pair<clang::DeclContext *, std::string> | ||||
▲ Show 20 Lines • Show All 1,147 Lines • Show Last 20 Lines |