summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Frontend/CodeGenActionTest.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2017-01-06 19:49:01 +0000
committerDavid Blaikie <dblaikie@gmail.com>2017-01-06 19:49:01 +0000
commitea4395ebcd37905487b7a978db2f460bc576a5d1 (patch)
tree92303c3c362a7eee408868cfa554f15683b0c02d /clang/unittests/Frontend/CodeGenActionTest.cpp
parent9cbcc5ff0b325ef2c0638e6c5c365b35a1e4f087 (diff)
downloadbcm5719-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/unittests/Frontend/CodeGenActionTest.cpp')
-rw-r--r--clang/unittests/Frontend/CodeGenActionTest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/unittests/Frontend/CodeGenActionTest.cpp b/clang/unittests/Frontend/CodeGenActionTest.cpp
index 356b5130fcb..1d2a50c8bc2 100644
--- a/clang/unittests/Frontend/CodeGenActionTest.cpp
+++ b/clang/unittests/Frontend/CodeGenActionTest.cpp
@@ -41,7 +41,7 @@ public:
TEST(CodeGenTest, TestNullCodeGen) {
- CompilerInvocation *Invocation = new CompilerInvocation;
+ auto Invocation = std::make_shared<CompilerInvocation>();
Invocation->getPreprocessorOpts().addRemappedFile(
"test.cc",
MemoryBuffer::getMemBuffer("").release());
@@ -50,7 +50,7 @@ TEST(CodeGenTest, TestNullCodeGen) {
Invocation->getFrontendOpts().ProgramAction = EmitLLVM;
Invocation->getTargetOpts().Triple = "i386-unknown-linux-gnu";
CompilerInstance Compiler;
- Compiler.setInvocation(Invocation);
+ Compiler.setInvocation(std::move(Invocation));
Compiler.createDiagnostics();
EXPECT_TRUE(Compiler.hasDiagnostics());
OpenPOWER on IntegriCloud