diff options
Diffstat (limited to 'clang/unittests/Support/TimeProfilerTest.cpp')
| -rw-r--r-- | clang/unittests/Support/TimeProfilerTest.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/unittests/Support/TimeProfilerTest.cpp b/clang/unittests/Support/TimeProfilerTest.cpp index 995ebf625b7a..339b470153e6 100644 --- a/clang/unittests/Support/TimeProfilerTest.cpp +++ b/clang/unittests/Support/TimeProfilerTest.cpp @@ -45,6 +45,8 @@ std::string teardownProfiler() { // We only parse AST here. This is enough for constexpr evaluation. bool compileFromString(StringRef Code, StringRef Standard, StringRef File, llvm::StringMap<std::string> Headers = {}) { + CompilerInstance Compiler; + Compiler.createDiagnostics(); llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> FS( new llvm::vfs::InMemoryFileSystem()); @@ -55,8 +57,6 @@ bool compileFromString(StringRef Code, StringRef Standard, StringRef File, } llvm::IntrusiveRefCntPtr<FileManager> Files( new FileManager(FileSystemOptions(), FS)); - CompilerInstance Compiler; - Compiler.createDiagnostics(Files->getVirtualFileSystem()); Compiler.setFileManager(Files.get()); auto Invocation = std::make_shared<CompilerInvocation>(); |
