Don't use SmallVector in MetadataReader.

Not all of its clients link in the necessary LLVM support libraries.
This commit is contained in:
Joe Groff
2018-01-30 12:26:18 -08:00
parent 75dcf27896
commit f35cb9d35b

View File

@@ -1028,7 +1028,7 @@ private:
buildNominalTypeDecl(ContextDescriptorRef descriptor) {
// Build the demangling tree from the context tree.
Demangle::NodeFactory nodeFactory;
SmallVector<std::pair<Demangle::Node::Kind, std::string>, 4>
std::vector<std::pair<Demangle::Node::Kind, std::string>>
nameComponents;
ContextDescriptorRef parent = descriptor;
@@ -1103,7 +1103,8 @@ private:
return BuiltNominalTypeDecl();
if (nameComponents.back().first != Node::Kind::Module)
return BuiltNominalTypeDecl();
auto moduleInfo = nameComponents.pop_back_val();
auto moduleInfo = std::move(nameComponents.back());
nameComponents.pop_back();
auto demangling =
nodeFactory.createNode(Node::Kind::Module, moduleInfo.second);
for (auto &component : reversed(nameComponents)) {