clang 10.0.0git

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