macros.h 758 B

123456789101112131415161718192021
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #ifndef CARBON_TOOLCHAIN_CHECK_CPP_MACROS_H_
  5. #define CARBON_TOOLCHAIN_CHECK_CPP_MACROS_H_
  6. #include "toolchain/check/context.h"
  7. namespace Carbon::Check {
  8. // Tries to evaluate the given macro. The macro will be evaluated as a
  9. // constant if possible. Returns an `InstId` on success or
  10. // `SemIR::ErrorInst::InstId` otherwise.
  11. auto TryEvaluateMacro(Context& context, SemIR::LocId loc_id,
  12. SemIR::NameId name_id, clang::MacroInfo* macro_info)
  13. -> SemIR::InstId;
  14. } // namespace Carbon::Check
  15. #endif // CARBON_TOOLCHAIN_CHECK_CPP_MACROS_H_