Improve instantiation of UnresolvedUsingDecls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80434 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index f527657..eebb11d 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -242,6 +242,24 @@
InstantiatedFromStaticDataMember[Inst] = Tmpl;
}
+UnresolvedUsingDecl *
+ASTContext::getInstantiatedFromUnresolvedUsingDecl(UsingDecl *UUD) {
+ llvm::DenseMap<UsingDecl *, UnresolvedUsingDecl *>::iterator Pos
+ = InstantiatedFromUnresolvedUsingDecl.find(UUD);
+ if (Pos == InstantiatedFromUnresolvedUsingDecl.end())
+ return 0;
+
+ return Pos->second;
+}
+
+void
+ASTContext::setInstantiatedFromUnresolvedUsingDecl(UsingDecl *UD,
+ UnresolvedUsingDecl *UUD) {
+ assert(!InstantiatedFromUnresolvedUsingDecl[UD] &&
+ "Already noted what using decl what instantiated from");
+ InstantiatedFromUnresolvedUsingDecl[UD] = UUD;
+}
+
namespace {
class BeforeInTranslationUnit
: std::binary_function<SourceRange, SourceRange, bool> {