Skip to content
Snippets Groups Projects
Commit 382ebce3 authored by Kostya Serebryany's avatar Kostya Serebryany
Browse files

[clang-fuzzer] make clang-fuzzer slightly faster by removing one redundant directory scan

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236459 91177308-0d34-0410-b5e6-96231b3b80d8
parent b8cd9c9d
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,7 @@ extern "C" void TestOneInput(uint8_t *data, size_t size) { ...@@ -24,7 +24,7 @@ extern "C" void TestOneInput(uint8_t *data, size_t size) {
std::string s((const char *)data, size); std::string s((const char *)data, size);
llvm::opt::ArgStringList CC1Args; llvm::opt::ArgStringList CC1Args;
CC1Args.push_back("-cc1"); CC1Args.push_back("-cc1");
CC1Args.push_back("test.cc"); CC1Args.push_back("./test.cc");
llvm::IntrusiveRefCntPtr<FileManager> Files( llvm::IntrusiveRefCntPtr<FileManager> Files(
new FileManager(FileSystemOptions())); new FileManager(FileSystemOptions()));
IgnoringDiagConsumer Diags; IgnoringDiagConsumer Diags;
...@@ -36,7 +36,7 @@ extern "C" void TestOneInput(uint8_t *data, size_t size) { ...@@ -36,7 +36,7 @@ extern "C" void TestOneInput(uint8_t *data, size_t size) {
tooling::newInvocation(&Diagnostics, CC1Args)); tooling::newInvocation(&Diagnostics, CC1Args));
std::unique_ptr<llvm::MemoryBuffer> Input = std::unique_ptr<llvm::MemoryBuffer> Input =
llvm::MemoryBuffer::getMemBuffer(s); llvm::MemoryBuffer::getMemBuffer(s);
Invocation->getPreprocessorOpts().addRemappedFile("test.cc", Input.release()); Invocation->getPreprocessorOpts().addRemappedFile("./test.cc", Input.release());
std::unique_ptr<tooling::ToolAction> action( std::unique_ptr<tooling::ToolAction> action(
tooling::newFrontendActionFactory<clang::SyntaxOnlyAction>()); tooling::newFrontendActionFactory<clang::SyntaxOnlyAction>());
action->runInvocation(Invocation.release(), Files.get(), &Diags); action->runInvocation(Invocation.release(), Files.get(), &Diags);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment