MSP430.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. //===--- MSP430.cpp - Implement MSP430 target feature support -------------===//
  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. // This file implements MSP430 TargetInfo objects.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. #include "MSP430.h"
  13. #include "clang/Basic/MacroBuilder.h"
  14. using namespace clang;
  15. using namespace clang::targets;
  16. const char *const MSP430TargetInfo::GCCRegNames[] = {
  17. "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
  18. "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
  19. };
  20. ArrayRef<const char *> MSP430TargetInfo::getGCCRegNames() const {
  21. return llvm::makeArrayRef(GCCRegNames);
  22. }
  23. void MSP430TargetInfo::getTargetDefines(const LangOptions &Opts,
  24. MacroBuilder &Builder) const {
  25. Builder.defineMacro("MSP430");
  26. Builder.defineMacro("__MSP430__");
  27. Builder.defineMacro("__ELF__");
  28. // FIXME: defines for different 'flavours' of MCU
  29. }