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
This commit is contained in:
Daniel Dunbar 2009-12-02 21:47:32 +00:00
Родитель 7facf8408f
Коммит 68ea2ac7fd
2 изменённых файлов: 5 добавлений и 6 удалений

Просмотреть файл

@ -122,8 +122,7 @@ public:
// shouldn't need to specify them at construction time.
static ASTUnit *LoadFromCompilerInvocation(const CompilerInvocation &CI,
Diagnostic &Diags,
bool OnlyLocalDecls = false,
bool UseBumpAllocator = false);
bool OnlyLocalDecls = false);
/// LoadFromCommandLine - Create an ASTUnit from a vector of command line
/// arguments, which must specify exactly one source file.

Просмотреть файл

@ -199,8 +199,7 @@ public:
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 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocation(const CompilerInvocation &CI,
// 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 @@ ASTUnit *ASTUnit::LoadFromCommandLine(const char **ArgBegin,
(const char**) CCArgs.data()+CCArgs.size(),
Argv0, MainAddr, Diags);
return LoadFromCompilerInvocation(CI, Diags, OnlyLocalDecls,
UseBumpAllocator);
CI.getFrontendOpts().DisableFree = UseBumpAllocator;
return LoadFromCompilerInvocation(CI, Diags, OnlyLocalDecls);
}