]> granicus.if.org Git - clang/commitdiff
[Tooling] Fix broken dependency for shared build
authorEtienne Bergeron <etienneb@google.com>
Thu, 12 May 2016 19:51:18 +0000 (19:51 +0000)
committerEtienne Bergeron <etienneb@google.com>
Thu, 12 May 2016 19:51:18 +0000 (19:51 +0000)
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

include/clang/Frontend/FrontendActions.h
lib/Frontend/FrontendActions.cpp

index 025955dd5efba48bebc1175b6ad1624bb3350b58..60e0ae4875ff9e2e105dd67b6471776dac928c3d 100644 (file)
@@ -129,6 +129,7 @@ protected:
                                                  StringRef InFile) override;
 
 public:
+  ~SyntaxOnlyAction() override;
   bool hasCodeCompletionSupport() const override { return true; }
 };
 
index c6e6a518a280f012442a7b4d413d7b16a3fffcc1..79c1df43dd7918f68a09725ca65b7cb842c36b12 100644 (file)
@@ -401,6 +401,9 @@ raw_pwrite_stream *GenerateModuleAction::ComputeASTConsumerArguments(
   return OS;
 }
 
+SyntaxOnlyAction::~SyntaxOnlyAction() {
+}
+
 std::unique_ptr<ASTConsumer>
 SyntaxOnlyAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
   return llvm::make_unique<ASTConsumer>();