llir-opt  0.0.1
Low-Level Post-Link Optimiser for OCaml and C
constraint_type.h
1 // This file if part of the llir-opt project.
2 // Licensing information can be found in the LICENSE file.
3 // (C) 2018 Nandor Licker. All rights reserved.
4 
5 #pragma once
6 
7 #include <llvm/Support/raw_ostream.h>
8 
9 
10 namespace tags {
11 
12 enum class ConstraintType {
13  BOT,
14  // Pure integers.
15  INT,
16  // Pure pointers.
17  PTR_BOT,
18  YOUNG,
19  HEAP,
20  ADDR,
21  PTR,
22  FUNC,
23  // Pointers or integers.
24  ADDR_INT,
25  PTR_INT,
26  HEAP_INT,
27 };
28 
29 ConstraintType LUB(ConstraintType a, ConstraintType b);
30 ConstraintType GLB(ConstraintType a, ConstraintType b);
31 
32 }
33 
34 // -----------------------------------------------------------------------------
35 bool operator<(tags::ConstraintType a, tags::ConstraintType b);
36 
37 // -----------------------------------------------------------------------------
38 inline bool operator<=(tags::ConstraintType a, tags::ConstraintType b)
39 {
40  return a == b || a < b;
41 }
42 
43 // -----------------------------------------------------------------------------
44 llvm::raw_ostream &operator<<(llvm::raw_ostream &os, tags::ConstraintType type);
45