blob: ea21550100814d1dd48b9ff314ddc4cf1effc9a3 [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===- AsmCond.h - Assembly file conditional assembly ----------*- C++ -*-===//
2//
Andrew Walbran16937d02019-10-22 13:54:20 +01003// 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
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01006//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_MC_MCPARSER_ASMCOND_H
10#define LLVM_MC_MCPARSER_ASMCOND_H
11
12namespace llvm {
13
14/// AsmCond - Class to support conditional assembly
15///
16/// The conditional assembly feature (.if, .else, .elseif and .endif) is
Andrew Scullcdfcccc2018-10-05 20:58:37 +010017/// implemented with AsmCond that tells us what we are in the middle of
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010018/// processing. Ignore can be either true or false. When true we are ignoring
19/// the block of code in the middle of a conditional.
20
21class AsmCond {
22public:
23 enum ConditionalAssemblyType {
24 NoCond, // no conditional is being processed
25 IfCond, // inside if conditional
26 ElseIfCond, // inside elseif conditional
27 ElseCond // inside else conditional
28 };
29
30 ConditionalAssemblyType TheCond = NoCond;
31 bool CondMet = false;
32 bool Ignore = false;
33
34 AsmCond() = default;
35};
36
37} // end namespace llvm
38
39#endif // LLVM_MC_MCPARSER_ASMCOND_H