blob: 92a115eb8038095003ca76baa2e0f503a164de98 [file] [log] [blame]
Kevin Enderbydb889b12009-08-07 22:46:00 +00001//===- AsmCond.h - Assembly file conditional assembly ----------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef ASMCOND_H
11#define ASMCOND_H
12
13namespace llvm {
14
15/// AsmCond - Class to support conditional assembly
16///
17/// The conditional assembly feature (.if, .else, .elseif and .endif) is
18/// implemented with AsmCond that tells us what we are in the middle of
19/// processing. Ignore can be either true or false. When true we are ignoring
20/// the block of code in the middle of a conditional.
21
22class AsmCond {
23public:
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
31 ConditionalAssemblyType TheCond;
32 bool CondMet;
33 bool Ignore;
Benjamin Kramer2cf5dd52009-08-08 11:26:50 +000034
35 AsmCond() : TheCond(NoCond), CondMet(false), Ignore(false) {}
Kevin Enderbydb889b12009-08-07 22:46:00 +000036};
37
38} // end namespace llvm
39
40#endif