ASTUnit: Fix initialization of OnlyLocalDecls variable, and honor UseBumpAllocator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90348 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp
index 87d0d7d..6cbcb46 100644
--- a/lib/Frontend/ASTUnit.cpp
+++ b/lib/Frontend/ASTUnit.cpp
@@ -199,8 +199,7 @@
ASTUnit *ASTUnit::LoadFromCompilerInvocation(const CompilerInvocation &CI,
Diagnostic &Diags,
- bool OnlyLocalDecls,
- bool UseBumpAllocator) {
+ bool OnlyLocalDecls) {
// Create the compiler instance to use for building the AST.
CompilerInstance Clang;
llvm::OwningPtr<ASTUnit> AST;
@@ -233,6 +232,7 @@
// FIXME: Use the provided diagnostic client.
AST.reset(new ASTUnit());
+ AST->OnlyLocalDecls = OnlyLocalDecls;
AST->OriginalSourceFile = Clang.getFrontendOpts().Inputs[0].second;
// Create a file manager object to provide access to and cache the filesystem.
@@ -318,6 +318,6 @@
(const char**) CCArgs.data()+CCArgs.size(),
Argv0, MainAddr, Diags);
- return LoadFromCompilerInvocation(CI, Diags, OnlyLocalDecls,
- UseBumpAllocator);
+ CI.getFrontendOpts().DisableFree = UseBumpAllocator;
+ return LoadFromCompilerInvocation(CI, Diags, OnlyLocalDecls);
}