Added functionality to dematerialize values that were
used by the JIT compiled expression, including the
result of the expression.

Also added a new class, ASTType, which encapsulates an
opaque Clang type and its associated AST context.

Refactored ClangExpressionDeclMap to use ASTTypes,
significantly reducing the possibility of mixups of
types from different AST contexts.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@108965 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/IRForTarget.cpp b/source/Expression/IRForTarget.cpp
index 065c760..31f3343 100644
--- a/source/Expression/IRForTarget.cpp
+++ b/source/Expression/IRForTarget.cpp
@@ -93,12 +93,18 @@
         std::string name = named_decl->getName().str();
         
         void *qual_type = NULL;
+        clang::ASTContext *ast_context = NULL;
         
         if (clang::ValueDecl *value_decl = dyn_cast<clang::ValueDecl>(named_decl))
+        {
             qual_type = value_decl->getType().getAsOpaquePtr();
+            ast_context = &value_decl->getASTContext();
+        }
         else
+        {
             return false;
-        
+        }
+            
         const llvm::Type *value_type = global_variable->getType();
         
         size_t value_size = m_target_data->getTypeStoreSize(value_type);
@@ -108,6 +114,7 @@
                                                 named_decl,
                                                 name,
                                                 qual_type,
+                                                ast_context,
                                                 value_size, 
                                                 value_alignment))
             return false;