diff options
author | David Blaikie <dblaikie@gmail.com> | 2017-01-06 19:49:01 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2017-01-06 19:49:01 +0000 |
commit | ea4395ebcd37905487b7a978db2f460bc576a5d1 (patch) | |
tree | 92303c3c362a7eee408868cfa554f15683b0c02d /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 9cbcc5ff0b325ef2c0638e6c5c365b35a1e4f087 (diff) | |
download | bcm5719-llvm-ea4395ebcd37905487b7a978db2f460bc576a5d1.tar.gz bcm5719-llvm-ea4395ebcd37905487b7a978db2f460bc576a5d1.zip |
Reapply "IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and CodeCompleteConsumer"
Aleksey Shlypanikov pointed out my mistake in migrating an explicit
unique_ptr to auto - I was expecting the function returned a unique_ptr,
but instead it returned a raw pointer - introducing a leak.
Thanks Aleksey!
This reapplies r291184, reverted in r291249.
llvm-svn: 291270
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 86d58a24317..93bbcc42da1 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -60,12 +60,11 @@ CompilerInvocationBase::CompilerInvocationBase() PreprocessorOpts(new PreprocessorOptions()) {} CompilerInvocationBase::CompilerInvocationBase(const CompilerInvocationBase &X) - : RefCountedBase<CompilerInvocation>(), - LangOpts(new LangOptions(*X.getLangOpts())), - TargetOpts(new TargetOptions(X.getTargetOpts())), - DiagnosticOpts(new DiagnosticOptions(X.getDiagnosticOpts())), - HeaderSearchOpts(new HeaderSearchOptions(X.getHeaderSearchOpts())), - PreprocessorOpts(new PreprocessorOptions(X.getPreprocessorOpts())) {} + : LangOpts(new LangOptions(*X.getLangOpts())), + TargetOpts(new TargetOptions(X.getTargetOpts())), + DiagnosticOpts(new DiagnosticOptions(X.getDiagnosticOpts())), + HeaderSearchOpts(new HeaderSearchOptions(X.getHeaderSearchOpts())), + PreprocessorOpts(new PreprocessorOptions(X.getPreprocessorOpts())) {} CompilerInvocationBase::~CompilerInvocationBase() {} |