clang 23.0.0git
RISCV.h
Go to the documentation of this file.
1//===--- RISCV.h - RISC-V-specific Tool Helpers -----------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_RISCV_H
10#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_RISCV_H
11
12#include "clang/Driver/Driver.h"
13#include "llvm/ADT/SmallVector.h"
14#include "llvm/ADT/StringRef.h"
15#include "llvm/Option/Option.h"
16#include <optional>
17#include <string>
18#include <vector>
19
20namespace clang {
21namespace driver {
22namespace tools {
23namespace riscv {
24void getRISCVTargetFeatures(const Driver &D, const llvm::Triple &Triple,
25 const llvm::opt::ArgList &Args,
26 std::vector<llvm::StringRef> &Features);
27StringRef getRISCVABI(const llvm::opt::ArgList &Args,
28 const llvm::Triple &Triple);
29std::string getRISCVArch(const llvm::opt::ArgList &Args,
30 const llvm::Triple &Triple);
31std::string getRISCVTargetCPU(const llvm::opt::ArgList &Args,
32 const llvm::Triple &Triple);
33/// Return the tune CPU and optionally, the tune features. A std::nullopt
34/// return value signals error state.
35std::optional<StringRef>
36getRISCVTuneCPU(const Driver &D, const llvm::opt::ArgList &Args,
37 SmallVectorImpl<std::string> *TuneFeatures = nullptr);
38} // end namespace riscv
39} // namespace tools
40} // end namespace driver
41} // end namespace clang
42
43#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_RISCV_H
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition Driver.h:95
std::string getRISCVArch(const llvm::opt::ArgList &Args, const llvm::Triple &Triple)
Definition RISCV.cpp:275
std::string getRISCVTargetCPU(const llvm::opt::ArgList &Args, const llvm::Triple &Triple)
Definition RISCV.cpp:383
StringRef getRISCVABI(const llvm::opt::ArgList &Args, const llvm::Triple &Triple)
std::optional< StringRef > getRISCVTuneCPU(const Driver &D, const llvm::opt::ArgList &Args, SmallVectorImpl< std::string > *TuneFeatures=nullptr)
Return the tune CPU and optionally, the tune features.
Definition RISCV.cpp:401
void getRISCVTargetFeatures(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args, std::vector< llvm::StringRef > &Features)
The JSON file list parser is used to communicate input to InstallAPI.