@@ -379,6 +379,14 @@ class Context {
379
379
// / function symbol.
380
380
bool hasSwiftCallingConvention (llvm::StringRef MangledName);
381
381
382
+ // / Demangle the given symbol and return the module name of the symbol.
383
+ // /
384
+ // / \param MangledName The mangled symbol string, which start a mangling
385
+ // / prefix: _T, _T0, $S, _$S.
386
+ // /
387
+ // / \returns The module name.
388
+ std::string getModuleName (llvm::StringRef mangledName);
389
+
382
390
// / Deallocates all nodes.
383
391
// /
384
392
// / The memory which is used for nodes is not freed but recycled for the next
@@ -578,6 +586,14 @@ bool isSpecialized(Node *node);
578
586
NodePointer getUnspecialized (Node *node, NodeFactory &Factory);
579
587
std::string archetypeName (Node::IndexType index, Node::IndexType depth);
580
588
589
+ // / Returns true if the node \p kind refers to a context node, e.g. a nominal
590
+ // / type or a function.
591
+ bool isContext (Node::Kind kind);
592
+
593
+ // / Returns true if the node \p kind refers to a node which is placed before a
594
+ // / function node, e.g. a specialization attribute.
595
+ bool isFunctionAttr (Node::Kind kind);
596
+
581
597
// / Form a StringRef around the mangled name starting at base, if the name may
582
598
// / contain symbolic references.
583
599
llvm::StringRef makeSymbolicMangledNameStringRef (const char *base);
0 commit comments