aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-09-15 17:30:56 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-09-15 17:30:56 +0000
commit11f8a943bfafd445f4fbd3e126b0f88f7d039f47 (patch)
tree339e1ce0dad5e63154f74fc95f0450eab7fdc233 /clang/lib/CodeGen/CodeGenModule.cpp
parent8f45c9cc6232e5b841bc92b7f2ea9a792574c317 (diff)
downloadllvm-11f8a943bfafd445f4fbd3e126b0f88f7d039f47.zip
llvm-11f8a943bfafd445f4fbd3e126b0f88f7d039f47.tar.gz
llvm-11f8a943bfafd445f4fbd3e126b0f88f7d039f47.tar.bz2
Fix memory leak of raw_ostreams in LogDiagnosticPrinter handling.
This is another case of conditional ownership (in this case a raw reference, plus a boolean to indicate whether the referenced object should be deleted). While it's not ideal, I prefer to make the ownership explicit with a unique_ptr than using a boolean flag (though it does make the reference and the unique_ptr redundant in the sense that they both refer to the same memory). At some point we might write a reusable conditional ownership pointer (a stateful custom deleter for a unique_ptr may be appropriate). Based on a patch from a patch by Anton Yartsev. llvm-svn: 217791
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions