summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Frontend
diff options
context:
space:
mode:
authorSerge Pavlov <sepavloff@gmail.com>2016-02-18 16:42:09 +0000
committerSerge Pavlov <sepavloff@gmail.com>2016-02-18 16:42:09 +0000
commit41c1f79dfe20261a0e427ac50dbead55d4ebd118 (patch)
treebbc011ded9141374d75236f98167b5969095ed3b /clang/unittests/Frontend
parenteb7e5d90747c73925183af54d5c9fe7b02971afa (diff)
downloadbcm5719-llvm-41c1f79dfe20261a0e427ac50dbead55d4ebd118.tar.gz
bcm5719-llvm-41c1f79dfe20261a0e427ac50dbead55d4ebd118.zip
Avoid double deletion in Clang driver.
Llvm module object is shared between CodeGenerator and BackendConsumer, in both classes it is stored as std::unique_ptr, which is not a good design solution and can cause double deletion error. Usually it does not occur because in BackendConsumer::HandleTranslationUnit the ownership of CodeGenerator over the module is taken away. If however this method is not called, the module is deleted twice and compiler crashes. As the module owned by BackendConsumer is always the same as CodeGenerator has, pointer to llvm module can be removed from BackendGenerator. Differential Revision: http://reviews.llvm.org/D15450 llvm-svn: 261222
Diffstat (limited to 'clang/unittests/Frontend')
-rw-r--r--clang/unittests/Frontend/CMakeLists.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/unittests/Frontend/CMakeLists.txt b/clang/unittests/Frontend/CMakeLists.txt
index 5b5fdc9a54f..674f77bd013 100644
--- a/clang/unittests/Frontend/CMakeLists.txt
+++ b/clang/unittests/Frontend/CMakeLists.txt
@@ -4,6 +4,7 @@ set(LLVM_LINK_COMPONENTS
add_clang_unittest(FrontendTests
FrontendActionTest.cpp
+ CodeGenActionTest.cpp
)
target_link_libraries(FrontendTests
clangAST
@@ -11,4 +12,5 @@ target_link_libraries(FrontendTests
clangFrontend
clangLex
clangSema
+ clangCodeGen
)
OpenPOWER on IntegriCloud