diff options
| author | 2017-01-24 08:32:59 +0000 | |
|---|---|---|
| committer | 2017-01-24 08:32:59 +0000 | |
| commit | 53d771aafdbe5b919f264f53cba3788e2c4cffd2 (patch) | |
| tree | 7eca39498be0ff1e3a6daf583cd9ca5886bb2636 /gnu/llvm/tools/clang/lib/Analysis/AnalysisDeclContext.cpp | |
| parent | In preparation of compiling our kernels with -ffreestanding, explicitly map (diff) | |
| download | wireguard-openbsd-53d771aafdbe5b919f264f53cba3788e2c4cffd2.tar.xz wireguard-openbsd-53d771aafdbe5b919f264f53cba3788e2c4cffd2.zip | |
Import LLVM 4.0.0 rc1 including clang and lld to help the current
development effort on OpenBSD/arm64.
Diffstat (limited to 'gnu/llvm/tools/clang/lib/Analysis/AnalysisDeclContext.cpp')
| -rw-r--r-- | gnu/llvm/tools/clang/lib/Analysis/AnalysisDeclContext.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/gnu/llvm/tools/clang/lib/Analysis/AnalysisDeclContext.cpp b/gnu/llvm/tools/clang/lib/Analysis/AnalysisDeclContext.cpp index 6bbe8f86d48..6b58916162f 100644 --- a/gnu/llvm/tools/clang/lib/Analysis/AnalysisDeclContext.cpp +++ b/gnu/llvm/tools/clang/lib/Analysis/AnalysisDeclContext.cpp @@ -81,9 +81,7 @@ AnalysisDeclContextManager::AnalysisDeclContextManager(bool useUnoptimizedCFG, cfgBuildOptions.AddCXXNewAllocator = addCXXNewAllocator; } -void AnalysisDeclContextManager::clear() { - llvm::DeleteContainerSeconds(Contexts); -} +void AnalysisDeclContextManager::clear() { Contexts.clear(); } static BodyFarm &getBodyFarm(ASTContext &C, CodeInjector *injector = nullptr) { static BodyFarm *BF = new BodyFarm(C, injector); @@ -307,10 +305,10 @@ AnalysisDeclContext *AnalysisDeclContextManager::getContext(const Decl *D) { D = FD; } - AnalysisDeclContext *&AC = Contexts[D]; + std::unique_ptr<AnalysisDeclContext> &AC = Contexts[D]; if (!AC) - AC = new AnalysisDeclContext(this, D, cfgBuildOptions); - return AC; + AC = llvm::make_unique<AnalysisDeclContext>(this, D, cfgBuildOptions); + return AC.get(); } const StackFrameContext * @@ -606,9 +604,7 @@ AnalysisDeclContext::~AnalysisDeclContext() { } } -AnalysisDeclContextManager::~AnalysisDeclContextManager() { - llvm::DeleteContainerSeconds(Contexts); -} +AnalysisDeclContextManager::~AnalysisDeclContextManager() {} LocationContext::~LocationContext() {} |
