carbon.cpp 705 B

12345678910111213141516171819
  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. #include "explorer/main.h"
  5. #include "llvm/Support/Path.h"
  6. auto main(int argc, char** argv) -> int {
  7. llvm::StringRef bin = llvm::sys::path::filename(argv[0]);
  8. if (bin == "carbon-explorer") {
  9. static int static_for_main_addr;
  10. return Carbon::ExplorerMain(argc, argv,
  11. static_cast<void*>(&static_for_main_addr),
  12. "data/prelude.carbon");
  13. } else {
  14. fprintf(stderr, "Unrecognized Carbon binary requested: %s", argv[0]);
  15. return 1;
  16. }
  17. }