xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AMDGPU/Utils/AMDGPUDelayedMCExpr.h (revision 5036d9652a5701d00e9e40ea942c278e9f77d33d)
1 //===- AMDGPUDelayedMCExpr.h - Delayed MCExpr resolve -----------*- C++ -*-===//
2 //
3 // 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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPUDELAYEDMCEXPR_H
10 #define LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPUDELAYEDMCEXPR_H
11 
12 #include "llvm/BinaryFormat/MsgPackDocument.h"
13 #include <deque>
14 
15 namespace llvm {
16 class MCExpr;
17 
18 class DelayedMCExprs {
19   struct Expr {
20     msgpack::DocNode &DN;
21     msgpack::Type Type;
22     const MCExpr *ExprValue;
23     Expr(msgpack::DocNode &DN, msgpack::Type Type, const MCExpr *ExprValue)
24         : DN(DN), Type(Type), ExprValue(ExprValue) {}
25   };
26 
27   std::deque<Expr> DelayedExprs;
28 
29 public:
30   bool resolveDelayedExpressions();
31   void assignDocNode(msgpack::DocNode &DN, msgpack::Type Type,
32                      const MCExpr *ExprValue);
33   void clear();
34   bool empty();
35 };
36 
37 } // end namespace llvm
38 
39 #endif // LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPUDELAYEDMCEXPR_H
40