summaryrefslogtreecommitdiffstats
path: root/include/clang/Lex/PPCallbacks.h
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2014-09-10 04:53:53 +0000
committerCraig Topper <craig.topper@gmail.com>2014-09-10 04:53:53 +0000
commitc6da4d1d6ce3e453deb29972f8dc3807500bbd1d (patch)
tree0a3a5772653ac96d99aabc2c107ce3958c20ec9a /include/clang/Lex/PPCallbacks.h
parent98045aa38c5f99972a98387469f2fcfcc28ee5e9 (diff)
Unique_ptrify PPCallbacks ownership.
Unique_ptr creation stil needs to be moved earlier at some of the call sites. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217474 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/PPCallbacks.h')
-rw-r--r--include/clang/Lex/PPCallbacks.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/include/clang/Lex/PPCallbacks.h b/include/clang/Lex/PPCallbacks.h
index 7f1ea34a46..056c58aa33 100644
--- a/include/clang/Lex/PPCallbacks.h
+++ b/include/clang/Lex/PPCallbacks.h
@@ -322,15 +322,12 @@ public:
/// \brief Simple wrapper class for chaining callbacks.
class PPChainedCallbacks : public PPCallbacks {
virtual void anchor();
- PPCallbacks *First, *Second;
+ std::unique_ptr<PPCallbacks> First, Second;
public:
- PPChainedCallbacks(PPCallbacks *_First, PPCallbacks *_Second)
- : First(_First), Second(_Second) {}
- ~PPChainedCallbacks() {
- delete Second;
- delete First;
- }
+ PPChainedCallbacks(std::unique_ptr<PPCallbacks> _First,
+ std::unique_ptr<PPCallbacks> _Second)
+ : First(std::move(_First)), Second(std::move(_Second)) {}
void FileChanged(SourceLocation Loc, FileChangeReason Reason,
SrcMgr::CharacteristicKind FileType,