clang_cc1.h 1.1 KB

1234567891011121314151617181920212223242526272829
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #ifndef CARBON_THIRD_PARTY_LLVM_CLANG_CC1_H_
  5. #define CARBON_THIRD_PARTY_LLVM_CLANG_CC1_H_
  6. #include "llvm/ADT/IntrusiveRefCntPtr.h"
  7. #include "llvm/ADT/SmallVector.h"
  8. #include "llvm/Support/VirtualFileSystem.h"
  9. #include "toolchain/base/install_paths.h"
  10. namespace Carbon {
  11. // Emulates Clang's `cc1_main` but in a way that doesn't assume it is running
  12. // in the main thread and can more easily fit into library calls to do
  13. // compiles.
  14. //
  15. // TODO: Much of the logic here should be factored out of the CC1
  16. // implementation in Clang's driver and into a reusable part of its libraries.
  17. // That should allow reducing the code here to a minimal amount.
  18. auto RunClangCC1Main(const InstallPaths& installation,
  19. llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> fs,
  20. llvm::SmallVectorImpl<const char*>& cc1_args,
  21. bool enable_leaking) -> int;
  22. } // namespace Carbon
  23. #endif // CARBON_THIRD_PARTY_LLVM_CLANG_CC1_H_