xref: /freebsd/contrib/llvm-project/llvm/include/llvm/MC/MCParser/AsmCond.h (revision 5b27928474e6a4103d65b347544705c40c9618fd)
1*0b57cec5SDimitry Andric //===- AsmCond.h - Assembly file conditional assembly  ----------*- C++ -*-===//
2*0b57cec5SDimitry Andric //
3*0b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*0b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*0b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*0b57cec5SDimitry Andric //
7*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
8*0b57cec5SDimitry Andric 
9*0b57cec5SDimitry Andric #ifndef LLVM_MC_MCPARSER_ASMCOND_H
10*0b57cec5SDimitry Andric #define LLVM_MC_MCPARSER_ASMCOND_H
11*0b57cec5SDimitry Andric 
12*0b57cec5SDimitry Andric namespace llvm {
13*0b57cec5SDimitry Andric 
14*0b57cec5SDimitry Andric /// AsmCond - Class to support conditional assembly
15*0b57cec5SDimitry Andric ///
16*0b57cec5SDimitry Andric /// The conditional assembly feature (.if, .else, .elseif and .endif) is
17*0b57cec5SDimitry Andric /// implemented with AsmCond that tells us what we are in the middle of
18*0b57cec5SDimitry Andric /// processing.  Ignore can be either true or false.  When true we are ignoring
19*0b57cec5SDimitry Andric /// the block of code in the middle of a conditional.
20*0b57cec5SDimitry Andric 
21*0b57cec5SDimitry Andric class AsmCond {
22*0b57cec5SDimitry Andric public:
23*0b57cec5SDimitry Andric   enum ConditionalAssemblyType {
24*0b57cec5SDimitry Andric     NoCond,     // no conditional is being processed
25*0b57cec5SDimitry Andric     IfCond,     // inside if conditional
26*0b57cec5SDimitry Andric     ElseIfCond, // inside elseif conditional
27*0b57cec5SDimitry Andric     ElseCond    // inside else conditional
28*0b57cec5SDimitry Andric   };
29*0b57cec5SDimitry Andric 
30*0b57cec5SDimitry Andric   ConditionalAssemblyType TheCond = NoCond;
31*0b57cec5SDimitry Andric   bool CondMet = false;
32*0b57cec5SDimitry Andric   bool Ignore = false;
33*0b57cec5SDimitry Andric };
34*0b57cec5SDimitry Andric 
35*0b57cec5SDimitry Andric } // end namespace llvm
36*0b57cec5SDimitry Andric 
37*0b57cec5SDimitry Andric #endif // LLVM_MC_MCPARSER_ASMCOND_H
38