1 //===--- MSP430.h - Declare MSP430 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 MSP430 TargetInfo objects.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_LIB_BASIC_TARGETS_MSP430_H
15 #define LLVM_CLANG_LIB_BASIC_TARGETS_MSP430_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 MSP430TargetInfo : public TargetInfo {
26 static const char *const GCCRegNames[];
29 MSP430TargetInfo(const llvm::Triple &Triple, const TargetOptions &)
30 : TargetInfo(Triple) {
36 LongAlign = LongLongAlign = 16;
40 SizeType = UnsignedInt;
41 IntMaxType = SignedLongLong;
42 IntPtrType = SignedInt;
43 PtrDiffType = SignedInt;
44 SigAtomicType = SignedLong;
45 resetDataLayout("e-m:e-p:16:16-i32:16-i64:16-f32:16-f64:16-a:8-n8:16-S16");
47 void getTargetDefines(const LangOptions &Opts,
48 MacroBuilder &Builder) const override;
50 ArrayRef<Builtin::Info> getTargetBuiltins() const override {
55 bool hasFeature(StringRef Feature) const override {
56 return Feature == "msp430";
59 ArrayRef<const char *> getGCCRegNames() const override;
61 ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
66 bool validateAsmConstraint(const char *&Name,
67 TargetInfo::ConstraintInfo &info) const override {
70 case 'K': // the constant 1
71 case 'L': // constant -1^20 .. 1^19
72 case 'M': // constant 1-4:
75 // No target constraints for now.
79 const char *getClobbers() const override {
80 // FIXME: Is this really right?
84 BuiltinVaListKind getBuiltinVaListKind() const override {
86 return TargetInfo::CharPtrBuiltinVaList;
90 } // namespace targets
92 #endif // LLVM_CLANG_LIB_BASIC_TARGETS_MSP430_H