2010-12-31 17:31:54 +00:00
|
|
|
//===--- DriverOptions.cpp - Driver Options Table -------------------------===//
|
2009-11-19 00:15:11 +00:00
|
|
|
//
|
2019-01-19 08:50:56 +00:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2009-11-19 00:15:11 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "clang/Driver/Options.h"
|
2013-07-15 03:38:40 +00:00
|
|
|
#include "llvm/ADT/STLExtras.h"
|
2013-06-14 17:17:23 +00:00
|
|
|
#include "llvm/Option/OptTable.h"
|
|
|
|
#include "llvm/Option/Option.h"
|
2017-08-29 00:09:31 +00:00
|
|
|
#include <cassert>
|
2009-11-19 00:15:11 +00:00
|
|
|
|
|
|
|
using namespace clang::driver;
|
|
|
|
using namespace clang::driver::options;
|
2013-06-14 17:17:23 +00:00
|
|
|
using namespace llvm::opt;
|
2009-11-19 00:15:11 +00:00
|
|
|
|
2022-12-26 08:51:47 +01:00
|
|
|
#define OPTTABLE_VALUES_CODE
|
|
|
|
#include "clang/Driver/Options.inc"
|
|
|
|
#undef OPTTABLE_VALUES_CODE
|
|
|
|
|
2022-12-26 09:19:09 +01:00
|
|
|
#define PREFIX(NAME, VALUE) \
|
|
|
|
static constexpr llvm::StringLiteral NAME##_init[] = VALUE; \
|
|
|
|
static constexpr llvm::ArrayRef<llvm::StringLiteral> NAME( \
|
|
|
|
NAME##_init, std::size(NAME##_init) - 1);
|
2012-10-22 22:13:48 +00:00
|
|
|
#include "clang/Driver/Options.inc"
|
|
|
|
#undef PREFIX
|
|
|
|
|
2022-12-30 08:32:59 +01:00
|
|
|
static constexpr const llvm::StringLiteral PrefixTable_init[] =
|
|
|
|
#define PREFIX_UNION(VALUES) VALUES
|
|
|
|
#include "clang/Driver/Options.inc"
|
|
|
|
#undef PREFIX_UNION
|
|
|
|
;
|
|
|
|
static constexpr const llvm::ArrayRef<llvm::StringLiteral>
|
|
|
|
PrefixTable(PrefixTable_init, std::size(PrefixTable_init) - 1);
|
|
|
|
|
2022-12-26 09:19:09 +01:00
|
|
|
static constexpr OptTable::Info InfoTable[] = {
|
2023-08-04 11:19:09 -07:00
|
|
|
#define OPTION(...) LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__),
|
2009-11-19 01:03:50 +00:00
|
|
|
#include "clang/Driver/Options.inc"
|
2013-07-17 16:54:06 +00:00
|
|
|
#undef OPTION
|
2009-11-19 00:15:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
2022-12-30 08:32:59 +01:00
|
|
|
class DriverOptTable : public PrecomputedOptTable {
|
2009-11-19 00:15:11 +00:00
|
|
|
public:
|
2022-12-30 08:32:59 +01:00
|
|
|
DriverOptTable() : PrecomputedOptTable(InfoTable, PrefixTable) {}
|
2009-11-19 00:15:11 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2019-09-04 14:26:28 +00:00
|
|
|
const llvm::opt::OptTable &clang::driver::getDriverOptTable() {
|
2022-12-26 08:51:47 +01:00
|
|
|
static DriverOptTable Table;
|
|
|
|
return Table;
|
2009-11-19 00:15:11 +00:00
|
|
|
}
|