XCore.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //===--- XCore.cpp - Implement XCore 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 XCore TargetInfo objects.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. #include "XCore.h"
  13. #include "clang/Basic/Builtins.h"
  14. #include "clang/Basic/MacroBuilder.h"
  15. #include "clang/Basic/TargetBuiltins.h"
  16. using namespace clang;
  17. using namespace clang::targets;
  18. const Builtin::Info XCoreTargetInfo::BuiltinInfo[] = {
  19. #define BUILTIN(ID, TYPE, ATTRS) \
  20. {#ID, TYPE, ATTRS, nullptr, ALL_LANGUAGES, nullptr},
  21. #define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) \
  22. {#ID, TYPE, ATTRS, HEADER, ALL_LANGUAGES, nullptr},
  23. #include "clang/Basic/BuiltinsXCore.def"
  24. };
  25. void XCoreTargetInfo::getTargetDefines(const LangOptions &Opts,
  26. MacroBuilder &Builder) const {
  27. Builder.defineMacro("__xcore__");
  28. Builder.defineMacro("__XS1B__");
  29. }
  30. ArrayRef<Builtin::Info> XCoreTargetInfo::getTargetBuiltins() const {
  31. return llvm::makeArrayRef(BuiltinInfo, clang::XCore::LastTSBuiltin -
  32. Builtin::FirstTSBuiltin);
  33. }