clang 8.0.0

CGBuilder.h
Go to the documentation of this file.
1 //===-- CGBuilder.h - Choose IRBuilder implementation ----------*- 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 LLVM_CLANG_LIB_CODEGEN_CGBUILDER_H
11 #define LLVM_CLANG_LIB_CODEGEN_CGBUILDER_H
12
13 #include "llvm/IR/DataLayout.h"
14 #include "llvm/IR/IRBuilder.h"
15 #include "Address.h"
16 #include "CodeGenTypeCache.h"
17
18 namespace clang {
19 namespace CodeGen {
20
21 class CodeGenFunction;
22
23 /// This is an IRBuilder insertion helper that forwards to
24 /// CodeGenFunction::InsertHelper, which adds necessary metadata to
25 /// instructions.
26 class CGBuilderInserter : protected llvm::IRBuilderDefaultInserter {
27 public:
28 CGBuilderInserter() = default;
29 explicit CGBuilderInserter(CodeGenFunction *CGF) : CGF(CGF) {}
30
31 protected:
32 /// This forwards to CodeGenFunction::InsertHelper.
33 void InsertHelper(llvm::Instruction *I, const llvm::Twine &Name,
34 llvm::BasicBlock *BB,
35 llvm::BasicBlock::iterator InsertPt) const;
36 private:
37 CodeGenFunction *CGF = nullptr;
38 };
39
40 typedef CGBuilderInserter CGBuilderInserterTy;
41
42 typedef llvm::IRBuilder<llvm::ConstantFolder, CGBuilderInserterTy>
43 CGBuilderBaseTy;
44
45 class CGBuilderTy : public CGBuilderBaseTy {
46 /// Storing a reference to the type cache here makes it a lot easier
47 /// to build natural-feeling, target-specific IR.
48 const CodeGenTypeCache &TypeCache;
49 public:
50 CGBuilderTy(const CodeGenTypeCache &TypeCache, llvm::LLVMContext &C)
51 : CGBuilderBaseTy(C), TypeCache(TypeCache) {}
52 CGBuilderTy(const CodeGenTypeCache &TypeCache,
53 llvm::LLVMContext &C, const llvm::ConstantFolder &F,
54 const CGBuilderInserterTy &Inserter)
55 : CGBuilderBaseTy(C, F, Inserter), TypeCache(TypeCache) {}
56 CGBuilderTy(const CodeGenTypeCache &TypeCache, llvm::Instruction *I)
57 : CGBuilderBaseTy(I), TypeCache(TypeCache) {}
58 CGBuilderTy(const CodeGenTypeCache &TypeCache, llvm::BasicBlock *BB)
59 : CGBuilderBaseTy(BB), TypeCache(TypeCache) {}
60
61 llvm::ConstantInt *getSize(CharUnits N) {
62 return llvm::ConstantInt::get(TypeCache.SizeTy, N.getQuantity());
63 }
64 llvm::ConstantInt *getSize(uint64_t N) {
65 return llvm::ConstantInt::get(TypeCache.SizeTy, N);
66 }
67
68 // Note that we intentionally hide the CreateLoad APIs that don't
69 // take an alignment.
70 llvm::LoadInst *CreateLoad(Address Addr, const llvm::Twine &Name = "") {
71 return CreateAlignedLoad(Addr.getPointer(),
72 Addr.getAlignment().getQuantity(),
73 Name);
74 }
75 llvm::LoadInst *CreateLoad(Address Addr, const char *Name) {
76 // This overload is required to prevent string literals from
77 // ending up in the IsVolatile overload.
78 return CreateAlignedLoad(Addr.getPointer(),
79 Addr.getAlignment().getQuantity(),
80 Name);
81 }
82 llvm::LoadInst *CreateLoad(Address Addr, bool IsVolatile,
83 const llvm::Twine &Name = "") {
84 return CreateAlignedLoad(Addr.getPointer(),
85 Addr.getAlignment().getQuantity(),
86 IsVolatile,
87 Name);
88 }
89
90 using CGBuilderBaseTy::CreateAlignedLoad;
91 llvm::LoadInst *CreateAlignedLoad(llvm::Value *Addr, CharUnits Align,
92 const llvm::Twine &Name = "") {
93 return CreateAlignedLoad(Addr, Align.getQuantity(), Name);
94 }
95 llvm::LoadInst *CreateAlignedLoad(llvm::Value *Addr, CharUnits Align,
96 const char *Name) {
97 return CreateAlignedLoad(Addr, Align.getQuantity(), Name);
98 }
99 llvm::LoadInst *CreateAlignedLoad(llvm::Type *Ty, llvm::Value *Addr,
100 CharUnits Align,
101 const llvm::Twine &Name = "") {
102 assert(Addr->getType()->getPointerElementType() == Ty);
103 return CreateAlignedLoad(Addr, Align.getQuantity(), Name);
104 }
105
106 // Note that we intentionally hide the CreateStore APIs that don't
107 // take an alignment.
108 llvm::StoreInst *CreateStore(llvm::Value *Val, Address Addr,
109 bool IsVolatile = false) {
110 return CreateAlignedStore(Val, Addr.getPointer(),
111 Addr.getAlignment().getQuantity(), IsVolatile);
112 }
113
114 using CGBuilderBaseTy::CreateAlignedStore;
115 llvm::StoreInst *CreateAlignedStore(llvm::Value *Val, llvm::Value *Addr,
116 CharUnits Align, bool IsVolatile = false) {
117 return CreateAlignedStore(Val, Addr, Align.getQuantity(), IsVolatile);
118 }
119
120 // FIXME: these "default-aligned" APIs should be removed,
121 // but I don't feel like fixing all the builtin code right now.
122 llvm::StoreInst *CreateDefaultAlignedStore(llvm::Value *Val,
123 llvm::Value *Addr,
124 bool IsVolatile = false) {
125 return CGBuilderBaseTy::CreateStore(Val, Addr, IsVolatile);
126 }
127
128 /// Emit a load from an i1 flag variable.
129 llvm::LoadInst *CreateFlagLoad(llvm::Value *Addr,
130 const llvm::Twine &Name = "") {
131 assert(Addr->getType()->getPointerElementType() == getInt1Ty());
132 return CreateAlignedLoad(getInt1Ty(), Addr, CharUnits::One(), Name);
133 }
134
135 /// Emit a store to an i1 flag variable.
136 llvm::StoreInst *CreateFlagStore(bool Value, llvm::Value *Addr) {
137 assert(Addr->getType()->getPointerElementType() == getInt1Ty());
138 return CreateAlignedStore(getInt1(Value), Addr, CharUnits::One());
139 }
140
141 using CGBuilderBaseTy::CreateBitCast;
142 Address CreateBitCast(Address Addr, llvm::Type *Ty,
143 const llvm::Twine &Name = "") {
144 return Address(CreateBitCast(Addr.getPointer(), Ty, Name),
145 Addr.getAlignment());
146 }
147
148 using CGBuilderBaseTy::CreateAddrSpaceCast;
149 Address CreateAddrSpaceCast(Address Addr, llvm::Type *Ty,
150 const llvm::Twine &Name = "") {
151 return Address(CreateAddrSpaceCast(Addr.getPointer(), Ty, Name),
152 Addr.getAlignment());
153 }
154
155 /// Cast the element type of the given address to a different type,
156 /// preserving information like the alignment and address space.
157 Address CreateElementBitCast(Address Addr, llvm::Type *Ty,
158 const llvm::Twine &Name = "") {
159 auto PtrTy = Ty->getPointerTo(Addr.getAddressSpace());
160 return CreateBitCast(Addr, PtrTy, Name);
161 }
162
163 using CGBuilderBaseTy::CreatePointerBitCastOrAddrSpaceCast;
164 Address CreatePointerBitCastOrAddrSpaceCast(Address Addr, llvm::Type *Ty,
165 const llvm::Twine &Name = "") {
166 llvm::Value *Ptr =
167 CreatePointerBitCastOrAddrSpaceCast(Addr.getPointer(), Ty, Name);
168 return Address(Ptr, Addr.getAlignment());
169 }
170
171 using CGBuilderBaseTy::CreateStructGEP;
172 Address CreateStructGEP(Address Addr, unsigned Index, CharUnits Offset,
173 const llvm::Twine &Name = "") {
174 return Address(CreateStructGEP(Addr.getElementType(),
175 Addr.getPointer(), Index, Name),
176 Addr.getAlignment().alignmentAtOffset(Offset));
177 }
178 Address CreateStructGEP(Address Addr, unsigned Index,
179 const llvm::StructLayout *Layout,
180 const llvm::Twine &Name = "") {
181 auto Offset = CharUnits::fromQuantity(Layout->getElementOffset(Index));
182 return CreateStructGEP(Addr, Index, Offset, Name);
183 }
184
185 /// Given
186 /// %addr = [n x T]* ...
187 /// produce
188 /// %name = getelementptr inbounds %addr, i64 0, i64 index
189 /// where i64 is actually the target word size.
190 ///
191 /// This API assumes that drilling into an array like this is always
192 /// an inbounds operation.
193 ///
194 /// \param EltSize - the size of the type T in bytes
195 Address CreateConstArrayGEP(Address Addr, uint64_t Index, CharUnits EltSize,
196 const llvm::Twine &Name = "") {
197 return Address(CreateInBoundsGEP(Addr.getPointer(),
198 {getSize(CharUnits::Zero()),
199 getSize(Index)},
200 Name),
201 Addr.getAlignment().alignmentAtOffset(Index * EltSize));
202 }
203
204 /// Given
205 /// %addr = T* ...
206 /// produce
207 /// %name = getelementptr inbounds %addr, i64 index
208 /// where i64 is actually the target word size.
209 ///
210 /// \param EltSize - the size of the type T in bytes
211 Address CreateConstInBoundsGEP(Address Addr, uint64_t Index,
212 CharUnits EltSize,
213 const llvm::Twine &Name = "") {
214 return Address(CreateInBoundsGEP(Addr.getElementType(), Addr.getPointer(),
215 getSize(Index), Name),
216 Addr.getAlignment().alignmentAtOffset(Index * EltSize));
217 }
218
219 /// Given
220 /// %addr = T* ...
221 /// produce
222 /// %name = getelementptr inbounds %addr, i64 index
223 /// where i64 is actually the target word size.
224 ///
225 /// \param EltSize - the size of the type T in bytes
226 Address CreateConstGEP(Address Addr, uint64_t Index, CharUnits EltSize,
227 const llvm::Twine &Name = "") {
228 return Address(CreateGEP(Addr.getElementType(), Addr.getPointer(),
229 getSize(Index), Name),
230 Addr.getAlignment().alignmentAtOffset(Index * EltSize));
231 }
232
233 /// Given a pointer to i8, adjust it by a given constant offset.
234 Address CreateConstInBoundsByteGEP(Address Addr, CharUnits Offset,
235 const llvm::Twine &Name = "") {
236 assert(Addr.getElementType() == TypeCache.Int8Ty);
237 return Address(CreateInBoundsGEP(Addr.getPointer(), getSize(Offset), Name),
238 Addr.getAlignment().alignmentAtOffset(Offset));
239 }
240 Address CreateConstByteGEP(Address Addr, CharUnits Offset,
241 const llvm::Twine &Name = "") {
242 assert(Addr.getElementType() == TypeCache.Int8Ty);
243 return Address(CreateGEP(Addr.getPointer(), getSize(Offset), Name),
244 Addr.getAlignment().alignmentAtOffset(Offset));
245 }
246
247 using CGBuilderBaseTy::CreateConstInBoundsGEP2_32;
248 Address CreateConstInBoundsGEP2_32(Address Addr, unsigned Idx0,
249 unsigned Idx1, const llvm::DataLayout &DL,
250 const llvm::Twine &Name = "") {
251 auto *GEP = cast<llvm::GetElementPtrInst>(CreateConstInBoundsGEP2_32(
252 Addr.getElementType(), Addr.getPointer(), Idx0, Idx1, Name));
253 llvm::APInt Offset(
254 DL.getIndexSizeInBits(Addr.getType()->getPointerAddressSpace()), 0,
255 /*IsSigned=*/true);
256 if (!GEP->accumulateConstantOffset(DL, Offset))
257 llvm_unreachable("offset of GEP with constants is always computable");
258 return Address(GEP, Addr.getAlignment().alignmentAtOffset(
259 CharUnits::fromQuantity(Offset.getSExtValue())));
260 }
261
262 llvm::Value *CreateConstInBoundsByteGEP(llvm::Value *Ptr, CharUnits Offset,
263 const llvm::Twine &Name = "") {
264 assert(Ptr->getType()->getPointerElementType() == TypeCache.Int8Ty);
265 return CreateInBoundsGEP(Ptr, getSize(Offset), Name);
266 }
267 llvm::Value *CreateConstByteGEP(llvm::Value *Ptr, CharUnits Offset,
268 const llvm::Twine &Name = "") {
269 assert(Ptr->getType()->getPointerElementType() == TypeCache.Int8Ty);
270 return CreateGEP(Ptr, getSize(Offset), Name);
271 }
272
273 using CGBuilderBaseTy::CreateMemCpy;
274 llvm::CallInst *CreateMemCpy(Address Dest, Address Src, llvm::Value *Size,
275 bool IsVolatile = false) {
276 return CreateMemCpy(Dest.getPointer(), Dest.getAlignment().getQuantity(),
277 Src.getPointer(), Src.getAlignment().getQuantity(),
278 Size,IsVolatile);
279 }
280 llvm::CallInst *CreateMemCpy(Address Dest, Address Src, uint64_t Size,
281 bool IsVolatile = false) {
282 return CreateMemCpy(Dest.getPointer(), Dest.getAlignment().getQuantity(),
283 Src.getPointer(), Src.getAlignment().getQuantity(),
284 Size, IsVolatile);
285 }
286
287 using CGBuilderBaseTy::CreateMemMove;
288 llvm::CallInst *CreateMemMove(Address Dest, Address Src, llvm::Value *Size,
289 bool IsVolatile = false) {
290 return CreateMemMove(Dest.getPointer(), Dest.getAlignment().getQuantity(),
291 Src.getPointer(), Src.getAlignment().getQuantity(),
292 Size, IsVolatile);
293 }
294
295 using CGBuilderBaseTy::CreateMemSet;
296 llvm::CallInst *CreateMemSet(Address Dest, llvm::Value *Value,
297 llvm::Value *Size, bool IsVolatile = false) {
298 return CreateMemSet(Dest.getPointer(), Value, Size,
299 Dest.getAlignment().getQuantity(), IsVolatile);
300 }
301 };
302
303 } // end namespace CodeGen
304 } // end namespace clang
305
306 #endif
clang::CodeGen::CGBuilderTy::CGBuilderTy
CGBuilderTy(const CodeGenTypeCache &TypeCache, llvm::Instruction *I)
Definition: CGBuilder.h:56
clang::CodeGen::CGBuilderTy::CreateDefaultAlignedStore
llvm::StoreInst * CreateDefaultAlignedStore(llvm::Value *Val, llvm::Value *Addr, bool IsVolatile=false)
Definition: CGBuilder.h:122
clang::CodeGen::CGBuilderTy::CreateAddrSpaceCast
Address CreateAddrSpaceCast(Address Addr, llvm::Type *Ty, const llvm::Twine &Name="")
Definition: CGBuilder.h:149
clang::CodeGen::CGBuilderTy::CGBuilderTy
CGBuilderTy(const CodeGenTypeCache &TypeCache, llvm::BasicBlock *BB)
Definition: CGBuilder.h:58
clang::CodeGen::CGBuilderTy::CreateStructGEP
Address CreateStructGEP(Address Addr, unsigned Index, const llvm::StructLayout *Layout, const llvm::Twine &Name="")
Definition: CGBuilder.h:178
clang::CodeGen::CGBuilderTy::CreateConstGEP
Address CreateConstGEP(Address Addr, uint64_t Index, CharUnits EltSize, const llvm::Twine &Name="")
Given addr = T* ...
Definition: CGBuilder.h:226
clang::CodeGen::CGBuilderTy::getSize
llvm::ConstantInt * getSize(CharUnits N)
Definition: CGBuilder.h:61
clang::CodeGen::CGBuilderTy::getSize
llvm::ConstantInt * getSize(uint64_t N)
Definition: CGBuilder.h:64
clang::CodeGen::CodeGenTypeCache::Int8Ty
llvm::IntegerType * Int8Ty
i8, i16, i32, and i64
Definition: CodeGenTypeCache.h:38
Value
Value
Definition: UninitializedValues.cpp:102
clang::CodeGen::CGBuilderTy::CGBuilderTy
CGBuilderTy(const CodeGenTypeCache &TypeCache, llvm::LLVMContext &C, const llvm::ConstantFolder &F, const CGBuilderInserterTy &Inserter)
Definition: CGBuilder.h:52
clang::CodeGen::CGBuilderInserterTy
CGBuilderInserter CGBuilderInserterTy
Definition: CGBuilder.h:40
clang::CodeGen::CGBuilderTy::CreateConstInBoundsByteGEP
Address CreateConstInBoundsByteGEP(Address Addr, CharUnits Offset, const llvm::Twine &Name="")
Given a pointer to i8, adjust it by a given constant offset.
Definition: CGBuilder.h:234
clang::CodeGen::Address::getPointer
llvm::Value * getPointer() const
Definition: Address.h:38
clang::CodeGen::CGBuilderTy::CreateAlignedLoad
llvm::LoadInst * CreateAlignedLoad(llvm::Value *Addr, CharUnits Align, const char *Name)
Definition: CGBuilder.h:95
clang::CodeGen::Address::getAddressSpace
unsigned getAddressSpace() const
Return the address space that this address resides in.
Definition: Address.h:57
clang::CodeGen::CodeGenFunction
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
Definition: CodeGenFunction.h:227
clang::CodeGen::CGBuilderInserter::CGBuilderInserter
CGBuilderInserter(CodeGenFunction *CGF)
Definition: CGBuilder.h:29
clang::CodeGen::CodeGenTypeCache::SizeTy
llvm::IntegerType * SizeTy
Definition: CodeGenTypeCache.h:48
clang::CodeGen::CGBuilderTy::CreateAlignedLoad
llvm::LoadInst * CreateAlignedLoad(llvm::Type *Ty, llvm::Value *Addr, CharUnits Align, const llvm::Twine &Name="")
Definition: CGBuilder.h:99
clang::CharUnits::Zero
static CharUnits Zero()
Zero - Construct a CharUnits quantity of zero.
Definition: CharUnits.h:53
clang::CodeGen::CGBuilderTy::CreateMemMove
llvm::CallInst * CreateMemMove(Address Dest, Address Src, llvm::Value *Size, bool IsVolatile=false)
Definition: CGBuilder.h:288
clang::CodeGen::CGBuilderInserter::CGBuilderInserter
CGBuilderInserter()=default
clang::CodeGen::CGBuilderTy::CreateElementBitCast
Address CreateElementBitCast(Address Addr, llvm::Type *Ty, const llvm::Twine &Name="")
Cast the element type of the given address to a different type, preserving information like the align...
Definition: CGBuilder.h:157
clang::CharUnits
CharUnits - This is an opaque type for sizes expressed in character units.
Definition: CharUnits.h:38
clang::CodeGen::CGBuilderTy::CreateMemCpy
llvm::CallInst * CreateMemCpy(Address Dest, Address Src, uint64_t Size, bool IsVolatile=false)
Definition: CGBuilder.h:280
clang::CodeGen::Address::getAlignment
CharUnits getAlignment() const
Return the alignment of this pointer.
Definition: Address.h:67
clang::CodeGen::CGBuilderTy::CreateMemCpy
llvm::CallInst * CreateMemCpy(Address Dest, Address Src, llvm::Value *Size, bool IsVolatile=false)
Definition: CGBuilder.h:274
clang::CharUnits::One
static CharUnits One()
One - Construct a CharUnits quantity of one.
Definition: CharUnits.h:58
clang::CharUnits::getQuantity
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
Definition: CharUnits.h:179
Offset
unsigned Offset
Definition: Format.cpp:1631
CodeGenTypeCache.h
clang::CodeGen::Address::getType
llvm::PointerType * getType() const
Return the type of the pointer value.
Definition: Address.h:44
clang::CharUnits::fromQuantity
static CharUnits fromQuantity(QuantityType Quantity)
fromQuantity - Construct a CharUnits quantity from a raw integer type.
Definition: CharUnits.h:63
clang::CodeGen::CGBuilderTy::CreateMemSet
llvm::CallInst * CreateMemSet(Address Dest, llvm::Value *Value, llvm::Value *Size, bool IsVolatile=false)
Definition: CGBuilder.h:296
clang::CodeGen::CGBuilderTy::CreateFlagStore
llvm::StoreInst * CreateFlagStore(bool Value, llvm::Value *Addr)
Emit a store to an i1 flag variable.
Definition: CGBuilder.h:136
clang::CodeGen::AlignmentSource::Type
The l-value was considered opaque, so the alignment was determined from a type.
clang::CodeGen::CGBuilderTy::CreateBitCast
Address CreateBitCast(Address Addr, llvm::Type *Ty, const llvm::Twine &Name="")
Definition: CGBuilder.h:142
clang::CodeGen::CGBuilderInserter::InsertHelper
void InsertHelper(llvm::Instruction *I, const llvm::Twine &Name, llvm::BasicBlock *BB, llvm::BasicBlock::iterator InsertPt) const
This forwards to CodeGenFunction::InsertHelper.
Definition: CodeGenFunction.cpp:2318
clang::CodeGen::Address
An aligned address.
Definition: Address.h:25
clang::CodeGen::CGBuilderTy::CreateConstInBoundsGEP2_32
Address CreateConstInBoundsGEP2_32(Address Addr, unsigned Idx0, unsigned Idx1, const llvm::DataLayout &DL, const llvm::Twine &Name="")
Definition: CGBuilder.h:248
clang::CodeGen::CGBuilderTy::CreateLoad
llvm::LoadInst * CreateLoad(Address Addr, const char *Name)
Definition: CGBuilder.h:75
Address.h
clang::CodeGen::CGBuilderInserter
This is an IRBuilder insertion helper that forwards to CodeGenFunction::InsertHelper, which adds necessary metadata to instructions.
Definition: CGBuilder.h:26
CGBuilderBaseTy
clang::CharUnits::alignmentAtOffset
CharUnits alignmentAtOffset(CharUnits offset) const
Given that this is a non-zero alignment value, what is the alignment at the given offset...
Definition: CharUnits.h:190
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:22
clang::CodeGen::CGBuilderTy::CreateStructGEP
Address CreateStructGEP(Address Addr, unsigned Index, CharUnits Offset, const llvm::Twine &Name="")
Definition: CGBuilder.h:172
clang::CodeGen::CGBuilderTy::CreateAlignedLoad
llvm::LoadInst * CreateAlignedLoad(llvm::Value *Addr, CharUnits Align, const llvm::Twine &Name="")
Definition: CGBuilder.h:91
clang::CodeGen::CGBuilderTy::CreateLoad
llvm::LoadInst * CreateLoad(Address Addr, const llvm::Twine &Name="")
Definition: CGBuilder.h:70
clang::CodeGen::CGBuilderTy::CreateConstInBoundsGEP
Address CreateConstInBoundsGEP(Address Addr, uint64_t Index, CharUnits EltSize, const llvm::Twine &Name="")
Given addr = T* ...
Definition: CGBuilder.h:211
clang::CodeGen::CGBuilderTy::CreateStore
llvm::StoreInst * CreateStore(llvm::Value *Val, Address Addr, bool IsVolatile=false)
Definition: CGBuilder.h:108
clang::CodeGen::CGBuilderTy::CreateConstArrayGEP
Address CreateConstArrayGEP(Address Addr, uint64_t Index, CharUnits EltSize, const llvm::Twine &Name="")
Given addr = [n x T]* ...
Definition: CGBuilder.h:195
clang::CodeGen::Address::getElementType
llvm::Type * getElementType() const
Return the type of the values stored in this address.
Definition: Address.h:52
clang::CodeGen::CGBuilderTy::CreateConstInBoundsByteGEP
llvm::Value * CreateConstInBoundsByteGEP(llvm::Value *Ptr, CharUnits Offset, const llvm::Twine &Name="")
Definition: CGBuilder.h:262
clang::CodeGen::CGBuilderTy::CreateFlagLoad
llvm::LoadInst * CreateFlagLoad(llvm::Value *Addr, const llvm::Twine &Name="")
Emit a load from an i1 flag variable.
Definition: CGBuilder.h:129
clang::CodeGen::CGBuilderTy::CreateConstByteGEP
Address CreateConstByteGEP(Address Addr, CharUnits Offset, const llvm::Twine &Name="")
Definition: CGBuilder.h:240
clang::CodeGen::CGBuilderTy::CreateLoad
llvm::LoadInst * CreateLoad(Address Addr, bool IsVolatile, const llvm::Twine &Name="")
Definition: CGBuilder.h:82
clang::CodeGen::CGBuilderTy::CreateConstByteGEP
llvm::Value * CreateConstByteGEP(llvm::Value *Ptr, CharUnits Offset, const llvm::Twine &Name="")
Definition: CGBuilder.h:267
clang::CodeGen::CodeGenTypeCache
This structure provides a set of types that are commonly used during IR emission. ...
Definition: CodeGenTypeCache.h:33
clang::CodeGen::CGBuilderTy::CreateAlignedStore
llvm::StoreInst * CreateAlignedStore(llvm::Value *Val, llvm::Value *Addr, CharUnits Align, bool IsVolatile=false)
Definition: CGBuilder.h:115
clang::CodeGen::CGBuilderTy
Definition: CGBuilder.h:45
clang::CodeGen::CGBuilderTy::CreatePointerBitCastOrAddrSpaceCast
Address CreatePointerBitCastOrAddrSpaceCast(Address Addr, llvm::Type *Ty, const llvm::Twine &Name="")
Definition: CGBuilder.h:164
clang::CodeGen::CGBuilderTy::CGBuilderTy
CGBuilderTy(const CodeGenTypeCache &TypeCache, llvm::LLVMContext &C)
Definition: CGBuilder.h:50
clang::CodeGen::CGBuilderBaseTy
llvm::IRBuilder< llvm::ConstantFolder, CGBuilderInserterTy > CGBuilderBaseTy
Definition: CGBuilder.h:43