Skip to content

Commit

Permalink
Remove the useNewMangling function
Browse files Browse the repository at this point in the history
NFC
  • Loading branch information
eeckstein committed Mar 17, 2017
1 parent 1625345 commit 0f87b5e
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 18 deletions.
8 changes: 0 additions & 8 deletions include/swift/Demangling/Demangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -491,14 +491,6 @@ NodePointer getUnspecialized(Node *node, NodeFactory &Factory);
std::string archetypeName(Node::IndexType index, Node::IndexType depth);

} // end namespace Demangle


/// Returns true if the new mangling scheme should be used.
///
/// TODO: remove this function when the old mangling is removed.
bool useNewMangling(Demangle::NodePointer Node);


} // end namespace swift

#endif // SWIFT_DEMANGLING_DEMANGLE_H
4 changes: 0 additions & 4 deletions lib/Basic/Mangler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ llvm::cl::opt<bool> NewManglingForTests(
"new-mangling-for-tests", llvm::cl::init(false),
llvm::cl::desc("Use new mangling for compiler tests"));

bool swift::useNewMangling(Demangle::NodePointer Node) {
return true;
}

#ifndef NDEBUG

llvm::cl::opt<bool> PrintSwiftManglingStats(
Expand Down
3 changes: 1 addition & 2 deletions lib/IDE/TypeReconstruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1587,8 +1587,7 @@ static void VisitNodeLocalDeclName(
Demangle::NodePointer &cur_node, VisitNodeResult &result,
const VisitNodeResult &generic_context) { // set by GenericType case
Demangle::NodePointer parent_node = nodes[nodes.size() - 2];
std::string remangledNode = Demangle::mangleNode(parent_node,
useNewMangling(parent_node));
std::string remangledNode = Demangle::mangleNode(parent_node);
TypeDecl *decl = result._module.lookupLocalType(remangledNode);
if (!decl)
result._error = stringWithFormat("unable to lookup local type %s",
Expand Down
4 changes: 2 additions & 2 deletions lib/RemoteAST/RemoteAST.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ RemoteASTTypeBuilder::createNominalTypeDecl(const Demangle::NodePointer &node) {
auto DC = findDeclContext(node);
if (!DC) {
return fail<NominalTypeDecl*>(Failure::CouldNotResolveTypeDecl,
Demangle::mangleNode(node, useNewMangling(node)));
Demangle::mangleNode(node));
}

auto decl = dyn_cast<NominalTypeDecl>(DC);
Expand Down Expand Up @@ -547,7 +547,7 @@ RemoteASTTypeBuilder::findDeclContext(const Demangle::NodePointer &node) {
if (!module) return nullptr;

// Look up the local type by its mangling.
auto mangledName = Demangle::mangleNode(node, useNewMangling(node));
auto mangledName = Demangle::mangleNode(node);
auto decl = module->lookupLocalType(mangledName);
if (!decl) return nullptr;

Expand Down
2 changes: 1 addition & 1 deletion tools/SourceKit/tools/sourcekitd/lib/API/Requests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ static std::string mangleSimpleClass(StringRef moduleName,
typeNode->addChild(classNode, Dem);
typeManglingNode->addChild(typeNode, Dem);
globalNode->addChild(typeManglingNode, Dem);
return mangleNode(globalNode, swift::useNewMangling(globalNode));
return mangleNode(globalNode);
}

static sourcekitd_response_t
Expand Down
2 changes: 1 addition & 1 deletion tools/swift-ide-test/swift-ide-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1588,7 +1588,7 @@ static int doPrintLocalTypes(const CompilerInvocation &InitInvok,
while (node->getKind() != NodeKind::LocalDeclName)
node = node->getChild(1); // local decl name

auto remangled = Demangle::mangleNode(typeNode, useNewMangling(typeNode));
auto remangled = Demangle::mangleNode(typeNode);

auto LTD = M->lookupLocalType(remangled);

Expand Down

0 comments on commit 0f87b5e

Please sign in to comment.