Path: blob/main/contrib/llvm-project/clang/lib/Basic/Targets/Lanai.h
35267 views
//===--- Lanai.h - Declare Lanai target feature support ---------*- C++ -*-===//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//===----------------------------------------------------------------------===//7//8// This file declares Lanai TargetInfo objects.9//10//===----------------------------------------------------------------------===//1112#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_LANAI_H13#define LLVM_CLANG_LIB_BASIC_TARGETS_LANAI_H1415#include "clang/Basic/TargetInfo.h"16#include "clang/Basic/TargetOptions.h"17#include "llvm/Support/Compiler.h"18#include "llvm/TargetParser/Triple.h"1920namespace clang {21namespace targets {2223class LLVM_LIBRARY_VISIBILITY LanaiTargetInfo : public TargetInfo {24// Class for Lanai (32-bit).25// The CPU profiles supported by the Lanai backend26enum CPUKind {27CK_NONE,28CK_V11,29} CPU;3031static const TargetInfo::GCCRegAlias GCCRegAliases[];32static const char *const GCCRegNames[];3334public:35LanaiTargetInfo(const llvm::Triple &Triple, const TargetOptions &)36: TargetInfo(Triple) {37// Description string has to be kept in sync with backend.38resetDataLayout("E" // Big endian39"-m:e" // ELF name manging40"-p:32:32" // 32 bit pointers, 32 bit aligned41"-i64:64" // 64 bit integers, 64 bit aligned42"-a:0:32" // 32 bit alignment of objects of aggregate type43"-n32" // 32 bit native integer width44"-S64" // 64 bit natural stack alignment45);4647// Setting RegParmMax equal to what mregparm was set to in the old48// toolchain49RegParmMax = 4;5051// Set the default CPU to V1152CPU = CK_V11;5354// Temporary approach to make everything at least word-aligned and allow for55// safely casting between pointers with different alignment requirements.56// TODO: Remove this when there are no more cast align warnings on the57// firmware.58MinGlobalAlign = 32;59}6061void getTargetDefines(const LangOptions &Opts,62MacroBuilder &Builder) const override;6364bool isValidCPUName(StringRef Name) const override;6566void fillValidCPUList(SmallVectorImpl<StringRef> &Values) const override;6768bool setCPU(const std::string &Name) override;6970bool hasFeature(StringRef Feature) const override;7172ArrayRef<const char *> getGCCRegNames() const override;7374ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override;7576BuiltinVaListKind getBuiltinVaListKind() const override {77return TargetInfo::VoidPtrBuiltinVaList;78}7980ArrayRef<Builtin::Info> getTargetBuiltins() const override {81return std::nullopt;82}8384bool validateAsmConstraint(const char *&Name,85TargetInfo::ConstraintInfo &info) const override {86return false;87}8889std::string_view getClobbers() const override { return ""; }9091bool hasBitIntType() const override { return true; }92};93} // namespace targets94} // namespace clang9596#endif // LLVM_CLANG_LIB_BASIC_TARGETS_LANAI_H979899