From: Etienne Bergeron Date: Thu, 12 May 2016 19:51:18 +0000 (+0000) Subject: [Tooling] Fix broken dependency for shared build X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e15fe213a0a6f2311d2760cb9224312bb9b639d8;p=clang [Tooling] Fix broken dependency for shared build Summary: There virtual destructor can't be found and cause a compilation error on a shared build. To repro: [Release + Shared] ``` -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON ``` Which produce this error: ``` tools/clang/unittests/Tooling/CMakeFiles/ToolingTests.dir/ToolingTest.cpp.o: In function `clang::tooling::newFrontendActionFactory_CreatesFrontendActionFactoryFromType_Test::TestBody()': ToolingTest.cpp:(.text._ZN5clang7tooling66newFrontendActionFactory_CreatesFrontendActionFactoryFromType_Test8TestBodyEv+0x49): undefined reference to `clang::SyntaxOnlyAction::~SyntaxOnlyAction()' ``` Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20218 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269334 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Frontend/FrontendActions.h b/include/clang/Frontend/FrontendActions.h index 025955dd5e..60e0ae4875 100644 --- a/include/clang/Frontend/FrontendActions.h +++ b/include/clang/Frontend/FrontendActions.h @@ -129,6 +129,7 @@ protected: StringRef InFile) override; public: + ~SyntaxOnlyAction() override; bool hasCodeCompletionSupport() const override { return true; } }; diff --git a/lib/Frontend/FrontendActions.cpp b/lib/Frontend/FrontendActions.cpp index c6e6a518a2..79c1df43dd 100644 --- a/lib/Frontend/FrontendActions.cpp +++ b/lib/Frontend/FrontendActions.cpp @@ -401,6 +401,9 @@ raw_pwrite_stream *GenerateModuleAction::ComputeASTConsumerArguments( return OS; } +SyntaxOnlyAction::~SyntaxOnlyAction() { +} + std::unique_ptr SyntaxOnlyAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { return llvm::make_unique();