[cfe-commits] r82323 - in /cfe/trunk/lib/CodeGen: CGBlocks.cpp CGExprConstant.cpp CGObjCGNU.cpp CGObjCMac.cpp
Nick Lewycky
nicholas at mxc.ca
Sat Sep 19 13:00:52 PDT 2009
Author: nicholas
Date: Sat Sep 19 15:00:52 2009
New Revision: 82323
URL: http://llvm.org/viewvc/llvm-project?rev=82323&view=rev
Log:
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.
Modified:
cfe/trunk/lib/CodeGen/CGBlocks.cpp
cfe/trunk/lib/CodeGen/CGExprConstant.cpp
cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
cfe/trunk/lib/CodeGen/CGObjCMac.cpp
Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=82323&r1=82322&r2=82323&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Sat Sep 19 15:00:52 2009
@@ -50,7 +50,7 @@
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 @@
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 @@
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 @@
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,
Modified: cfe/trunk/lib/CodeGen/CGExprConstant.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprConstant.cpp?rev=82323&r1=82322&r2=82323&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprConstant.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprConstant.cpp Sat Sep 19 15:00:52 2009
@@ -745,7 +745,8 @@
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 @@
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;
Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=82323&r1=82322&r2=82323&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Sat Sep 19 15:00:52 2009
@@ -917,7 +917,7 @@
{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 @@
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::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");
Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=82323&r1=82322&r2=82323&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Sat Sep 19 15:00:52 2009
@@ -1776,7 +1776,7 @@
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::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::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::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::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 @@
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::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::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 @@
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 @@
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,
More information about the cfe-commits
mailing list