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

llvm-svn: 236459
This commit is contained in:
Kostya Serebryany 2015-05-04 21:14:45 +00:00
parent bc24c6ca76
commit 7862b01a63
1 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ extern "C" void TestOneInput(uint8_t *data, size_t size) {
std::string s((const char *)data, size);
llvm::opt::ArgStringList CC1Args;
CC1Args.push_back("-cc1");
CC1Args.push_back("test.cc");
CC1Args.push_back("./test.cc");
llvm::IntrusiveRefCntPtr<FileManager> Files(
new FileManager(FileSystemOptions()));
IgnoringDiagConsumer Diags;
@ -36,7 +36,7 @@ extern "C" void TestOneInput(uint8_t *data, size_t size) {
tooling::newInvocation(&Diagnostics, CC1Args));
std::unique_ptr<llvm::MemoryBuffer> Input =
llvm::MemoryBuffer::getMemBuffer(s);
Invocation->getPreprocessorOpts().addRemappedFile("test.cc", Input.release());
Invocation->getPreprocessorOpts().addRemappedFile("./test.cc", Input.release());
std::unique_ptr<tooling::ToolAction> action(
tooling::newFrontendActionFactory<clang::SyntaxOnlyAction>());
action->runInvocation(Invocation.release(), Files.get(), &Diags);