1 //===--- Lanai.h - Declare Lanai target feature support ---------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares Lanai TargetInfo objects.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_LIB_BASIC_TARGETS_LANAI_H
15 #define LLVM_CLANG_LIB_BASIC_TARGETS_LANAI_H
17 #include "clang/Basic/TargetInfo.h"
18 #include "clang/Basic/TargetOptions.h"
19 #include "llvm/ADT/Triple.h"
20 #include "llvm/Support/Compiler.h"
25 class LLVM_LIBRARY_VISIBILITY LanaiTargetInfo : public TargetInfo {
26 // Class for Lanai (32-bit).
27 // The CPU profiles supported by the Lanai backend
33 static const TargetInfo::GCCRegAlias GCCRegAliases[];
34 static const char *const GCCRegNames[];
37 LanaiTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
38 : TargetInfo(Triple) {
39 // Description string has to be kept in sync with backend.
40 resetDataLayout("E" // Big endian
41 "-m:e" // ELF name manging
42 "-p:32:32" // 32 bit pointers, 32 bit aligned
43 "-i64:64" // 64 bit integers, 64 bit aligned
44 "-a:0:32" // 32 bit alignment of objects of aggregate type
45 "-n32" // 32 bit native integer width
46 "-S64" // 64 bit natural stack alignment
49 // Setting RegParmMax equal to what mregparm was set to in the old
53 // Set the default CPU to V11
56 // Temporary approach to make everything at least word-aligned and allow for
57 // safely casting between pointers with different alignment requirements.
58 // TODO: Remove this when there are no more cast align warnings on the
63 void getTargetDefines(const LangOptions &Opts,
64 MacroBuilder &Builder) const override;
66 bool isValidCPUName(StringRef Name) const override;
68 bool setCPU(const std::string &Name) override;
70 bool hasFeature(StringRef Feature) const override;
72 ArrayRef<const char *> getGCCRegNames() const override;
74 ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override;
76 BuiltinVaListKind getBuiltinVaListKind() const override {
77 return TargetInfo::VoidPtrBuiltinVaList;
80 ArrayRef<Builtin::Info> getTargetBuiltins() const override { return None; }
82 bool validateAsmConstraint(const char *&Name,
83 TargetInfo::ConstraintInfo &info) const override {
87 const char *getClobbers() const override { return ""; }
89 } // namespace targets
92 #endif // LLVM_CLANG_LIB_BASIC_TARGETS_LANAI_H