Fix linker error in clang-fuzzer following 89ea0b0520.

This fixes:
tools/clang/tools/clang-fuzzer/handle-cxx/CMakeFiles/obj.clangHandleCXX.dir/handle_cxx.cpp.o:handle_cxx.cpp:function clang_fuzzer::HandleCXX(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*, std::vector<char const*, std::allocator<char const*> > const&): error: undefined reference to 'clang::tooling::newInvocation(clang::DiagnosticsEngine*, llvm::SmallVector<char const*, 16u> const&)'
This commit is contained in:
Alexandre Ganea 2020-06-18 10:07:18 -04:00
parent 8374bf4363
commit cab3fc53d2
2 changed files with 3 additions and 2 deletions

View File

@ -505,7 +505,8 @@ void addTargetAndModeForProgramName(std::vector<std::string> &CommandLine,
/// Creates a \c CompilerInvocation.
CompilerInvocation *newInvocation(DiagnosticsEngine *Diagnostics,
const llvm::opt::ArgStringList &CC1Args);
const llvm::opt::ArgStringList &CC1Args,
const char *const BinaryName);
} // namespace tooling

View File

@ -37,7 +37,7 @@ void clang_fuzzer::HandleCXX(const std::string &S,
IntrusiveRefCntPtr<clang::DiagnosticIDs>(new DiagnosticIDs()), &*DiagOpts,
&Diags, false);
std::unique_ptr<clang::CompilerInvocation> Invocation(
tooling::newInvocation(&Diagnostics, CC1Args));
tooling::newInvocation(&Diagnostics, CC1Args, /*BinaryName=*/nullptr));
std::unique_ptr<llvm::MemoryBuffer> Input =
llvm::MemoryBuffer::getMemBuffer(S);
Invocation->getPreprocessorOpts().addRemappedFile(FileName,