Add a rough outline of a command line driver. (#548)

This is actually code that I wrote a long time ago but didn't get added
to the repository, trying to tidy that up. This is the last code.
Nothing much interesting here, just a skeleton of a CLI. But seemed
better to add it than to not.
This commit is contained in:
Chandler Carruth authored and GitHub committed 2021-06-08 02:43:30 -07:00
1 parent f180c64454
commit 8afc1f8316
95 files changed
+672

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include <cstdlib>
#include "driver/driver.h"
#include "llvm/ADT/Sequence.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
auto main(int argc, char** argv) -> int {
if (argc < 1) {
return EXIT_FAILURE;
}
llvm::SmallVector<llvm::StringRef, 16> args(argv + 1, argv + argc);
Carbon::Driver driver;
bool success = driver.RunFullCommand(args);
return success ? EXIT_SUCCESS : EXIT_FAILURE;
}