driver_main.cpp 619 B

123456789101112131415161718192021
  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 <cstdlib>
  5. #include "driver/driver.h"
  6. #include "llvm/ADT/Sequence.h"
  7. #include "llvm/ADT/SmallVector.h"
  8. #include "llvm/ADT/StringRef.h"
  9. auto main(int argc, char** argv) -> int {
  10. if (argc < 1) {
  11. return EXIT_FAILURE;
  12. }
  13. llvm::SmallVector<llvm::StringRef, 16> args(argv + 1, argv + argc);
  14. Carbon::Driver driver;
  15. bool success = driver.RunFullCommand(args);
  16. return success ? EXIT_SUCCESS : EXIT_FAILURE;
  17. }