diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-06 20:13:35 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-06 20:13:35 +0000 |
commit | 6694ed095d6b27a2c92ec4fd63664fcd88a05749 (patch) | |
tree | 0633c29bd8350e306f3a24a30f3f6045efd35420 /unittests/Frontend/FrontendActionTest.cpp | |
parent | d5dc75c5cf109efe52b1da32ec44a667389a0f0a (diff) |
Notes
Diffstat (limited to 'unittests/Frontend/FrontendActionTest.cpp')
-rw-r--r-- | unittests/Frontend/FrontendActionTest.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/unittests/Frontend/FrontendActionTest.cpp b/unittests/Frontend/FrontendActionTest.cpp index c3e6adb6324d..dd6be5fd4b98 100644 --- a/unittests/Frontend/FrontendActionTest.cpp +++ b/unittests/Frontend/FrontendActionTest.cpp @@ -79,7 +79,7 @@ private: }; TEST(ASTFrontendAction, Sanity) { - CompilerInvocation *invocation = new CompilerInvocation; + auto invocation = std::make_shared<CompilerInvocation>(); invocation->getPreprocessorOpts().addRemappedFile( "test.cc", MemoryBuffer::getMemBuffer("int main() { float x; }").release()); @@ -88,7 +88,7 @@ TEST(ASTFrontendAction, Sanity) { invocation->getFrontendOpts().ProgramAction = frontend::ParseSyntaxOnly; invocation->getTargetOpts().Triple = "i386-unknown-linux-gnu"; CompilerInstance compiler; - compiler.setInvocation(invocation); + compiler.setInvocation(std::move(invocation)); compiler.createDiagnostics(); TestASTFrontendAction test_action; @@ -99,7 +99,7 @@ TEST(ASTFrontendAction, Sanity) { } TEST(ASTFrontendAction, IncrementalParsing) { - CompilerInvocation *invocation = new CompilerInvocation; + auto invocation = std::make_shared<CompilerInvocation>(); invocation->getPreprocessorOpts().addRemappedFile( "test.cc", MemoryBuffer::getMemBuffer("int main() { float x; }").release()); @@ -108,7 +108,7 @@ TEST(ASTFrontendAction, IncrementalParsing) { invocation->getFrontendOpts().ProgramAction = frontend::ParseSyntaxOnly; invocation->getTargetOpts().Triple = "i386-unknown-linux-gnu"; CompilerInstance compiler; - compiler.setInvocation(invocation); + compiler.setInvocation(std::move(invocation)); compiler.createDiagnostics(); TestASTFrontendAction test_action(/*enableIncrementalProcessing=*/true); @@ -119,7 +119,7 @@ TEST(ASTFrontendAction, IncrementalParsing) { } TEST(ASTFrontendAction, LateTemplateIncrementalParsing) { - CompilerInvocation *invocation = new CompilerInvocation; + auto invocation = std::make_shared<CompilerInvocation>(); invocation->getLangOpts()->CPlusPlus = true; invocation->getLangOpts()->DelayedTemplateParsing = true; invocation->getPreprocessorOpts().addRemappedFile( @@ -135,7 +135,7 @@ TEST(ASTFrontendAction, LateTemplateIncrementalParsing) { invocation->getFrontendOpts().ProgramAction = frontend::ParseSyntaxOnly; invocation->getTargetOpts().Triple = "i386-unknown-linux-gnu"; CompilerInstance compiler; - compiler.setInvocation(invocation); + compiler.setInvocation(std::move(invocation)); compiler.createDiagnostics(); TestASTFrontendAction test_action(/*enableIncrementalProcessing=*/true, @@ -172,7 +172,7 @@ public: }; TEST(PreprocessorFrontendAction, EndSourceFile) { - CompilerInvocation *Invocation = new CompilerInvocation; + auto Invocation = std::make_shared<CompilerInvocation>(); Invocation->getPreprocessorOpts().addRemappedFile( "test.cc", MemoryBuffer::getMemBuffer("int main() { float x; }").release()); @@ -181,7 +181,7 @@ TEST(PreprocessorFrontendAction, EndSourceFile) { Invocation->getFrontendOpts().ProgramAction = frontend::ParseSyntaxOnly; Invocation->getTargetOpts().Triple = "i386-unknown-linux-gnu"; CompilerInstance Compiler; - Compiler.setInvocation(Invocation); + Compiler.setInvocation(std::move(Invocation)); Compiler.createDiagnostics(); TestPPCallbacks *Callbacks = new TestPPCallbacks; @@ -231,7 +231,7 @@ struct TypoDiagnosticConsumer : public DiagnosticConsumer { }; TEST(ASTFrontendAction, ExternalSemaSource) { - auto *Invocation = new CompilerInvocation; + auto Invocation = std::make_shared<CompilerInvocation>(); Invocation->getLangOpts()->CPlusPlus = true; Invocation->getPreprocessorOpts().addRemappedFile( "test.cc", MemoryBuffer::getMemBuffer("void fooo();\n" @@ -242,7 +242,7 @@ TEST(ASTFrontendAction, ExternalSemaSource) { Invocation->getFrontendOpts().ProgramAction = frontend::ParseSyntaxOnly; Invocation->getTargetOpts().Triple = "i386-unknown-linux-gnu"; CompilerInstance Compiler; - Compiler.setInvocation(Invocation); + Compiler.setInvocation(std::move(Invocation)); auto *TDC = new TypoDiagnosticConsumer; Compiler.createDiagnostics(TDC, /*ShouldOwnClient=*/true); Compiler.setExternalSemaSource(new TypoExternalSemaSource(Compiler)); |