зеркало из https://github.com/microsoft/clang-1.git
Make clang stop relying on ConstantStruct::get's default value for isPacked
which will be going away (ie. it's becoming a required parameter) later today. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82323 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
23e81bae8c
Коммит
0d36dd28bb
|
@ -50,7 +50,7 @@ BuildDescriptorBlockDecl(bool BlockHasCopyDispose, uint64_t Size,
|
|||
Elts.push_back(BuildDestroyHelper(Ty, NoteForHelper));
|
||||
}
|
||||
|
||||
C = llvm::ConstantStruct::get(VMContext, Elts);
|
||||
C = llvm::ConstantStruct::get(VMContext, Elts, false);
|
||||
|
||||
C = new llvm::GlobalVariable(CGM.getModule(), C->getType(), true,
|
||||
llvm::GlobalValue::InternalLinkage,
|
||||
|
@ -163,7 +163,7 @@ llvm::Value *CodeGenFunction::BuildBlockLiteralTmp(const BlockExpr *BE) {
|
|||
Elts[0] = CGM.getNSConcreteGlobalBlock();
|
||||
Elts[1] = llvm::ConstantInt::get(IntTy, flags|BLOCK_IS_GLOBAL);
|
||||
|
||||
C = llvm::ConstantStruct::get(VMContext, Elts);
|
||||
C = llvm::ConstantStruct::get(VMContext, Elts, false);
|
||||
|
||||
char Name[32];
|
||||
sprintf(Name, "__block_holder_tmp_%d", CGM.getGlobalUniqueCount());
|
||||
|
@ -516,7 +516,7 @@ BlockModule::GetAddrOfGlobalBlock(const BlockExpr *BE, const char * n) {
|
|||
llvm::ConstantInt::get(UnsignedLongTy,BlockLiteralSize);
|
||||
|
||||
llvm::Constant *DescriptorStruct =
|
||||
llvm::ConstantStruct::get(VMContext, &DescriptorFields[0], 2);
|
||||
llvm::ConstantStruct::get(VMContext, &DescriptorFields[0], 2, false);
|
||||
|
||||
llvm::GlobalVariable *Descriptor =
|
||||
new llvm::GlobalVariable(getModule(), DescriptorStruct->getType(), true,
|
||||
|
@ -557,7 +557,7 @@ BlockModule::GetAddrOfGlobalBlock(const BlockExpr *BE, const char * n) {
|
|||
LiteralFields[4] = Descriptor;
|
||||
|
||||
llvm::Constant *BlockLiteralStruct =
|
||||
llvm::ConstantStruct::get(VMContext, &LiteralFields[0], 5);
|
||||
llvm::ConstantStruct::get(VMContext, &LiteralFields[0], 5, false);
|
||||
|
||||
llvm::GlobalVariable *BlockLiteral =
|
||||
new llvm::GlobalVariable(getModule(), BlockLiteralStruct->getType(), true,
|
||||
|
|
|
@ -745,7 +745,8 @@ llvm::Constant *CodeGenModule::EmitConstantExpr(const Expr *E,
|
|||
Complex[1] = llvm::ConstantInt::get(VMContext,
|
||||
Result.Val.getComplexIntImag());
|
||||
|
||||
return llvm::ConstantStruct::get(VMContext, Complex, 2);
|
||||
// FIXME: the target may want to specify that this is packed.
|
||||
return llvm::ConstantStruct::get(VMContext, Complex, 2, false);
|
||||
}
|
||||
case APValue::Float:
|
||||
return llvm::ConstantFP::get(VMContext, Result.Val.getFloat());
|
||||
|
@ -757,7 +758,8 @@ llvm::Constant *CodeGenModule::EmitConstantExpr(const Expr *E,
|
|||
Complex[1] = llvm::ConstantFP::get(VMContext,
|
||||
Result.Val.getComplexFloatImag());
|
||||
|
||||
return llvm::ConstantStruct::get(VMContext, Complex, 2);
|
||||
// FIXME: the target may want to specify that this is packed.
|
||||
return llvm::ConstantStruct::get(VMContext, Complex, 2, false);
|
||||
}
|
||||
case APValue::Vector: {
|
||||
llvm::SmallVector<llvm::Constant *, 4> Inits;
|
||||
|
|
|
@ -917,7 +917,7 @@ void CGObjCGNU::GenerateProtocol(const ObjCProtocolDecl *PD) {
|
|||
{llvm::ConstantInt::get(IntTy, Properties.size()), NULLPtr, PropertyArray};
|
||||
|
||||
llvm::Constant *PropertyListInit =
|
||||
llvm::ConstantStruct::get(VMContext, PropertyListInitFields, 3);
|
||||
llvm::ConstantStruct::get(VMContext, PropertyListInitFields, 3, false);
|
||||
llvm::Constant *PropertyList = new llvm::GlobalVariable(TheModule,
|
||||
PropertyListInit->getType(), false, llvm::GlobalValue::InternalLinkage,
|
||||
PropertyListInit, ".objc_property_list");
|
||||
|
@ -930,7 +930,7 @@ void CGObjCGNU::GenerateProtocol(const ObjCProtocolDecl *PD) {
|
|||
OptionalPropertyArray };
|
||||
|
||||
llvm::Constant *OptionalPropertyListInit =
|
||||
llvm::ConstantStruct::get(VMContext, OptionalPropertyListInitFields, 3);
|
||||
llvm::ConstantStruct::get(VMContext, OptionalPropertyListInitFields, 3, false);
|
||||
llvm::Constant *OptionalPropertyList = new llvm::GlobalVariable(TheModule,
|
||||
OptionalPropertyListInit->getType(), false,
|
||||
llvm::GlobalValue::InternalLinkage, OptionalPropertyListInit,
|
||||
|
@ -1128,7 +1128,7 @@ llvm::Constant *CGObjCGNU::GeneratePropertyList(const ObjCImplementationDecl *OI
|
|||
{llvm::ConstantInt::get(IntTy, Properties.size()), NULLPtr, PropertyArray};
|
||||
|
||||
llvm::Constant *PropertyListInit =
|
||||
llvm::ConstantStruct::get(VMContext, PropertyListInitFields, 3);
|
||||
llvm::ConstantStruct::get(VMContext, PropertyListInitFields, 3, false);
|
||||
return new llvm::GlobalVariable(TheModule, PropertyListInit->getType(), false,
|
||||
llvm::GlobalValue::InternalLinkage, PropertyListInit,
|
||||
".objc_property_list");
|
||||
|
|
|
@ -1776,7 +1776,7 @@ CGObjCMac::EmitProtocolList(const std::string &Name,
|
|||
ProtocolRefs.size()),
|
||||
ProtocolRefs);
|
||||
|
||||
llvm::Constant *Init = llvm::ConstantStruct::get(VMContext, Values);
|
||||
llvm::Constant *Init = llvm::ConstantStruct::get(VMContext, Values, false);
|
||||
llvm::GlobalVariable *GV =
|
||||
CreateMetadataVar(Name, Init, "__OBJC,__cat_cls_meth,regular,no_dead_strip",
|
||||
4, false);
|
||||
|
@ -1821,7 +1821,7 @@ llvm::Constant *CGObjCCommonMac::EmitPropertyList(const std::string &Name,
|
|||
llvm::ArrayType *AT = llvm::ArrayType::get(ObjCTypes.PropertyTy,
|
||||
Properties.size());
|
||||
Values[2] = llvm::ConstantArray::get(AT, Properties);
|
||||
llvm::Constant *Init = llvm::ConstantStruct::get(VMContext, Values);
|
||||
llvm::Constant *Init = llvm::ConstantStruct::get(VMContext, Values, false);
|
||||
|
||||
llvm::GlobalVariable *GV =
|
||||
CreateMetadataVar(Name, Init,
|
||||
|
@ -1861,7 +1861,7 @@ llvm::Constant *CGObjCMac::EmitMethodDescList(const std::string &Name,
|
|||
llvm::ArrayType *AT = llvm::ArrayType::get(ObjCTypes.MethodDescriptionTy,
|
||||
Methods.size());
|
||||
Values[1] = llvm::ConstantArray::get(AT, Methods);
|
||||
llvm::Constant *Init = llvm::ConstantStruct::get(VMContext, Values);
|
||||
llvm::Constant *Init = llvm::ConstantStruct::get(VMContext, Values, false);
|
||||
|
||||
llvm::GlobalVariable *GV = CreateMetadataVar(Name, Init, Section, 4, true);
|
||||
return llvm::ConstantExpr::getBitCast(GV,
|
||||
|
@ -2234,7 +2234,7 @@ llvm::Constant *CGObjCMac::EmitIvarList(const ObjCImplementationDecl *ID,
|
|||
llvm::ArrayType *AT = llvm::ArrayType::get(ObjCTypes.IvarTy,
|
||||
Ivars.size());
|
||||
Values[1] = llvm::ConstantArray::get(AT, Ivars);
|
||||
llvm::Constant *Init = llvm::ConstantStruct::get(VMContext, Values);
|
||||
llvm::Constant *Init = llvm::ConstantStruct::get(VMContext, Values, false);
|
||||
|
||||
llvm::GlobalVariable *GV;
|
||||
if (ForClass)
|
||||
|
@ -2294,7 +2294,7 @@ llvm::Constant *CGObjCMac::EmitMethodList(const std::string &Name,
|
|||
llvm::ArrayType *AT = llvm::ArrayType::get(ObjCTypes.MethodTy,
|
||||
Methods.size());
|
||||
Values[2] = llvm::ConstantArray::get(AT, Methods);
|
||||
llvm::Constant *Init = llvm::ConstantStruct::get(VMContext, Values);
|
||||
llvm::Constant *Init = llvm::ConstantStruct::get(VMContext, Values, false);
|
||||
|
||||
llvm::GlobalVariable *GV = CreateMetadataVar(Name, Init, Section, 4, true);
|
||||
return llvm::ConstantExpr::getBitCast(GV,
|
||||
|
@ -2929,7 +2929,7 @@ llvm::Constant *CGObjCMac::EmitModuleSymbols() {
|
|||
NumClasses + NumCategories),
|
||||
Symbols);
|
||||
|
||||
llvm::Constant *Init = llvm::ConstantStruct::get(VMContext, Values);
|
||||
llvm::Constant *Init = llvm::ConstantStruct::get(VMContext, Values, false);
|
||||
|
||||
llvm::GlobalVariable *GV =
|
||||
CreateMetadataVar("\01L_OBJC_SYMBOLS", Init,
|
||||
|
@ -4604,7 +4604,7 @@ llvm::Constant *CGObjCNonFragileABIMac::EmitMethodList(
|
|||
llvm::ArrayType *AT = llvm::ArrayType::get(ObjCTypes.MethodTy,
|
||||
Methods.size());
|
||||
Values[2] = llvm::ConstantArray::get(AT, Methods);
|
||||
llvm::Constant *Init = llvm::ConstantStruct::get(VMContext, Values);
|
||||
llvm::Constant *Init = llvm::ConstantStruct::get(VMContext, Values, false);
|
||||
|
||||
llvm::GlobalVariable *GV =
|
||||
new llvm::GlobalVariable(CGM.getModule(), Init->getType(), false,
|
||||
|
@ -4730,7 +4730,7 @@ llvm::Constant *CGObjCNonFragileABIMac::EmitIvarList(
|
|||
llvm::ArrayType *AT = llvm::ArrayType::get(ObjCTypes.IvarnfABITy,
|
||||
Ivars.size());
|
||||
Values[2] = llvm::ConstantArray::get(AT, Ivars);
|
||||
llvm::Constant *Init = llvm::ConstantStruct::get(VMContext, Values);
|
||||
llvm::Constant *Init = llvm::ConstantStruct::get(VMContext, Values, false);
|
||||
const char *Prefix = "\01l_OBJC_$_INSTANCE_VARIABLES_";
|
||||
llvm::GlobalVariable *GV =
|
||||
new llvm::GlobalVariable(CGM.getModule(), Init->getType(), false,
|
||||
|
@ -4924,7 +4924,7 @@ CGObjCNonFragileABIMac::EmitProtocolList(const std::string &Name,
|
|||
ProtocolRefs.size()),
|
||||
ProtocolRefs);
|
||||
|
||||
llvm::Constant *Init = llvm::ConstantStruct::get(VMContext, Values);
|
||||
llvm::Constant *Init = llvm::ConstantStruct::get(VMContext, Values, false);
|
||||
GV = new llvm::GlobalVariable(CGM.getModule(), Init->getType(), false,
|
||||
llvm::GlobalValue::InternalLinkage,
|
||||
Init,
|
||||
|
@ -5058,7 +5058,7 @@ CodeGen::RValue CGObjCNonFragileABIMac::EmitMessageSend(
|
|||
std::vector<llvm::Constant*> Values(2);
|
||||
Values[0] = Fn;
|
||||
Values[1] = GetMethodVarName(Sel);
|
||||
llvm::Constant *Init = llvm::ConstantStruct::get(VMContext, Values);
|
||||
llvm::Constant *Init = llvm::ConstantStruct::get(VMContext, Values, false);
|
||||
GV = new llvm::GlobalVariable(CGM.getModule(), Init->getType(), false,
|
||||
llvm::GlobalValue::WeakAnyLinkage,
|
||||
Init,
|
||||
|
|
Загрузка…
Ссылка в новой задаче