blob: eac17139708471dc357b1ef54d0e20eb04ac88ca [file] [log] [blame]
Eugene Zelenko553d8c82016-12-07 22:06:02 +00001//===-- ConstantsContext.h - Constants-related Context Interals -*- C++ -*-===//
Owen Andersone2942c02009-08-04 22:55:26 +00002//
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// This file defines various helper methods and classes used by
11// LLVMContextImpl for creating and managing constants.
12//
13//===----------------------------------------------------------------------===//
14
Benjamin Kramer00e08fc2014-08-13 16:26:38 +000015#ifndef LLVM_LIB_IR_CONSTANTSCONTEXT_H
16#define LLVM_LIB_IR_CONSTANTSCONTEXT_H
Owen Andersone2942c02009-08-04 22:55:26 +000017
Eugene Zelenko553d8c82016-12-07 22:06:02 +000018#include "llvm/ADT/ArrayRef.h"
19#include "llvm/ADT/DenseMapInfo.h"
Duncan P. N. Exon Smitha15c0e92016-04-06 17:56:08 +000020#include "llvm/ADT/DenseSet.h"
Jay Foad4e3e5de2012-03-06 10:43:52 +000021#include "llvm/ADT/Hashing.h"
Eugene Zelenko553d8c82016-12-07 22:06:02 +000022#include "llvm/ADT/None.h"
23#include "llvm/ADT/SmallVector.h"
24#include "llvm/ADT/StringRef.h"
Eugene Zelenko46795222017-05-15 21:57:41 +000025#include "llvm/IR/Constant.h"
Eugene Zelenko553d8c82016-12-07 22:06:02 +000026#include "llvm/IR/Constants.h"
27#include "llvm/IR/DerivedTypes.h"
Chandler Carruth0b8c9a82013-01-02 11:36:10 +000028#include "llvm/IR/InlineAsm.h"
Eugene Zelenko553d8c82016-12-07 22:06:02 +000029#include "llvm/IR/Instruction.h"
30#include "llvm/IR/OperandTraits.h"
31#include "llvm/Support/Casting.h"
David Greeneda23d932010-01-05 01:34:26 +000032#include "llvm/Support/Debug.h"
Owen Andersone2942c02009-08-04 22:55:26 +000033#include "llvm/Support/ErrorHandling.h"
Chris Lattner569f1212009-08-23 04:44:11 +000034#include "llvm/Support/raw_ostream.h"
Eugene Zelenko553d8c82016-12-07 22:06:02 +000035#include <cassert>
36#include <cstddef>
37#include <cstdint>
38#include <utility>
Owen Andersone2942c02009-08-04 22:55:26 +000039
Chandler Carruth283b3992014-04-21 22:55:11 +000040#define DEBUG_TYPE "ir"
41
Owen Andersone2942c02009-08-04 22:55:26 +000042namespace llvm {
Owen Andersone2942c02009-08-04 22:55:26 +000043
44/// UnaryConstantExpr - This class is private to Constants.cpp, and is used
45/// behind the scenes to implement unary constant exprs.
Benjamin Kramer55c06ae2013-09-11 18:05:11 +000046class UnaryConstantExpr : public ConstantExpr {
Owen Andersone2942c02009-08-04 22:55:26 +000047public:
Chris Lattnerdb125cf2011-07-18 04:54:35 +000048 UnaryConstantExpr(unsigned Opcode, Constant *C, Type *Ty)
Owen Andersone2942c02009-08-04 22:55:26 +000049 : ConstantExpr(Ty, Opcode, &Op<0>(), 1) {
50 Op<0>() = C;
51 }
Eugene Zelenko553d8c82016-12-07 22:06:02 +000052
53 // allocate space for exactly one operand
54 void *operator new(size_t s) {
55 return User::operator new(s, 1);
56 }
57
Owen Andersone2942c02009-08-04 22:55:26 +000058 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
59};
60
61/// BinaryConstantExpr - This class is private to Constants.cpp, and is used
62/// behind the scenes to implement binary constant exprs.
Benjamin Kramer55c06ae2013-09-11 18:05:11 +000063class BinaryConstantExpr : public ConstantExpr {
Owen Andersone2942c02009-08-04 22:55:26 +000064public:
Dan Gohmanf8dbee72009-09-07 23:54:19 +000065 BinaryConstantExpr(unsigned Opcode, Constant *C1, Constant *C2,
66 unsigned Flags)
Owen Andersone2942c02009-08-04 22:55:26 +000067 : ConstantExpr(C1->getType(), Opcode, &Op<0>(), 2) {
68 Op<0>() = C1;
69 Op<1>() = C2;
Dan Gohmanf8dbee72009-09-07 23:54:19 +000070 SubclassOptionalData = Flags;
Owen Andersone2942c02009-08-04 22:55:26 +000071 }
Eugene Zelenko553d8c82016-12-07 22:06:02 +000072
73 // allocate space for exactly two operands
74 void *operator new(size_t s) {
75 return User::operator new(s, 2);
76 }
77
Owen Andersone2942c02009-08-04 22:55:26 +000078 /// Transparently provide more efficient getOperand methods.
79 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
80};
81
82/// SelectConstantExpr - This class is private to Constants.cpp, and is used
83/// behind the scenes to implement select constant exprs.
Benjamin Kramer55c06ae2013-09-11 18:05:11 +000084class SelectConstantExpr : public ConstantExpr {
Owen Andersone2942c02009-08-04 22:55:26 +000085public:
Owen Andersone2942c02009-08-04 22:55:26 +000086 SelectConstantExpr(Constant *C1, Constant *C2, Constant *C3)
87 : ConstantExpr(C2->getType(), Instruction::Select, &Op<0>(), 3) {
88 Op<0>() = C1;
89 Op<1>() = C2;
90 Op<2>() = C3;
91 }
Eugene Zelenko553d8c82016-12-07 22:06:02 +000092
93 // allocate space for exactly three operands
94 void *operator new(size_t s) {
95 return User::operator new(s, 3);
96 }
97
Owen Andersone2942c02009-08-04 22:55:26 +000098 /// Transparently provide more efficient getOperand methods.
99 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
100};
101
102/// ExtractElementConstantExpr - This class is private to
103/// Constants.cpp, and is used behind the scenes to implement
104/// extractelement constant exprs.
Benjamin Kramer55c06ae2013-09-11 18:05:11 +0000105class ExtractElementConstantExpr : public ConstantExpr {
Owen Andersone2942c02009-08-04 22:55:26 +0000106public:
Owen Andersone2942c02009-08-04 22:55:26 +0000107 ExtractElementConstantExpr(Constant *C1, Constant *C2)
Eric Christopher8b6f5f02015-05-18 21:49:02 +0000108 : ConstantExpr(cast<VectorType>(C1->getType())->getElementType(),
Owen Andersone2942c02009-08-04 22:55:26 +0000109 Instruction::ExtractElement, &Op<0>(), 2) {
110 Op<0>() = C1;
111 Op<1>() = C2;
112 }
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000113
114 // allocate space for exactly two operands
115 void *operator new(size_t s) {
116 return User::operator new(s, 2);
117 }
118
Owen Andersone2942c02009-08-04 22:55:26 +0000119 /// Transparently provide more efficient getOperand methods.
120 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
121};
122
123/// InsertElementConstantExpr - This class is private to
124/// Constants.cpp, and is used behind the scenes to implement
125/// insertelement constant exprs.
Benjamin Kramer55c06ae2013-09-11 18:05:11 +0000126class InsertElementConstantExpr : public ConstantExpr {
Owen Andersone2942c02009-08-04 22:55:26 +0000127public:
Owen Andersone2942c02009-08-04 22:55:26 +0000128 InsertElementConstantExpr(Constant *C1, Constant *C2, Constant *C3)
Eric Christopher8b6f5f02015-05-18 21:49:02 +0000129 : ConstantExpr(C1->getType(), Instruction::InsertElement,
Owen Andersone2942c02009-08-04 22:55:26 +0000130 &Op<0>(), 3) {
131 Op<0>() = C1;
132 Op<1>() = C2;
133 Op<2>() = C3;
134 }
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000135
136 // allocate space for exactly three operands
137 void *operator new(size_t s) {
138 return User::operator new(s, 3);
139 }
140
Owen Andersone2942c02009-08-04 22:55:26 +0000141 /// Transparently provide more efficient getOperand methods.
142 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
143};
144
145/// ShuffleVectorConstantExpr - This class is private to
146/// Constants.cpp, and is used behind the scenes to implement
147/// shufflevector constant exprs.
Benjamin Kramer55c06ae2013-09-11 18:05:11 +0000148class ShuffleVectorConstantExpr : public ConstantExpr {
Owen Andersone2942c02009-08-04 22:55:26 +0000149public:
Owen Andersone2942c02009-08-04 22:55:26 +0000150 ShuffleVectorConstantExpr(Constant *C1, Constant *C2, Constant *C3)
151 : ConstantExpr(VectorType::get(
152 cast<VectorType>(C1->getType())->getElementType(),
153 cast<VectorType>(C3->getType())->getNumElements()),
Eric Christopher8b6f5f02015-05-18 21:49:02 +0000154 Instruction::ShuffleVector,
Owen Andersone2942c02009-08-04 22:55:26 +0000155 &Op<0>(), 3) {
156 Op<0>() = C1;
157 Op<1>() = C2;
158 Op<2>() = C3;
159 }
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000160
161 // allocate space for exactly three operands
162 void *operator new(size_t s) {
163 return User::operator new(s, 3);
164 }
165
Owen Andersone2942c02009-08-04 22:55:26 +0000166 /// Transparently provide more efficient getOperand methods.
167 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
168};
169
170/// ExtractValueConstantExpr - This class is private to
171/// Constants.cpp, and is used behind the scenes to implement
172/// extractvalue constant exprs.
Benjamin Kramer55c06ae2013-09-11 18:05:11 +0000173class ExtractValueConstantExpr : public ConstantExpr {
Owen Andersone2942c02009-08-04 22:55:26 +0000174public:
Duncan P. N. Exon Smithfd0a8132014-08-19 00:23:17 +0000175 ExtractValueConstantExpr(Constant *Agg, ArrayRef<unsigned> IdxList,
Chris Lattnerdb125cf2011-07-18 04:54:35 +0000176 Type *DestTy)
Duncan P. N. Exon Smithfd0a8132014-08-19 00:23:17 +0000177 : ConstantExpr(DestTy, Instruction::ExtractValue, &Op<0>(), 1),
178 Indices(IdxList.begin(), IdxList.end()) {
Owen Andersone2942c02009-08-04 22:55:26 +0000179 Op<0>() = Agg;
180 }
181
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000182 // allocate space for exactly one operand
183 void *operator new(size_t s) {
184 return User::operator new(s, 1);
185 }
186
Owen Andersone2942c02009-08-04 22:55:26 +0000187 /// Indices - These identify which value to extract.
188 const SmallVector<unsigned, 4> Indices;
189
190 /// Transparently provide more efficient getOperand methods.
191 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
Craig Topper07e8f882015-12-15 06:11:36 +0000192
193 static bool classof(const ConstantExpr *CE) {
194 return CE->getOpcode() == Instruction::ExtractValue;
195 }
196 static bool classof(const Value *V) {
197 return isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V));
198 }
Owen Andersone2942c02009-08-04 22:55:26 +0000199};
200
201/// InsertValueConstantExpr - This class is private to
202/// Constants.cpp, and is used behind the scenes to implement
203/// insertvalue constant exprs.
Benjamin Kramer55c06ae2013-09-11 18:05:11 +0000204class InsertValueConstantExpr : public ConstantExpr {
Owen Andersone2942c02009-08-04 22:55:26 +0000205public:
Owen Andersone2942c02009-08-04 22:55:26 +0000206 InsertValueConstantExpr(Constant *Agg, Constant *Val,
Duncan P. N. Exon Smithfd0a8132014-08-19 00:23:17 +0000207 ArrayRef<unsigned> IdxList, Type *DestTy)
208 : ConstantExpr(DestTy, Instruction::InsertValue, &Op<0>(), 2),
209 Indices(IdxList.begin(), IdxList.end()) {
Owen Andersone2942c02009-08-04 22:55:26 +0000210 Op<0>() = Agg;
211 Op<1>() = Val;
212 }
213
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000214 // allocate space for exactly one operand
215 void *operator new(size_t s) {
216 return User::operator new(s, 2);
217 }
218
Owen Andersone2942c02009-08-04 22:55:26 +0000219 /// Indices - These identify the position for the insertion.
220 const SmallVector<unsigned, 4> Indices;
221
222 /// Transparently provide more efficient getOperand methods.
223 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
Craig Topper07e8f882015-12-15 06:11:36 +0000224
225 static bool classof(const ConstantExpr *CE) {
226 return CE->getOpcode() == Instruction::InsertValue;
227 }
228 static bool classof(const Value *V) {
229 return isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V));
230 }
Owen Andersone2942c02009-08-04 22:55:26 +0000231};
232
Owen Andersone2942c02009-08-04 22:55:26 +0000233/// GetElementPtrConstantExpr - This class is private to Constants.cpp, and is
234/// used behind the scenes to implement getelementpr constant exprs.
Benjamin Kramer55c06ae2013-09-11 18:05:11 +0000235class GetElementPtrConstantExpr : public ConstantExpr {
David Blaikie66583e42015-05-08 00:42:26 +0000236 Type *SrcElementTy;
Eduard Burtescuf70dc422016-01-19 17:28:00 +0000237 Type *ResElementTy;
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000238
David Blaikie66583e42015-05-08 00:42:26 +0000239 GetElementPtrConstantExpr(Type *SrcElementTy, Constant *C,
240 ArrayRef<Constant *> IdxList, Type *DestTy);
241
Owen Andersone2942c02009-08-04 22:55:26 +0000242public:
David Blaikie66583e42015-05-08 00:42:26 +0000243 static GetElementPtrConstantExpr *Create(Type *SrcElementTy, Constant *C,
244 ArrayRef<Constant *> IdxList,
245 Type *DestTy, unsigned Flags) {
246 GetElementPtrConstantExpr *Result = new (IdxList.size() + 1)
247 GetElementPtrConstantExpr(SrcElementTy, C, IdxList, DestTy);
Dan Gohmanf8dbee72009-09-07 23:54:19 +0000248 Result->SubclassOptionalData = Flags;
249 return Result;
Owen Andersone2942c02009-08-04 22:55:26 +0000250 }
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000251
David Blaikie66583e42015-05-08 00:42:26 +0000252 Type *getSourceElementType() const;
Eduard Burtescuf70dc422016-01-19 17:28:00 +0000253 Type *getResultElementType() const;
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000254
Owen Andersone2942c02009-08-04 22:55:26 +0000255 /// Transparently provide more efficient getOperand methods.
256 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
Craig Topper07e8f882015-12-15 06:11:36 +0000257
258 static bool classof(const ConstantExpr *CE) {
259 return CE->getOpcode() == Instruction::GetElementPtr;
260 }
261 static bool classof(const Value *V) {
262 return isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V));
263 }
Owen Andersone2942c02009-08-04 22:55:26 +0000264};
265
266// CompareConstantExpr - This class is private to Constants.cpp, and is used
267// behind the scenes to implement ICmp and FCmp constant expressions. This is
268// needed in order to store the predicate value for these instructions.
Benjamin Kramer55c06ae2013-09-11 18:05:11 +0000269class CompareConstantExpr : public ConstantExpr {
David Blaikie2d24e2a2011-12-20 02:50:00 +0000270public:
Owen Andersone2942c02009-08-04 22:55:26 +0000271 unsigned short predicate;
Chris Lattnerdb125cf2011-07-18 04:54:35 +0000272 CompareConstantExpr(Type *ty, Instruction::OtherOps opc,
Owen Andersone2942c02009-08-04 22:55:26 +0000273 unsigned short pred, Constant* LHS, Constant* RHS)
274 : ConstantExpr(ty, opc, &Op<0>(), 2), predicate(pred) {
275 Op<0>() = LHS;
276 Op<1>() = RHS;
277 }
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000278
279 // allocate space for exactly two operands
280 void *operator new(size_t s) {
281 return User::operator new(s, 2);
282 }
283
Owen Andersone2942c02009-08-04 22:55:26 +0000284 /// Transparently provide more efficient getOperand methods.
285 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
Craig Topper07e8f882015-12-15 06:11:36 +0000286
287 static bool classof(const ConstantExpr *CE) {
288 return CE->getOpcode() == Instruction::ICmp ||
289 CE->getOpcode() == Instruction::FCmp;
290 }
291 static bool classof(const Value *V) {
292 return isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V));
293 }
Owen Andersone2942c02009-08-04 22:55:26 +0000294};
295
296template <>
Eric Christopher8b6f5f02015-05-18 21:49:02 +0000297struct OperandTraits<UnaryConstantExpr>
298 : public FixedNumOperandTraits<UnaryConstantExpr, 1> {};
Owen Andersone2942c02009-08-04 22:55:26 +0000299DEFINE_TRANSPARENT_OPERAND_ACCESSORS(UnaryConstantExpr, Value)
300
301template <>
Eric Christopher8b6f5f02015-05-18 21:49:02 +0000302struct OperandTraits<BinaryConstantExpr>
303 : public FixedNumOperandTraits<BinaryConstantExpr, 2> {};
Owen Andersone2942c02009-08-04 22:55:26 +0000304DEFINE_TRANSPARENT_OPERAND_ACCESSORS(BinaryConstantExpr, Value)
305
306template <>
Eric Christopher8b6f5f02015-05-18 21:49:02 +0000307struct OperandTraits<SelectConstantExpr>
308 : public FixedNumOperandTraits<SelectConstantExpr, 3> {};
Owen Andersone2942c02009-08-04 22:55:26 +0000309DEFINE_TRANSPARENT_OPERAND_ACCESSORS(SelectConstantExpr, Value)
310
311template <>
Eric Christopher8b6f5f02015-05-18 21:49:02 +0000312struct OperandTraits<ExtractElementConstantExpr>
313 : public FixedNumOperandTraits<ExtractElementConstantExpr, 2> {};
Owen Andersone2942c02009-08-04 22:55:26 +0000314DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ExtractElementConstantExpr, Value)
315
316template <>
Eric Christopher8b6f5f02015-05-18 21:49:02 +0000317struct OperandTraits<InsertElementConstantExpr>
318 : public FixedNumOperandTraits<InsertElementConstantExpr, 3> {};
Owen Andersone2942c02009-08-04 22:55:26 +0000319DEFINE_TRANSPARENT_OPERAND_ACCESSORS(InsertElementConstantExpr, Value)
320
321template <>
Eric Christopher8b6f5f02015-05-18 21:49:02 +0000322struct OperandTraits<ShuffleVectorConstantExpr>
323 : public FixedNumOperandTraits<ShuffleVectorConstantExpr, 3> {};
Owen Andersone2942c02009-08-04 22:55:26 +0000324DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ShuffleVectorConstantExpr, Value)
325
326template <>
Eric Christopher8b6f5f02015-05-18 21:49:02 +0000327struct OperandTraits<ExtractValueConstantExpr>
328 : public FixedNumOperandTraits<ExtractValueConstantExpr, 1> {};
Owen Andersone2942c02009-08-04 22:55:26 +0000329DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ExtractValueConstantExpr, Value)
330
331template <>
Eric Christopher8b6f5f02015-05-18 21:49:02 +0000332struct OperandTraits<InsertValueConstantExpr>
333 : public FixedNumOperandTraits<InsertValueConstantExpr, 2> {};
Owen Andersone2942c02009-08-04 22:55:26 +0000334DEFINE_TRANSPARENT_OPERAND_ACCESSORS(InsertValueConstantExpr, Value)
335
336template <>
Eric Christopher8b6f5f02015-05-18 21:49:02 +0000337struct OperandTraits<GetElementPtrConstantExpr>
338 : public VariadicOperandTraits<GetElementPtrConstantExpr, 1> {};
Owen Andersone2942c02009-08-04 22:55:26 +0000339
340DEFINE_TRANSPARENT_OPERAND_ACCESSORS(GetElementPtrConstantExpr, Value)
341
Owen Andersone2942c02009-08-04 22:55:26 +0000342template <>
Eric Christopher8b6f5f02015-05-18 21:49:02 +0000343struct OperandTraits<CompareConstantExpr>
344 : public FixedNumOperandTraits<CompareConstantExpr, 2> {};
Owen Andersone2942c02009-08-04 22:55:26 +0000345DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CompareConstantExpr, Value)
346
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000347template <class ConstantClass> struct ConstantAggrKeyType;
348struct InlineAsmKeyType;
349struct ConstantExprKeyType;
350
351template <class ConstantClass> struct ConstantInfo;
352template <> struct ConstantInfo<ConstantExpr> {
Eugene Zelenko46795222017-05-15 21:57:41 +0000353 using ValType = ConstantExprKeyType;
354 using TypeClass = Type;
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000355};
356template <> struct ConstantInfo<InlineAsm> {
Eugene Zelenko46795222017-05-15 21:57:41 +0000357 using ValType = InlineAsmKeyType;
358 using TypeClass = PointerType;
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000359};
360template <> struct ConstantInfo<ConstantArray> {
Eugene Zelenko46795222017-05-15 21:57:41 +0000361 using ValType = ConstantAggrKeyType<ConstantArray>;
362 using TypeClass = ArrayType;
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000363};
364template <> struct ConstantInfo<ConstantStruct> {
Eugene Zelenko46795222017-05-15 21:57:41 +0000365 using ValType = ConstantAggrKeyType<ConstantStruct>;
366 using TypeClass = StructType;
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000367};
368template <> struct ConstantInfo<ConstantVector> {
Eugene Zelenko46795222017-05-15 21:57:41 +0000369 using ValType = ConstantAggrKeyType<ConstantVector>;
370 using TypeClass = VectorType;
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000371};
372
373template <class ConstantClass> struct ConstantAggrKeyType {
374 ArrayRef<Constant *> Operands;
Eugene Zelenko46795222017-05-15 21:57:41 +0000375
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000376 ConstantAggrKeyType(ArrayRef<Constant *> Operands) : Operands(Operands) {}
Eugene Zelenko46795222017-05-15 21:57:41 +0000377
Duncan P. N. Exon Smithbb69ce82014-08-19 19:13:30 +0000378 ConstantAggrKeyType(ArrayRef<Constant *> Operands, const ConstantClass *)
379 : Operands(Operands) {}
Eugene Zelenko46795222017-05-15 21:57:41 +0000380
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000381 ConstantAggrKeyType(const ConstantClass *C,
382 SmallVectorImpl<Constant *> &Storage) {
383 assert(Storage.empty() && "Expected empty storage");
384 for (unsigned I = 0, E = C->getNumOperands(); I != E; ++I)
385 Storage.push_back(C->getOperand(I));
386 Operands = Storage;
Duncan P. N. Exon Smithfe0bf8f2014-08-19 01:02:18 +0000387 }
388
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000389 bool operator==(const ConstantAggrKeyType &X) const {
390 return Operands == X.Operands;
391 }
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000392
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000393 bool operator==(const ConstantClass *C) const {
394 if (Operands.size() != C->getNumOperands())
395 return false;
396 for (unsigned I = 0, E = Operands.size(); I != E; ++I)
397 if (Operands[I] != C->getOperand(I))
398 return false;
399 return true;
400 }
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000401
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000402 unsigned getHash() const {
403 return hash_combine_range(Operands.begin(), Operands.end());
404 }
405
Eugene Zelenko46795222017-05-15 21:57:41 +0000406 using TypeClass = typename ConstantInfo<ConstantClass>::TypeClass;
407
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000408 ConstantClass *create(TypeClass *Ty) const {
409 return new (Operands.size()) ConstantClass(Ty, Operands);
Duncan P. N. Exon Smithfe0bf8f2014-08-19 01:02:18 +0000410 }
411};
Owen Andersone2942c02009-08-04 22:55:26 +0000412
Benjamin Kramer55c06ae2013-09-11 18:05:11 +0000413struct InlineAsmKeyType {
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000414 StringRef AsmString;
415 StringRef Constraints;
David Blaikie04180d02015-07-28 00:06:38 +0000416 FunctionType *FTy;
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000417 bool HasSideEffects;
418 bool IsAlignStack;
419 InlineAsm::AsmDialect AsmDialect;
420
421 InlineAsmKeyType(StringRef AsmString, StringRef Constraints,
David Blaikie04180d02015-07-28 00:06:38 +0000422 FunctionType *FTy, bool HasSideEffects, bool IsAlignStack,
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000423 InlineAsm::AsmDialect AsmDialect)
David Blaikie04180d02015-07-28 00:06:38 +0000424 : AsmString(AsmString), Constraints(Constraints), FTy(FTy),
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000425 HasSideEffects(HasSideEffects), IsAlignStack(IsAlignStack),
426 AsmDialect(AsmDialect) {}
Eugene Zelenko46795222017-05-15 21:57:41 +0000427
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000428 InlineAsmKeyType(const InlineAsm *Asm, SmallVectorImpl<Constant *> &)
429 : AsmString(Asm->getAsmString()), Constraints(Asm->getConstraintString()),
David Blaikie04180d02015-07-28 00:06:38 +0000430 FTy(Asm->getFunctionType()), HasSideEffects(Asm->hasSideEffects()),
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000431 IsAlignStack(Asm->isAlignStack()), AsmDialect(Asm->getDialect()) {}
432
433 bool operator==(const InlineAsmKeyType &X) const {
434 return HasSideEffects == X.HasSideEffects &&
435 IsAlignStack == X.IsAlignStack && AsmDialect == X.AsmDialect &&
David Blaikie04180d02015-07-28 00:06:38 +0000436 AsmString == X.AsmString && Constraints == X.Constraints &&
437 FTy == X.FTy;
Jeffrey Yasskinbf48a9b2010-03-21 20:37:19 +0000438 }
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000439
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000440 bool operator==(const InlineAsm *Asm) const {
441 return HasSideEffects == Asm->hasSideEffects() &&
442 IsAlignStack == Asm->isAlignStack() &&
443 AsmDialect == Asm->getDialect() &&
444 AsmString == Asm->getAsmString() &&
David Blaikie04180d02015-07-28 00:06:38 +0000445 Constraints == Asm->getConstraintString() &&
446 FTy == Asm->getFunctionType();
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000447 }
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000448
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000449 unsigned getHash() const {
450 return hash_combine(AsmString, Constraints, HasSideEffects, IsAlignStack,
David Blaikie04180d02015-07-28 00:06:38 +0000451 AsmDialect, FTy);
Jeffrey Yasskinbf48a9b2010-03-21 20:37:19 +0000452 }
453
Eugene Zelenko46795222017-05-15 21:57:41 +0000454 using TypeClass = ConstantInfo<InlineAsm>::TypeClass;
455
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000456 InlineAsm *create(TypeClass *Ty) const {
David Blaikie04180d02015-07-28 00:06:38 +0000457 assert(PointerType::getUnqual(FTy) == Ty);
458 return new InlineAsm(FTy, AsmString, Constraints, HasSideEffects,
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000459 IsAlignStack, AsmDialect);
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000460 }
461};
462
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000463struct ConstantExprKeyType {
464 uint8_t Opcode;
465 uint8_t SubclassOptionalData;
466 uint16_t SubclassData;
467 ArrayRef<Constant *> Ops;
468 ArrayRef<unsigned> Indexes;
David Blaikie66583e42015-05-08 00:42:26 +0000469 Type *ExplicitTy;
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000470
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000471 ConstantExprKeyType(unsigned Opcode, ArrayRef<Constant *> Ops,
472 unsigned short SubclassData = 0,
473 unsigned short SubclassOptionalData = 0,
David Blaikie66583e42015-05-08 00:42:26 +0000474 ArrayRef<unsigned> Indexes = None,
475 Type *ExplicitTy = nullptr)
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000476 : Opcode(Opcode), SubclassOptionalData(SubclassOptionalData),
David Blaikie66583e42015-05-08 00:42:26 +0000477 SubclassData(SubclassData), Ops(Ops), Indexes(Indexes),
478 ExplicitTy(ExplicitTy) {}
Eugene Zelenko46795222017-05-15 21:57:41 +0000479
Duncan P. N. Exon Smithbb69ce82014-08-19 19:13:30 +0000480 ConstantExprKeyType(ArrayRef<Constant *> Operands, const ConstantExpr *CE)
481 : Opcode(CE->getOpcode()),
482 SubclassOptionalData(CE->getRawSubclassOptionalData()),
483 SubclassData(CE->isCompare() ? CE->getPredicate() : 0), Ops(Operands),
484 Indexes(CE->hasIndices() ? CE->getIndices() : ArrayRef<unsigned>()) {}
Eugene Zelenko46795222017-05-15 21:57:41 +0000485
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000486 ConstantExprKeyType(const ConstantExpr *CE,
487 SmallVectorImpl<Constant *> &Storage)
488 : Opcode(CE->getOpcode()),
489 SubclassOptionalData(CE->getRawSubclassOptionalData()),
490 SubclassData(CE->isCompare() ? CE->getPredicate() : 0),
491 Indexes(CE->hasIndices() ? CE->getIndices() : ArrayRef<unsigned>()) {
492 assert(Storage.empty() && "Expected empty storage");
493 for (unsigned I = 0, E = CE->getNumOperands(); I != E; ++I)
494 Storage.push_back(CE->getOperand(I));
495 Ops = Storage;
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000496 }
497
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000498 bool operator==(const ConstantExprKeyType &X) const {
499 return Opcode == X.Opcode && SubclassData == X.SubclassData &&
500 SubclassOptionalData == X.SubclassOptionalData && Ops == X.Ops &&
501 Indexes == X.Indexes;
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000502 }
503
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000504 bool operator==(const ConstantExpr *CE) const {
505 if (Opcode != CE->getOpcode())
506 return false;
507 if (SubclassOptionalData != CE->getRawSubclassOptionalData())
508 return false;
509 if (Ops.size() != CE->getNumOperands())
510 return false;
511 if (SubclassData != (CE->isCompare() ? CE->getPredicate() : 0))
512 return false;
513 for (unsigned I = 0, E = Ops.size(); I != E; ++I)
514 if (Ops[I] != CE->getOperand(I))
515 return false;
516 if (Indexes != (CE->hasIndices() ? CE->getIndices() : ArrayRef<unsigned>()))
517 return false;
518 return true;
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000519 }
520
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000521 unsigned getHash() const {
522 return hash_combine(Opcode, SubclassOptionalData, SubclassData,
523 hash_combine_range(Ops.begin(), Ops.end()),
524 hash_combine_range(Indexes.begin(), Indexes.end()));
Aaron Ballman93710f02014-08-19 14:59:02 +0000525 }
Aaron Ballman93710f02014-08-19 14:59:02 +0000526
Eugene Zelenko46795222017-05-15 21:57:41 +0000527 using TypeClass = ConstantInfo<ConstantExpr>::TypeClass;
528
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000529 ConstantExpr *create(TypeClass *Ty) const {
530 switch (Opcode) {
531 default:
Cameron McInallyca8cb682018-11-13 18:15:47 +0000532 if (Instruction::isCast(Opcode) ||
533 (Opcode >= Instruction::UnaryOpsBegin &&
534 Opcode < Instruction::UnaryOpsEnd))
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000535 return new UnaryConstantExpr(Opcode, Ops[0], Ty);
536 if ((Opcode >= Instruction::BinaryOpsBegin &&
537 Opcode < Instruction::BinaryOpsEnd))
538 return new BinaryConstantExpr(Opcode, Ops[0], Ops[1],
539 SubclassOptionalData);
540 llvm_unreachable("Invalid ConstantExpr!");
541 case Instruction::Select:
542 return new SelectConstantExpr(Ops[0], Ops[1], Ops[2]);
543 case Instruction::ExtractElement:
544 return new ExtractElementConstantExpr(Ops[0], Ops[1]);
545 case Instruction::InsertElement:
546 return new InsertElementConstantExpr(Ops[0], Ops[1], Ops[2]);
547 case Instruction::ShuffleVector:
548 return new ShuffleVectorConstantExpr(Ops[0], Ops[1], Ops[2]);
549 case Instruction::InsertValue:
550 return new InsertValueConstantExpr(Ops[0], Ops[1], Indexes, Ty);
551 case Instruction::ExtractValue:
552 return new ExtractValueConstantExpr(Ops[0], Indexes, Ty);
553 case Instruction::GetElementPtr:
David Blaikie66583e42015-05-08 00:42:26 +0000554 return GetElementPtrConstantExpr::Create(
555 ExplicitTy ? ExplicitTy
556 : cast<PointerType>(Ops[0]->getType()->getScalarType())
557 ->getElementType(),
558 Ops[0], Ops.slice(1), Ty, SubclassOptionalData);
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000559 case Instruction::ICmp:
560 return new CompareConstantExpr(Ty, Instruction::ICmp, SubclassData,
561 Ops[0], Ops[1]);
562 case Instruction::FCmp:
563 return new CompareConstantExpr(Ty, Instruction::FCmp, SubclassData,
564 Ops[0], Ops[1]);
Aaron Ballman93710f02014-08-19 14:59:02 +0000565 }
Aaron Ballman93710f02014-08-19 14:59:02 +0000566 }
567};
568
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000569template <class ConstantClass> class ConstantUniqueMap {
Aaron Ballman93710f02014-08-19 14:59:02 +0000570public:
Eugene Zelenko46795222017-05-15 21:57:41 +0000571 using ValType = typename ConstantInfo<ConstantClass>::ValType;
572 using TypeClass = typename ConstantInfo<ConstantClass>::TypeClass;
573 using LookupKey = std::pair<TypeClass *, ValType>;
Aaron Ballman93710f02014-08-19 14:59:02 +0000574
Mehdi Aminif73f5cd2016-03-07 00:51:00 +0000575 /// Key and hash together, so that we compute the hash only once and reuse it.
Eugene Zelenko46795222017-05-15 21:57:41 +0000576 using LookupKeyHashed = std::pair<unsigned, LookupKey>;
Mehdi Aminif73f5cd2016-03-07 00:51:00 +0000577
Owen Andersone2942c02009-08-04 22:55:26 +0000578private:
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000579 struct MapInfo {
Eugene Zelenko46795222017-05-15 21:57:41 +0000580 using ConstantClassInfo = DenseMapInfo<ConstantClass *>;
581
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000582 static inline ConstantClass *getEmptyKey() {
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000583 return ConstantClassInfo::getEmptyKey();
584 }
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000585
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000586 static inline ConstantClass *getTombstoneKey() {
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000587 return ConstantClassInfo::getTombstoneKey();
588 }
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000589
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000590 static unsigned getHashValue(const ConstantClass *CP) {
Mehdi Aminic3a95b92016-04-19 00:17:55 +0000591 SmallVector<Constant *, 32> Storage;
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000592 return getHashValue(LookupKey(CP->getType(), ValType(CP, Storage)));
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000593 }
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000594
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000595 static bool isEqual(const ConstantClass *LHS, const ConstantClass *RHS) {
596 return LHS == RHS;
597 }
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000598
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000599 static unsigned getHashValue(const LookupKey &Val) {
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000600 return hash_combine(Val.first, Val.second.getHash());
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000601 }
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000602
Mehdi Aminif73f5cd2016-03-07 00:51:00 +0000603 static unsigned getHashValue(const LookupKeyHashed &Val) {
604 return Val.first;
605 }
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000606
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000607 static bool isEqual(const LookupKey &LHS, const ConstantClass *RHS) {
608 if (RHS == getEmptyKey() || RHS == getTombstoneKey())
609 return false;
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000610 if (LHS.first != RHS->getType())
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000611 return false;
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000612 return LHS.second == RHS;
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000613 }
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000614
Mehdi Aminif73f5cd2016-03-07 00:51:00 +0000615 static bool isEqual(const LookupKeyHashed &LHS, const ConstantClass *RHS) {
616 return isEqual(LHS.second, RHS);
617 }
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000618 };
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000619
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000620public:
Eugene Zelenko46795222017-05-15 21:57:41 +0000621 using MapTy = DenseSet<ConstantClass *, MapInfo>;
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000622
623private:
Owen Andersone2942c02009-08-04 22:55:26 +0000624 MapTy Map;
Owen Andersone2942c02009-08-04 22:55:26 +0000625
Owen Andersone2942c02009-08-04 22:55:26 +0000626public:
Duncan P. N. Exon Smitha15c0e92016-04-06 17:56:08 +0000627 typename MapTy::iterator begin() { return Map.begin(); }
628 typename MapTy::iterator end() { return Map.end(); }
Torok Edwin2cd51552009-08-31 16:14:59 +0000629
630 void freeConstants() {
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000631 for (auto &I : Map)
Duncan P. N. Exon Smitha15c0e92016-04-06 17:56:08 +0000632 delete I; // Asserts that use_empty().
Owen Andersone2942c02009-08-04 22:55:26 +0000633 }
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000634
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000635private:
Mehdi Aminif73f5cd2016-03-07 00:51:00 +0000636 ConstantClass *create(TypeClass *Ty, ValType V, LookupKeyHashed &HashKey) {
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000637 ConstantClass *Result = V.create(Ty);
Owen Andersone2942c02009-08-04 22:55:26 +0000638
639 assert(Result->getType() == Ty && "Type specified is not correct!");
Duncan P. N. Exon Smitha15c0e92016-04-06 17:56:08 +0000640 Map.insert_as(Result, HashKey);
Owen Andersone2942c02009-08-04 22:55:26 +0000641
Owen Andersone2942c02009-08-04 22:55:26 +0000642 return Result;
643 }
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000644
Owen Andersone2942c02009-08-04 22:55:26 +0000645public:
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000646 /// Return the specified constant from the map, creating it if necessary.
647 ConstantClass *getOrCreate(TypeClass *Ty, ValType V) {
Mehdi Aminif73f5cd2016-03-07 00:51:00 +0000648 LookupKey Key(Ty, V);
649 /// Hash once, and reuse it for the lookup and the insertion if needed.
650 LookupKeyHashed Lookup(MapInfo::getHashValue(Key), Key);
651
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000652 ConstantClass *Result = nullptr;
Aaron Ballman93710f02014-08-19 14:59:02 +0000653
Mehdi Aminif73f5cd2016-03-07 00:51:00 +0000654 auto I = Map.find_as(Lookup);
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000655 if (I == Map.end())
Mehdi Aminif73f5cd2016-03-07 00:51:00 +0000656 Result = create(Ty, V, Lookup);
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000657 else
Duncan P. N. Exon Smitha15c0e92016-04-06 17:56:08 +0000658 Result = *I;
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000659 assert(Result && "Unexpected nullptr");
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000660
Owen Andersone2942c02009-08-04 22:55:26 +0000661 return Result;
662 }
663
Duncan P. N. Exon Smith78c0b352014-08-19 00:42:32 +0000664 /// Remove this constant from the map
Owen Andersone2942c02009-08-04 22:55:26 +0000665 void remove(ConstantClass *CP) {
Duncan P. N. Exon Smith7116af62014-08-19 16:39:58 +0000666 typename MapTy::iterator I = Map.find(CP);
Owen Andersone2942c02009-08-04 22:55:26 +0000667 assert(I != Map.end() && "Constant not found in constant table!");
Duncan P. N. Exon Smitha15c0e92016-04-06 17:56:08 +0000668 assert(*I == CP && "Didn't find correct element?");
Owen Andersone2942c02009-08-04 22:55:26 +0000669 Map.erase(I);
670 }
671
Duncan P. N. Exon Smithbb69ce82014-08-19 19:13:30 +0000672 ConstantClass *replaceOperandsInPlace(ArrayRef<Constant *> Operands,
673 ConstantClass *CP, Value *From,
674 Constant *To, unsigned NumUpdated = 0,
675 unsigned OperandNo = ~0u) {
Mehdi Aminif73f5cd2016-03-07 00:51:00 +0000676 LookupKey Key(CP->getType(), ValType(Operands, CP));
677 /// Hash once, and reuse it for the lookup and the insertion if needed.
678 LookupKeyHashed Lookup(MapInfo::getHashValue(Key), Key);
679
680 auto I = Map.find_as(Lookup);
Duncan P. N. Exon Smithbb69ce82014-08-19 19:13:30 +0000681 if (I != Map.end())
Duncan P. N. Exon Smitha15c0e92016-04-06 17:56:08 +0000682 return *I;
Duncan P. N. Exon Smithbb69ce82014-08-19 19:13:30 +0000683
684 // Update to the new value. Optimize for the case when we have a single
685 // operand that we're changing, but handle bulk updates efficiently.
686 remove(CP);
687 if (NumUpdated == 1) {
688 assert(OperandNo < CP->getNumOperands() && "Invalid index");
689 assert(CP->getOperand(OperandNo) != To && "I didn't contain From!");
690 CP->setOperand(OperandNo, To);
691 } else {
692 for (unsigned I = 0, E = CP->getNumOperands(); I != E; ++I)
693 if (CP->getOperand(I) == From)
694 CP->setOperand(I, To);
695 }
Duncan P. N. Exon Smitha15c0e92016-04-06 17:56:08 +0000696 Map.insert_as(CP, Lookup);
Duncan P. N. Exon Smithbb69ce82014-08-19 19:13:30 +0000697 return nullptr;
698 }
699
Nicola Zaghen0818e782018-05-14 12:53:11 +0000700 void dump() const {
701 LLVM_DEBUG(dbgs() << "Constant.cpp: ConstantUniqueMap\n");
702 }
Owen Andersone2942c02009-08-04 22:55:26 +0000703};
704
Duncan P. N. Exon Smith783d16f2014-08-19 00:21:04 +0000705} // end namespace llvm
Owen Andersone2942c02009-08-04 22:55:26 +0000706
Eugene Zelenko553d8c82016-12-07 22:06:02 +0000707#endif // LLVM_LIB_IR_CONSTANTSCONTEXT_H