main: switch to LLVM 10

This commit also adds a bit of version independence, in particular for
external commands. It also adds the LLVM version to the `tinygo version`
command, which might help while debugging.
This commit is contained in:
Ayke van Laethem
2020-03-03 14:50:13 +01:00
committed by Ron Evans
parent 584e94ce2f
commit 0afd42c439
25 changed files with 165 additions and 118 deletions
+3 -3
View File
@@ -52,8 +52,7 @@ bool tinygo_clang_driver(int argc, char **argv) {
std::unique_ptr<clang::CompilerInstance> Clang(new clang::CompilerInstance());
bool success = clang::CompilerInvocation::CreateFromArgs(
Clang->getInvocation(),
const_cast<const char **>(CCArgs.data()),
const_cast<const char **>(CCArgs.data()) + CCArgs.size(),
CCArgs,
Diags);
if (!success) {
return false;
@@ -74,7 +73,8 @@ bool tinygo_clang_driver(int argc, char **argv) {
} else if (strcmp(*CCArgs.data(), "-cc1as") == 0) {
// This is the assembler frontend. Parse the arguments.
AssemblerInvocation Asm;
if (!AssemblerInvocation::CreateFromArgs(Asm, llvm::ArrayRef<const char*>(CCArgs).slice(1), Diags))
ArrayRef<const char *> Argv = llvm::ArrayRef<const char*>(CCArgs);
if (!AssemblerInvocation::CreateFromArgs(Asm, Argv.slice(1), Diags))
return false;
// Execute the invocation, unless there were parsing errors.