[lldb][NFC] Remove GetASTContext call in ClangPersistentVariables

We try to build a CompilerType from the persistent decls so we need
a ClangASTContext. With this patch the ClangPersistentVariables store
the associated ClangASTContext of the persistent decls (which is
always the scratch ClangASTContext) and no longer call GetASTContext
to map back from clang::ASTContext to ClangASTContext.
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
index 24dd705..7423f62 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
@@ -68,38 +68,36 @@
 ClangPersistentVariables::GetCompilerTypeFromPersistentDecl(
     ConstString type_name) {
   CompilerType compiler_type;
-  if (clang::TypeDecl *tdecl = llvm::dyn_cast_or_null<clang::TypeDecl>(
-          GetPersistentDecl(type_name))) {
-    compiler_type.SetCompilerType(
-        ClangASTContext::GetASTContext(&tdecl->getASTContext()),
-        reinterpret_cast<lldb::opaque_compiler_type_t>(
-            const_cast<clang::Type *>(tdecl->getTypeForDecl())));
-    return compiler_type;
+
+  PersistentDecl p = m_persistent_decls.lookup(type_name.GetCString());
+
+  if (p.m_decl == nullptr)
+    return llvm::None;
+
+  if (clang::TypeDecl *tdecl = llvm::dyn_cast<clang::TypeDecl>(p.m_decl)) {
+    opaque_compiler_type_t t = static_cast<opaque_compiler_type_t>(
+        const_cast<clang::Type *>(tdecl->getTypeForDecl()));
+    return CompilerType(p.m_context, t);
   }
   return llvm::None;
 }
 
 void ClangPersistentVariables::RegisterPersistentDecl(ConstString name,
-                                                      clang::NamedDecl *decl) {
-  m_persistent_decls.insert(
-      std::pair<const char *, clang::NamedDecl *>(name.GetCString(), decl));
+                                                      clang::NamedDecl *decl,
+                                                      ClangASTContext *ctx) {
+  PersistentDecl p = {decl, ctx};
+  m_persistent_decls.insert(std::make_pair(name.GetCString(), p));
 
   if (clang::EnumDecl *enum_decl = llvm::dyn_cast<clang::EnumDecl>(decl)) {
     for (clang::EnumConstantDecl *enumerator_decl : enum_decl->enumerators()) {
-      m_persistent_decls.insert(std::pair<const char *, clang::NamedDecl *>(
-          ConstString(enumerator_decl->getNameAsString()).GetCString(),
-          enumerator_decl));
+      p = {enumerator_decl, ctx};
+      m_persistent_decls.insert(std::make_pair(
+          ConstString(enumerator_decl->getNameAsString()).GetCString(), p));
     }
   }
 }
 
 clang::NamedDecl *
 ClangPersistentVariables::GetPersistentDecl(ConstString name) {
-  PersistentDeclMap::const_iterator i =
-      m_persistent_decls.find(name.GetCString());
-
-  if (i == m_persistent_decls.end())
-    return nullptr;
-  else
-    return i->second;
+  return m_persistent_decls.lookup(name.GetCString()).m_decl;
 }