ExpressionTraits.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- ExpressionTraits.h - C++ Expression Traits Support Enums -*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. ///
  14. /// \file
  15. /// Defines enumerations for expression traits intrinsics.
  16. ///
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_CLANG_BASIC_EXPRESSIONTRAITS_H
  19. #define LLVM_CLANG_BASIC_EXPRESSIONTRAITS_H
  20. #include "llvm/Support/Compiler.h"
  21. namespace clang {
  22. enum ExpressionTrait {
  23. #define EXPRESSION_TRAIT(Spelling, Name, Key) ET_##Name,
  24. #include "clang/Basic/TokenKinds.def"
  25. ET_Last = -1 // ET_Last == last ET_XX in the enum.
  26. #define EXPRESSION_TRAIT(Spelling, Name, Key) +1
  27. #include "clang/Basic/TokenKinds.def"
  28. };
  29. /// Return the internal name of type trait \p T. Never null.
  30. const char *getTraitName(ExpressionTrait T) LLVM_READONLY;
  31. /// Return the spelling of the type trait \p TT. Never null.
  32. const char *getTraitSpelling(ExpressionTrait T) LLVM_READONLY;
  33. } // namespace clang
  34. #endif
  35. #ifdef __GNUC__
  36. #pragma GCC diagnostic pop
  37. #endif