AsmCond.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. //===- AsmCond.h - Assembly file conditional assembly ----------*- 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. #ifndef LLVM_MC_MCPARSER_ASMCOND_H
  14. #define LLVM_MC_MCPARSER_ASMCOND_H
  15. namespace llvm {
  16. /// AsmCond - Class to support conditional assembly
  17. ///
  18. /// The conditional assembly feature (.if, .else, .elseif and .endif) is
  19. /// implemented with AsmCond that tells us what we are in the middle of
  20. /// processing. Ignore can be either true or false. When true we are ignoring
  21. /// the block of code in the middle of a conditional.
  22. class AsmCond {
  23. public:
  24. enum ConditionalAssemblyType {
  25. NoCond, // no conditional is being processed
  26. IfCond, // inside if conditional
  27. ElseIfCond, // inside elseif conditional
  28. ElseCond // inside else conditional
  29. };
  30. ConditionalAssemblyType TheCond = NoCond;
  31. bool CondMet = false;
  32. bool Ignore = false;
  33. };
  34. } // end namespace llvm
  35. #endif // LLVM_MC_MCPARSER_ASMCOND_H
  36. #ifdef __GNUC__
  37. #pragma GCC diagnostic pop
  38. #endif