Add ASTContext to CompilerInstance.

llvm-svn: 87095
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index e1ae63c..0829ce3 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -8,6 +8,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "clang/Frontend/CompilerInstance.h"
+#include "clang/AST/ASTContext.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/FileManager.h"
 #include "clang/Basic/SourceManager.h"
@@ -152,3 +153,14 @@
 
   return PP;
 }
+
+// ASTContext
+
+void CompilerInstance::createASTContext() {
+  Preprocessor &PP = getPreprocessor();
+  Context.reset(new ASTContext(getLangOpts(), PP.getSourceManager(),
+                               getTarget(), PP.getIdentifierTable(),
+                               PP.getSelectorTable(), PP.getBuiltinInfo(),
+                               /*FreeMemory=*/ !getFrontendOpts().DisableFree,
+                               /*size_reserve=*/ 0));
+}