Path: blob/main/contrib/llvm-project/clang/lib/Driver/DriverOptions.cpp
35234 views
//===--- DriverOptions.cpp - Driver Options Table -------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "clang/Driver/Options.h"9#include "llvm/ADT/STLExtras.h"10#include "llvm/Option/OptTable.h"11#include "llvm/Option/Option.h"12#include <cassert>1314using namespace clang::driver;15using namespace clang::driver::options;16using namespace llvm::opt;1718#define OPTTABLE_VALUES_CODE19#include "clang/Driver/Options.inc"20#undef OPTTABLE_VALUES_CODE2122#define PREFIX(NAME, VALUE) \23static constexpr llvm::StringLiteral NAME##_init[] = VALUE; \24static constexpr llvm::ArrayRef<llvm::StringLiteral> NAME( \25NAME##_init, std::size(NAME##_init) - 1);26#include "clang/Driver/Options.inc"27#undef PREFIX2829static constexpr const llvm::StringLiteral PrefixTable_init[] =30#define PREFIX_UNION(VALUES) VALUES31#include "clang/Driver/Options.inc"32#undef PREFIX_UNION33;34static constexpr const llvm::ArrayRef<llvm::StringLiteral>35PrefixTable(PrefixTable_init, std::size(PrefixTable_init) - 1);3637static constexpr OptTable::Info InfoTable[] = {38#define OPTION(...) LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__),39#include "clang/Driver/Options.inc"40#undef OPTION41};4243namespace {4445class DriverOptTable : public PrecomputedOptTable {46public:47DriverOptTable() : PrecomputedOptTable(InfoTable, PrefixTable) {}48};49}5051const llvm::opt::OptTable &clang::driver::getDriverOptTable() {52static DriverOptTable Table;53return Table;54}555657