Home | History | Annotate | Download | only in CodeGen

Lines Matching refs:constant

221   llvm::Constant *Init = CGM.EmitConstantInit(D, this);
223 // If constant emission failed, then this should be a C++ static
227 CGM.ErrorUnsupported(D.getInit(), "constant l-value expression");
230 // be constant.
257 llvm::Constant *NewPtrForOldDecl =
269 // We have a constant initializer, but a nontrivial destructor. We still
286 llvm::Constant *addr =
325 // We may have to cast the constant because of the initializer
329 // RAUW's the GV uses of this constant will be invalid.
330 llvm::Constant *castedAddr = llvm::ConstantExpr::getBitCast(var, expectedType);
423 llvm::Constant *CleanupFn;
427 CallCleanupFunction(llvm::Constant *CleanupFn, const CGFunctionInfo *Info,
671 static bool canEmitInitWithFewStoresAfterMemset(llvm::Constant *Init,
686 llvm::Constant *Elt = cast<llvm::Constant>(Init->getOperand(i));
696 llvm::Constant *Elt = CDS->getElementAsConstant(i);
710 static void emitStoresForInitAfterMemset(llvm::Constant *Init, llvm::Value *Loc,
725 llvm::Constant *Elt = CDS->getElementAsConstant(i);
739 llvm::Constant *Elt = cast<llvm::Constant>(Init->getOperand(i));
751 /// from a constant global. It is beneficial to use memset if the global is all
753 static bool shouldUseMemSetPlusStoresToInitialize(llvm::Constant *Init,
805 // determinable constant initializer, there are optimizations we can do.
807 // TODO: We should constant-evaluate the initializer of any variable,
808 // as long as it is initialized by a constant expression. Currently,
1007 // If this was emitted as a global constant, we're done.
1040 llvm::Constant *constant = 0;
1042 assert(!capturedByInit && "constant init contains a capturing block?");
1043 constant = CGM.EmitConstantInit(D, this);
1046 if (!constant) {
1066 if (shouldUseMemSetPlusStoresToInitialize(constant,
1067 CGM.getDataLayout().getTypeAllocSize(constant->getType()))) {
1071 if (!constant->isNullValue() && !isa<llvm::UndefValue>(constant)) {
1072 Loc = Builder.CreateBitCast(Loc, constant->getType()->getPointerTo());
1073 emitStoresForInitAfterMemset(constant, Loc, isVolatile, Builder);
1080 new llvm::GlobalVariable(CGM.getModule(), constant->getType(), true,
1082 constant, Name);
1208 // If this was emitted as a global constant, we're done.
1231 llvm::Constant *F = CGM.GetAddrOfFunction(FD);
1310 // But if the array length is constant, we can suppress that.
1312 // ...and if it's constant zero, we can just skip the entire thing.