xref: /freebsd/contrib/llvm-project/clang/lib/Basic/Targets/MSP430.cpp (revision bdd1243df58e60e85101c09001d9812a789b6bc4)
10b57cec5SDimitry Andric //===--- MSP430.cpp - Implement MSP430 target feature support -------------===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric //
90b57cec5SDimitry Andric // This file implements MSP430 TargetInfo objects.
100b57cec5SDimitry Andric //
110b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
120b57cec5SDimitry Andric 
130b57cec5SDimitry Andric #include "MSP430.h"
140b57cec5SDimitry Andric #include "clang/Basic/MacroBuilder.h"
150b57cec5SDimitry Andric 
160b57cec5SDimitry Andric using namespace clang;
170b57cec5SDimitry Andric using namespace clang::targets;
180b57cec5SDimitry Andric 
190b57cec5SDimitry Andric const char *const MSP430TargetInfo::GCCRegNames[] = {
200b57cec5SDimitry Andric     "r0", "r1", "r2",  "r3",  "r4",  "r5",  "r6",  "r7",
210b57cec5SDimitry Andric     "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
220b57cec5SDimitry Andric };
230b57cec5SDimitry Andric 
240b57cec5SDimitry Andric ArrayRef<const char *> MSP430TargetInfo::getGCCRegNames() const {
25*bdd1243dSDimitry Andric   return llvm::ArrayRef(GCCRegNames);
260b57cec5SDimitry Andric }
270b57cec5SDimitry Andric 
280b57cec5SDimitry Andric void MSP430TargetInfo::getTargetDefines(const LangOptions &Opts,
290b57cec5SDimitry Andric                                         MacroBuilder &Builder) const {
300b57cec5SDimitry Andric   Builder.defineMacro("MSP430");
310b57cec5SDimitry Andric   Builder.defineMacro("__MSP430__");
32e8d8bef9SDimitry Andric   Builder.defineMacro("__ELF__");
330b57cec5SDimitry Andric   // FIXME: defines for different 'flavours' of MCU
340b57cec5SDimitry Andric }
35