summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Lex
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
commitb8a705305562a8312e6d63ced9c8237d9fae21f3 (patch)
tree114deebfd15c4e4b9defd7aa4ae4b9b41bbe744e /clang/unittests/Lex
parent7ff15929606a9004dba0c9a18371aa5438b927d2 (diff)
downloadbcm5719-llvm-b8a705305562a8312e6d63ced9c8237d9fae21f3.tar.gz
bcm5719-llvm-b8a705305562a8312e6d63ced9c8237d9fae21f3.zip
Unique_ptrify PPCallbacks ownership.
Unique_ptr creation stil needs to be moved earlier at some of the call sites. llvm-svn: 217474
Diffstat (limited to 'clang/unittests/Lex')
-rw-r--r--clang/unittests/Lex/PPCallbacksTest.cpp4
-rw-r--r--clang/unittests/Lex/PPConditionalDirectiveRecordTest.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/clang/unittests/Lex/PPCallbacksTest.cpp b/clang/unittests/Lex/PPCallbacksTest.cpp
index f020206470a..af046c4e354 100644
--- a/clang/unittests/Lex/PPCallbacksTest.cpp
+++ b/clang/unittests/Lex/PPCallbacksTest.cpp
@@ -176,7 +176,7 @@ protected:
/*OwnsHeaderSearch =*/false);
PP.Initialize(*Target);
InclusionDirectiveCallbacks* Callbacks = new InclusionDirectiveCallbacks;
- PP.addPPCallbacks(Callbacks); // Takes ownership.
+ PP.addPPCallbacks(std::unique_ptr<PPCallbacks>(Callbacks));
// Lex source text.
PP.EnterMainSourceFile();
@@ -222,7 +222,7 @@ protected:
Sema S(PP, Context, Consumer);
Parser P(PP, S, false);
PragmaOpenCLExtensionCallbacks* Callbacks = new PragmaOpenCLExtensionCallbacks;
- PP.addPPCallbacks(Callbacks); // Takes ownership.
+ PP.addPPCallbacks(std::unique_ptr<PPCallbacks>(Callbacks));
// Lex source text.
PP.EnterMainSourceFile();
diff --git a/clang/unittests/Lex/PPConditionalDirectiveRecordTest.cpp b/clang/unittests/Lex/PPConditionalDirectiveRecordTest.cpp
index 033b3545af3..946cb88b981 100644
--- a/clang/unittests/Lex/PPConditionalDirectiveRecordTest.cpp
+++ b/clang/unittests/Lex/PPConditionalDirectiveRecordTest.cpp
@@ -103,7 +103,7 @@ TEST_F(PPConditionalDirectiveRecordTest, PPRecAPI) {
PP.Initialize(*Target);
PPConditionalDirectiveRecord *
PPRec = new PPConditionalDirectiveRecord(SourceMgr);
- PP.addPPCallbacks(PPRec);
+ PP.addPPCallbacks(std::unique_ptr<PPCallbacks>(PPRec));
PP.EnterMainSourceFile();
std::vector<Token> toks;
OpenPOWER on IntegriCloud