diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-10-17 00:34:24 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-10-17 00:34:24 +0000 |
commit | 5cf48766d626ff6b223acc9d4b7e415ca8480836 (patch) | |
tree | c8dae4f26d5497c34a098a83f3c3867a4ef12725 /lib/Frontend/ASTUnit.cpp | |
parent | 61d60ee6aa0a5ded0ddcf48679673b37506a1895 (diff) |
Add 'UseBumpPtrAllocator' flag to ASTUnit::LoadFromPCHFile() to cause the created ASTContext to use
its own BumpPtrAllocator to allocate ASTs.
Change clang_createTranslationUnit (CIndex) to pass 'UseBumpPtrAllocator = true' to
ASTUnit::LoadFromPCHFile().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84296 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/ASTUnit.cpp')
-rw-r--r-- | lib/Frontend/ASTUnit.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index 15002385a8..7ee6648699 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -95,7 +95,8 @@ ASTUnit *ASTUnit::LoadFromPCHFile(const std::string &Filename, Diagnostic &Diags, FileManager &FileMgr, std::string *ErrMsg, - bool OnlyLocalDecls) { + bool OnlyLocalDecls, + bool UseBumpAllocator) { llvm::OwningPtr<ASTUnit> AST(new ASTUnit(Diags)); AST->OnlyLocalDecls = OnlyLocalDecls; AST->HeaderInfo.reset(new HeaderSearch(FileMgr)); @@ -146,7 +147,7 @@ ASTUnit *ASTUnit::LoadFromPCHFile(const std::string &Filename, PP.getIdentifierTable(), PP.getSelectorTable(), PP.getBuiltinInfo(), - /* FreeMemory = */ true, + /* FreeMemory = */ !UseBumpAllocator, /* size_reserve = */0)); ASTContext &Context = *AST->Ctx.get(); |