Plugins: fix resolution ambiguity in PDB plugin
A clang change caused the inclusion of `llvm::Type` and `lldb_private::Type` to be pulled into the global namespace due to the `using namespace llvm;` and `using namespace lldb_private;`. Explicitly qualify the `Type` to resolve the ambiguity. NFC llvm-svn: 312841
This commit is contained in:
parent
6807778e52
commit
6c13510c10
|
@ -95,11 +95,11 @@ lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(const PDBSymbol &type) {
|
||||||
|
|
||||||
m_ast.SetHasExternalStorage(clang_type.GetOpaqueQualType(), true);
|
m_ast.SetHasExternalStorage(clang_type.GetOpaqueQualType(), true);
|
||||||
|
|
||||||
return std::make_shared<Type>(type.getSymIndexId(), m_ast.GetSymbolFile(),
|
return std::make_shared<lldb_private::Type>(
|
||||||
ConstString(udt->getName()), udt->getLength(),
|
type.getSymIndexId(), m_ast.GetSymbolFile(),
|
||||||
nullptr, LLDB_INVALID_UID,
|
ConstString(udt->getName()), udt->getLength(), nullptr,
|
||||||
Type::eEncodingIsUID, decl, clang_type,
|
LLDB_INVALID_UID, lldb_private::Type::eEncodingIsUID, decl, clang_type,
|
||||||
Type::eResolveStateForward);
|
lldb_private::Type::eResolveStateForward);
|
||||||
} else if (auto enum_type = llvm::dyn_cast<PDBSymbolTypeEnum>(&type)) {
|
} else if (auto enum_type = llvm::dyn_cast<PDBSymbolTypeEnum>(&type)) {
|
||||||
std::string name = enum_type->getName();
|
std::string name = enum_type->getName();
|
||||||
lldb::Encoding encoding =
|
lldb::Encoding encoding =
|
||||||
|
@ -117,12 +117,12 @@ lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(const PDBSymbol &type) {
|
||||||
AddEnumValue(ast_enum, *enum_value);
|
AddEnumValue(ast_enum, *enum_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::make_shared<Type>(type.getSymIndexId(), m_ast.GetSymbolFile(),
|
return std::make_shared<lldb_private::Type>(
|
||||||
ConstString(name), bytes, nullptr,
|
type.getSymIndexId(), m_ast.GetSymbolFile(), ConstString(name), bytes,
|
||||||
LLDB_INVALID_UID, Type::eEncodingIsUID, decl,
|
nullptr, LLDB_INVALID_UID, lldb_private::Type::eEncodingIsUID, decl,
|
||||||
ast_enum, Type::eResolveStateFull);
|
ast_enum, lldb_private::Type::eResolveStateFull);
|
||||||
} else if (auto type_def = llvm::dyn_cast<PDBSymbolTypeTypedef>(&type)) {
|
} else if (auto type_def = llvm::dyn_cast<PDBSymbolTypeTypedef>(&type)) {
|
||||||
Type *target_type =
|
lldb_private::Type *target_type =
|
||||||
m_ast.GetSymbolFile()->ResolveTypeUID(type_def->getTypeId());
|
m_ast.GetSymbolFile()->ResolveTypeUID(type_def->getTypeId());
|
||||||
std::string name = type_def->getName();
|
std::string name = type_def->getName();
|
||||||
uint64_t bytes = type_def->getLength();
|
uint64_t bytes = type_def->getLength();
|
||||||
|
@ -133,16 +133,17 @@ lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(const PDBSymbol &type) {
|
||||||
m_ast.GetSymbolFile()->GetDeclContextForUID(target_type->GetID());
|
m_ast.GetSymbolFile()->GetDeclContextForUID(target_type->GetID());
|
||||||
CompilerType ast_typedef =
|
CompilerType ast_typedef =
|
||||||
m_ast.CreateTypedefType(target_ast_type, name.c_str(), target_decl_ctx);
|
m_ast.CreateTypedefType(target_ast_type, name.c_str(), target_decl_ctx);
|
||||||
return std::make_shared<Type>(
|
return std::make_shared<lldb_private::Type>(
|
||||||
type_def->getSymIndexId(), m_ast.GetSymbolFile(), ConstString(name),
|
type_def->getSymIndexId(), m_ast.GetSymbolFile(), ConstString(name),
|
||||||
bytes, nullptr, target_type->GetID(), Type::eEncodingIsTypedefUID, decl,
|
bytes, nullptr, target_type->GetID(),
|
||||||
ast_typedef, Type::eResolveStateFull);
|
lldb_private::Type::eEncodingIsTypedefUID, decl, ast_typedef,
|
||||||
|
lldb_private::Type::eResolveStateFull);
|
||||||
} else if (auto func_sig = llvm::dyn_cast<PDBSymbolTypeFunctionSig>(&type)) {
|
} else if (auto func_sig = llvm::dyn_cast<PDBSymbolTypeFunctionSig>(&type)) {
|
||||||
auto arg_enum = func_sig->getArguments();
|
auto arg_enum = func_sig->getArguments();
|
||||||
uint32_t num_args = arg_enum->getChildCount();
|
uint32_t num_args = arg_enum->getChildCount();
|
||||||
std::vector<CompilerType> arg_list(num_args);
|
std::vector<CompilerType> arg_list(num_args);
|
||||||
while (auto arg = arg_enum->getNext()) {
|
while (auto arg = arg_enum->getNext()) {
|
||||||
Type *arg_type =
|
lldb_private::Type *arg_type =
|
||||||
m_ast.GetSymbolFile()->ResolveTypeUID(arg->getSymIndexId());
|
m_ast.GetSymbolFile()->ResolveTypeUID(arg->getSymIndexId());
|
||||||
// If there's some error looking up one of the dependent types of this
|
// If there's some error looking up one of the dependent types of this
|
||||||
// function signature, bail.
|
// function signature, bail.
|
||||||
|
@ -152,7 +153,7 @@ lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(const PDBSymbol &type) {
|
||||||
arg_list.push_back(arg_ast_type);
|
arg_list.push_back(arg_ast_type);
|
||||||
}
|
}
|
||||||
auto pdb_return_type = func_sig->getReturnType();
|
auto pdb_return_type = func_sig->getReturnType();
|
||||||
Type *return_type =
|
lldb_private::Type *return_type =
|
||||||
m_ast.GetSymbolFile()->ResolveTypeUID(pdb_return_type->getSymIndexId());
|
m_ast.GetSymbolFile()->ResolveTypeUID(pdb_return_type->getSymIndexId());
|
||||||
// If there's some error looking up one of the dependent types of this
|
// If there's some error looking up one of the dependent types of this
|
||||||
// function signature, bail.
|
// function signature, bail.
|
||||||
|
@ -167,23 +168,24 @@ lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(const PDBSymbol &type) {
|
||||||
CompilerType func_sig_ast_type = m_ast.CreateFunctionType(
|
CompilerType func_sig_ast_type = m_ast.CreateFunctionType(
|
||||||
return_ast_type, &arg_list[0], num_args, false, type_quals);
|
return_ast_type, &arg_list[0], num_args, false, type_quals);
|
||||||
|
|
||||||
return std::make_shared<Type>(
|
return std::make_shared<lldb_private::Type>(
|
||||||
func_sig->getSymIndexId(), m_ast.GetSymbolFile(), ConstString(), 0,
|
func_sig->getSymIndexId(), m_ast.GetSymbolFile(), ConstString(), 0,
|
||||||
nullptr, LLDB_INVALID_UID, Type::eEncodingIsUID, decl,
|
nullptr, LLDB_INVALID_UID, lldb_private::Type::eEncodingIsUID, decl,
|
||||||
func_sig_ast_type, Type::eResolveStateFull);
|
func_sig_ast_type, lldb_private::Type::eResolveStateFull);
|
||||||
} else if (auto array_type = llvm::dyn_cast<PDBSymbolTypeArray>(&type)) {
|
} else if (auto array_type = llvm::dyn_cast<PDBSymbolTypeArray>(&type)) {
|
||||||
uint32_t num_elements = array_type->getCount();
|
uint32_t num_elements = array_type->getCount();
|
||||||
uint32_t element_uid = array_type->getElementType()->getSymIndexId();
|
uint32_t element_uid = array_type->getElementType()->getSymIndexId();
|
||||||
uint32_t bytes = array_type->getLength();
|
uint32_t bytes = array_type->getLength();
|
||||||
|
|
||||||
Type *element_type = m_ast.GetSymbolFile()->ResolveTypeUID(element_uid);
|
lldb_private::Type *element_type =
|
||||||
|
m_ast.GetSymbolFile()->ResolveTypeUID(element_uid);
|
||||||
CompilerType element_ast_type = element_type->GetFullCompilerType();
|
CompilerType element_ast_type = element_type->GetFullCompilerType();
|
||||||
CompilerType array_ast_type =
|
CompilerType array_ast_type =
|
||||||
m_ast.CreateArrayType(element_ast_type, num_elements, false);
|
m_ast.CreateArrayType(element_ast_type, num_elements, false);
|
||||||
return std::make_shared<Type>(
|
return std::make_shared<lldb_private::Type>(
|
||||||
array_type->getSymIndexId(), m_ast.GetSymbolFile(), ConstString(),
|
array_type->getSymIndexId(), m_ast.GetSymbolFile(), ConstString(),
|
||||||
bytes, nullptr, LLDB_INVALID_UID, Type::eEncodingIsUID, decl,
|
bytes, nullptr, LLDB_INVALID_UID, lldb_private::Type::eEncodingIsUID,
|
||||||
array_ast_type, Type::eResolveStateFull);
|
decl, array_ast_type, lldb_private::Type::eResolveStateFull);
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue